Coverage measures one thing: which lines of your code executed while the tests ran. Not whether anything checked the results. Not whether the tests would fail if the code were wrong. Executed. That's the entire contract, and every myth below comes from forgetting it.
Martin Fowler said this back in 2012 and it still hasn't landed: coverage is for finding code nobody tests at all, not for scoring the tests you have. I keep meeting teams who can recite that sentence and still ship a 90 percent mandate in the same quarter. Why does the number keep winning against its own definition? Because it's cheap to compute, it fits in a badge, and it goes up when people work. Metrics with those three properties don't die. They get myths instead.
Myth one: does 100 percent mean the code is tested?
A test that calls a function and asserts nothing produces the same green line in the report as a test that checks every edge. I've written a whole piece on how an AI assistant games this in about five minutes, so I won't repeat the mechanics. The point that belongs here is older than the models: the gap between executed and verified was always there. Generated tests just industrialised it.
Trail of Bits put it cleanly in their April 2026 mutation-testing write-up: coverage "measures execution, not verification." Their example wasn't academic either. A mutation campaign surfaced a high-severity vulnerability in the Arkis protocol that a fully covering test suite had sailed past.
Myth two: is the percentage comparable across projects?
It isn't even comparable across configurations. Line coverage, statement coverage and branch coverage give different numbers for the same suite; a repo counting branches will look worse than its neighbour counting lines while testing more. Add generated code, vendored code and config excluded in one project but counted in another, and "we're at 84, they're at 79" is a sentence with no content. When a leadership dashboard ranks teams by coverage, it's ranking their exclusion lists.
Myth three: is the last ten percent worth the climb?
The final stretch to 100 is mostly getters, argument parsers, error branches for errors that can't occur, and glue. Covering it produces tests wired to implementation details, which then break on every refactor without ever catching a bug. That's not a neutral cost. A suite that cries wolf trains the team to silence it, and I've watched what happens once suppression becomes habit. It doesn't stay contained to the one metric.
Here's my opinionated line, and plenty of people disagree: a mandated 100 percent is worse than a mandated 80, because the last twenty points are purchased almost entirely with assertion-free filler. The Python services I maintain gate at high coverage on changed lines only, and the whole-repo number is a graph someone glances at monthly. Nothing else has held up over the years without breeding junk tests.
Myth four: does coverage stop regressions?
Coverage is a map of where tests went, drawn once, in the past tense. A regression is a behaviour change in the future. The map doesn't object when behaviour changes, only when lines stop executing, and most bugs don't uncover lines. Is a suite at 95 percent safer than one at 40? Usually, sure, because the 40 has entire rooms nobody entered. Between 80 and 95, though, the number tells you almost nothing about how the next bad merge goes.
What should you gate on instead?
Three replacements, in the order I'd adopt them.
Changed-line coverage first. Gate the diff, not the repo. diff-cover has done this for years: it reads any Cobertura-style coverage report, JavaScript and Python alike, and fails the pull request if new lines lack tests, while twenty-year-old code stays out of the argument. It's the same money, better aimed. This gate goes in front of the heavier ones I sequence elsewhere because it's fast and it never punishes anyone for history they didn't write. A 200-commit ratchet replay shows what that gate catches and where it misfires.
Mutation score for the code that matters. Seed deliberate bugs, count how many the suite catches. StrykerJS ships incremental mode, which stores results in a stryker-incremental.json and re-tests only what changed, so it's finally cheap enough for pull requests rather than a nightly. The JVM has PIT, at release 1.19.1 as I write. Python has mutmut and cosmic-ray. Go, Rust and Solidity got mewt from Trail of Bits this spring, built on Tree-sitter instead of regex mangling. Nobody runs mutation testing on everything; run it on the payment path and the parser, and let the CRUD live.
Assertion density as a lint rule. The cheapest check of the three: a test with zero assertions is a coverage donation, and eslint-plugin-jest's expect-expect rule or a ten-line pytest plugin flags it at commit time. It won't catch a weak assertion. It catches the empty ones, which, in the generated-test era, is suddenly a category with volume.
What do 100 percent lines and 17.86 percent mutation look like?
Added 9 October 2026, because a reader asked for the numbers rather than the argument. I wrote a 20-line JavaScript module with two functions, a discount calculator with three if branches and a cap, and a shipping function with one branch and a ternary. Then I wrote the kind of test suite a generated-test tool produces when nobody reads it: two tests, three assertions, none of them checking a specific discount. One asserts the result is greater than zero. One asserts the type is a number.
Vitest 3.2.4 with the v8 provider reported 100 percent statements, 100 percent lines, 100 percent functions. Branches came in at 75 percent, with one ternary arm never taken. So a line-coverage gate at 90 passes this suite outright, and a branch gate at 70 passes it too.
StrykerJS 9.1.1 then generated 28 mutants for those 20 lines. The weak suite killed five. Twenty-three survived, for a mutation score of 17.86 percent. The survivors are the whole story of this article in one table:
| Mutation type | Survived | What it means |
|---|---|---|
| ConditionalExpression | 9 | an if replaced with true or false went unnoticed |
| EqualityOperator | 6 | >= swapped for > and the suite didn't care |
| BlockStatement | 3 | an entire branch body deleted, still green |
| MethodExpression | 2 | Math.max became Math.min, no test objected |
| AssignmentOperator, LogicalOperator, StringLiteral | 1 each | the member check, the +=, and the literal "member" all mutated freely |
Every one of those 23 mutants ran under a test. Coverage saw them executed and reported success. Then I replaced the suite with seven tests and ten assertions that name exact values: 10 percent at exactly 100, 15 for a member with six items, 30 as the cap. Branch coverage went to 100 and all 28 mutants died. Same module, same 20 lines, same tool, seven seconds per run.
Is that a fair fight? The example is small and I built it, so take the ratio and not the absolute figure. What I'd stand behind: the gap between "100 percent covered" and "18 percent verified" isn't an edge case you need a pathological suite to hit. It's what assertion-free tests produce by construction, and the branch number is only a slightly better liar than the line number. The same measurement answers the radar's recurring question about which metric to gate on, and it answers it with a column of 23 survivors.
Why frame coverage by risk, not by line count?
Every gate above quietly assumes one thing: that not all code deserves the same scrutiny. That's the shift that matters more than any single tool. A coverage number treats the password reset flow and the "About" page footer as equally worth testing, and they are not within a mile of each other.
So weight the target by blast radius. What breaks a payment, corrupts data, or leaks a credential gets held to a mutation score, not a line count. The parser, the auth check, the money path: these are where an escaped bug costs you a weekend and a customer. Boring CRUD and display glue can sit at whatever coverage falls out of testing the parts that matter, and nobody should spend a sprint dragging it upward.
How do you decide what's high-risk without convening a committee? I use a rough rule: if I'd want a second reviewer on the change, it's on the critical path. That's it. The point of coverage was never a single portfolio-wide percentage; it was knowing which untested lines can actually hurt you. A risk map does that. A 90 percent mandate flattens it back into noise.
Why keep the coverage number but demote it?
I'm not arguing for deleting the coverage report. It still does the one job Fowler assigned it: pointing at code nothing exercises. What it can't survive is promotion to a target, because the moment a measure becomes the goal, the cheapest way to move it wins, and the cheapest way to move coverage has never been writing better tests. The same logic applies to the model billing you per review: a metric nobody interrogates becomes a line item nobody planned. Gate the diff, mutate the critical paths, lint away the empty tests. Let the percentage go back to being a flashlight. It was never a finish line.