Code coverage
Code coverage is the percentage of source code executed by a test suite, broken down by statement, branch, or line. High coverage indicates wide test reach; it does NOT indicate test quality — tests can pass while asserting nothing.
Code coverage is the most common metric and the most misused. Teams chasing 100% coverage write tests that touch every line without checking outputs — coverage looks great, defects ship anyway. Useful coverage discipline: set a floor (e.g. 70%) for safety; track delta on each PR (don't regress); pair with mutation testing for a quality check. Coverage on the critical path (auth, billing, data integrity) matters far more than the team-wide average.
Long-form posts that explore code coverage in depth — when to use it, common failure modes, how AI helps.
Related terms
- Mutation testing
Mutation testing measures test quality by introducing small bugs (mutations) into the source code and checking whether tests catch them.
- Regression test
A regression test verifies that previously working functionality still works after a code change.
- Integration test
An integration test verifies that multiple components work together correctly — a service hitting a real database, two microservices communicating, a frontend talking to a real API.