Test Coverage
PronunciationTEST KUV-er-ij
Definition
The percentage of your code that runs during tests. It shows what is untested, but not how good the tests are.
Where you hear it
Quality gates and code review rules.
Examples
Test coverage is 82%, but the payment module is not covered.
We require at least 80% coverage on new code.
The report shows 95 percent coverage, but the tests never check the error branch.
Common mistake
Chasing 100% coverage with meaningless tests. A high number does not prove the code is correct.
Don't confuse with
Test coverage measures which lines of code execute during tests, whereas code quality measures how well-written and maintainable that code is.
Say it at work
- In a meeting or chat
Let us check the test coverage report before we merge this pull request.
- In an email or ticket
Please add unit tests to improve the test coverage for this module.
Keep exploring
More in Testing & Quality