Skip to content
Hiep Lam
Go back

Beyond Coverage, Part 1: The Test-Quality Metric Catalog

Edit page đŸ‡»đŸ‡ł Tiáșżng Việt

“Beyond Coverage: Test Quality for the Agentic Loop” - Part 1 of 7. There is no single “test quality” number - this part lays out the whole catalog as a stack of four layers, each answering a different question. Part 0 established why coverage lies; this is the map of what to measure instead.


How to think about it: four layers, four questions

LayerQuestion it answersPrimary metricsIndicator type
1 · ReachabilityDid the test even run this code?Line/statement, branch/condition, MC/DC coverageNegative only (low = bad; high ⇏ good)
2 · Effectiveness ★Would the test notice if the code were wrong?Mutation score, assertion density & quality, test-smell freedomPositive - this is “good”
3 · Risk targetingAre the changed and critical parts tested?Diff/changed-line coverage, critical-path coverage, property-based testingPositive (scoped)
4 · Trust & healthIs the signal reliable enough to gate a merge?Flakiness rate, suite speed, determinism, pass-on-rerunGate prerequisite

The test-quality metric stack: four layers, each answering a different question about the suite No single number is “test quality.” Read the suite as four layers, and gate bottom-anchored.

You build up the stack and you gate bottom-anchored: fix the coverage zeros, then prove oracle strength, then aim it at the diff and critical paths, and only trust it to gate merges once it’s reliable.

Layer 1 - Reachability (coverage family)

Use: negative indicator + the denominator that tells mutation tools where it’s even worth placing mutants.

Layer 2 - Effectiveness (the oracle layer) ★

This is the heart. These metrics measure whether the assertions can catch a regression.

Layer 3 - Risk targeting

Effectiveness is expensive; spend it where it matters.

Layer 4 - Trust & health

A suite can be effective and still untrustworthy as a gate.

What this means for “did I write enough tests?”

Stop asking “what’s my coverage %?” Ask, per module, in this order:

  1. Are there coverage zeros on changed/critical code? (Layer 1 - cheap to find.)
  2. Do surviving mutants exist on those lines? i.e., can I break the code and have tests still pass? (Layer 2 - the real answer.)
  3. Are the assertions behavioural, and free of smells? (Layer 2.)
  4. Is the diff and the money-path covered with strong oracles? (Layer 3.)
  5. Is the suite fast and flake-free enough to trust unattended? (Layer 4.)

A “good enough” legacy suite is one where, for the code you’re changing, the answers are no zeros, few survivors, behavioural asserts, no flakes. That is the precondition for the agentic loop - quantified in Part 6.

The layer that decides “good,” Layer 2, deserves its own close look. Mutation score is the sharpest instrument we have for it, and Part 2 is a proper explanation of how it actually works.


Sources


← Previous: Part 0 - Why Coverage Lies · Next: Part 2 - Mutation Testing, Properly Explained →

The series - Beyond Coverage: Test Quality for the Agentic Loop: 0 · Why Coverage Lies · 1 · The Metric Catalog (you are here) · 2 · Mutation Testing, Properly Explained · 3 · What the Empirical Research Actually Says · 4 · Tooling for Go and .NET · 5 · Grading AI-Generated Tests · 6 · The Readiness Rubric


Edit page
Share this post:

Previous Post
Beyond Coverage, Part 0: Why Coverage Lies (and What Your Instinct Gets Right)
Next Post
Beyond Coverage, Part 2: Mutation Testing, Properly Explained

Keep reading

A few more pieces in the same vein.

Rather read on your own time? Subscribe via RSS