Testing Glossary
Test Coverage
A metric that measures the percentage of source code executed by automated tests, indicating how thoroughly the codebase is tested.
Test coverage quantifies how much of your application's source code is exercised when the test suite runs. It is typically expressed as a percentage and can be measured at different granularities: line coverage, branch coverage, function coverage, and statement coverage. Tools like Istanbul/nyc, coverage.py, JaCoCo, and SimpleCov instrument the code and produce reports showing exactly which lines were hit.
What Coverage Tells You — and What It Does Not
High coverage means that a large portion of the code is at least executed during testing. This reduces the risk of shipping untested logic. However, coverage is not a measure of test quality. A test that calls a function without asserting anything meaningful will increase coverage without catching bugs. For this reason, coverage is best used as a lower-bound indicator: low coverage reliably signals risk, but high coverage does not guarantee correctness.
Setting Coverage Targets
Many teams enforce a minimum coverage threshold in CI — often between 70% and 90% — to prevent untested code from being merged. The right target depends on the project. Safety-critical systems may mandate near-complete coverage, while a fast-moving prototype might accept lower numbers. What matters most is the trend: coverage should stay stable or increase over time, not steadily erode.
Coverage in Practice
Modern CI workflows generate coverage reports alongside test results and surface them in pull request comments, making it easy for reviewers to spot when a change introduces untested paths. Some tools integrate with test monitoring platforms to track coverage trends across builds and branches.
Branch coverage is generally more informative than line coverage because it reveals whether both sides of conditional logic have been tested. Focusing exclusively on line coverage can miss important scenarios where an if-else block is only exercised in one direction.
Ultimately, coverage is one signal among many. Pairing it with metrics like flakiness rate, test duration, and health score gives a much fuller picture of test suite effectiveness.
Related Terms
Monitor Your Test Suite Health
TestGlance tracks test results, detects flaky tests, and surfaces health trends automatically.
Get Started