Overview
Code coverage reports which parts of source code were executed while a test suite ran. It can reveal untested areas, but execution alone does not prove that assertions are meaningful.
Understand coverage types
Line coverage records executed lines. Branch coverage considers decision outcomes. Path coverage is more demanding because combinations of branches can grow rapidly.
Use coverage as a diagnostic
Look for important business rules with no tests, untested error handling and code that is difficult to reach. Review uncovered code according to risk rather than chasing a universal percentage.
Pair coverage with mutation testing
A line can execute while the test would still pass if the implementation were wrong. Mutation testing helps evaluate whether assertions detect selected code changes.
Report honestly
Document exclusions and generated files. Avoid changing thresholds simply to make a dashboard green, and never compare percentages from different configurations as if they were equivalent.