Statement Coverage
ELI5 — The Vibe Check
Statement Coverage is the simplest coverage metric: what percentage of your code lines were actually executed during tests? 80% statement coverage means 20% of your code is untested. It's useful but misleading — you can hit every line without testing every scenario.
Real Talk
Statement coverage (line coverage) measures the percentage of executable code statements executed during testing. It's the most basic coverage metric, easy to achieve but insufficient alone — it doesn't ensure all branches or conditions are tested. Useful as a minimum threshold, not a quality indicator.
When You'll Hear This
"100% statement coverage doesn't mean 100% tested — it just means every line ran once." / "Our CI requires 80% statement coverage as a minimum bar, but we care more about branch coverage."
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.