All glossary terms
Verify

Test coverage

Test coverage is the percentage of code (typically measured by line, branch, or function) exercised by the test suite. Coverage is a necessary-but-insufficient quality signal: low coverage indicates untested code; high coverage doesn't guarantee correctness because the tests may exercise without asserting.

Coverage targets are contentious. Common defaults are 80% line coverage for application code, 100% for critical paths (security, payment, auth). The trap of coverage-as-goal: writing tests to hit a number produces low-quality tests that exercise without verifying. The trap of coverage-as-vanity: high coverage on uninteresting code (getters, constants) inflates the number while the hard parts remain undertested. The pragmatic discipline: use coverage to surface uncovered critical-path code, not as a metric to maximise. Pair coverage with mutation testing for a stronger signal of test effectiveness.

Related terms