increase code coverage
Closed this issue · 7 comments
Scope
- increase coverage by x%
Deliverables
- unit tests that increase coverage
Gain for the project
Roles
bounty gardener: name / share
bounty worker: name / share
bounty reviewer: name / share
@johannbarbie
Can I take this issue?
yes, but we need to specify the x.
@pinkiebell @peara what is the coverage now, and what could be realistic to achieve?
@johannbarbie This is the result in my local:
----------------------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
----------------------|----------|----------|----------|----------|----------------|
contracts/ | 85.08 | 79.46 | 88.07 | 84.41 | |
EVMConstants.sol | 100 | 100 | 100 | 100 | |
EVMRuntime.sol | 83.33 | 80.95 | 85.23 | 82.42 |... 2,1793,1794 |
Enforcer.sol | 92.59 | 50 | 100 | 89.66 | 98,99,101 |
EthereumRuntime.sol | 100 | 100 | 100 | 100 | |
HydratedRuntime.sol | 88 | 75 | 100 | 90.63 | 72,73,74 |
Verifier.sol | 97.44 | 80.43 | 100 | 97.65 | 260,290 |
----------------------|----------|----------|----------|----------|----------------|
All files | 85.08 | 79.46 | 88.07 | 84.41 | |
----------------------|----------|----------|----------|----------|----------------|
Honestly, it looks pretty good. I guess the rest are not easy to test.
@pinkiebell What do you think?
I found that many mock contracts have been removed.
While that's cool because the whole system is now functional, I was really like those mock contracts because they help us write unit tests for other contracts.
What do you guys think about reintroduce some of them?
@johannbarbie @pinkiebell
In particular, I want the VerifierMock
contract. It is helpful to test the Enforcer
contract separately.
let's keep them in a separate folder (tests
, or contracts/mocks
) and exclude them from coverage , then i don't see a problem.
regarding the coverage above, i see value in increasing the coverage in these contracts:
- EVMRuntime.sol
- Enforcer.sol
to > 97%.
👍 Yes, we can leverage the #66, to test the enforcer contract further in the future