runtimeverification / runtimeverification/kontrol
Optimize Foundry test suite
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 122
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
The Foundry test suite we use for CI proofs must be better organized. With duplicated test contracts (such as PlainPrankTest.t.sol and PrankTest.t.sol), contracts that do not use the setUp functionality repeatedly deploy auxiliary contracts in the tests. In addition, a lot of tests are skipped to keep the CI time low.
A few optimizations:
-
Get a smaller test-suite codebase, resulting in lower kompile time:
- Merge duplicated contracts
- Remove/merge tests with duplicated logic
-
Improve performance of the tests:
- Use the
setUpfunctionality instead of deploying auxiliary contracts in the test. - replace
assertEqandassertGtassertion calls withassert. SinceassertEqis a function from the forge test library, this will reduce the number of kcfg nodes generated by removing calls to the forge test contract. We can add individual unit tests to check thatassertEqandassertact similarly. - use
notBuiltinAddress()in unit tests that use symbolic addresses to avoid unnecesary branchings.
- Use the
By implementing these we could (1) reduce CI time and/or (2) run more tests that are currently skipped in the same amount of time.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the Foundry test suite, especially PlainPrankTest.t.sol and PrankTest.t.sol, then identify duplicated test logic and auxiliary-contract deployments. Review the skipped tests and uses of setUp, assertEq, assertGt, and notBuiltinAddress. Done means a smaller, faster suite with fewer skipped tests while retaining equivalent assertion coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- ci-cd, testing-qa
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100