Test Coverage Metrics
ELI5 — The Vibe Check
Test coverage metrics tell you how much of your code your tests actually exercise. Line coverage counts lines executed. Branch coverage counts decision paths taken. 100% coverage doesn't mean zero bugs — it just means every line ran at least once during testing.
Real Talk
Quantitative measures of how thoroughly tests exercise source code. Key metrics include: line/statement coverage (lines executed), branch coverage (decision paths taken), function coverage (functions called), and condition coverage (boolean sub-expressions evaluated). High coverage is necessary but not sufficient for test quality.
When You'll Hear This
"We require 80% branch coverage for PRs, but coverage alone doesn't guarantee good tests." / "100% line coverage with zero assertions is just a really slow code formatter."
Related Terms
Branch Coverage
Branch Coverage measures whether your tests cover both the 'if' AND the 'else' of every decision in your code.
Code Coverage
Code coverage is the report card for your tests. It shows you a map of your code and highlights which lines got tested (green) and which didn't (red).
Mutation Score
Mutation Score tells you how good your tests REALLY are — not just coverage, but whether they actually catch bugs.
Statement Coverage
Statement Coverage is the simplest coverage metric: what percentage of your code lines were actually executed during tests?