Test Metrics and Reporting
Test metrics turn testing activity into measurable data, helping teams understand quality trends, coverage, and whether a release is genuinely ready.
Common Testing Metrics
No single metric tells the whole story, but tracked together, these give a meaningful picture of a project's quality trends over time.
- Test coverage — the proportion of code or requirements exercised by tests.
- Pass/fail rate — the percentage of test cases currently passing.
- Defect density — the number of defects found relative to the size of the codebase or feature.
- Defect leakage — defects that escaped testing and were found in production.
Using Metrics Responsibly
Metrics should inform decisions, not become targets pursued for their own sake. Chasing a specific test coverage percentage, for example, can lead to shallow tests written purely to inflate the number rather than to catch real defects.
Common Mistakes
- Treating 100% test coverage as the ultimate goal, even when it means writing shallow, low-value tests just to hit the number.
- Reporting a single metric in isolation without the context needed to interpret it meaningfully.
- Ignoring defect leakage, missing valuable insight into how effective the testing process actually is at catching real issues before release.
- Comparing metrics across very different projects or teams without accounting for differences in scope, complexity, or risk.
Professional Tip
High test coverage tells you how much code was executed by tests, not how well that code was actually verified. A test can execute a line without meaningfully checking its behaviour — treat coverage as one useful signal among several, not a complete measure of quality.
Your Turn
For a recent release (real or hypothetical), decide which three metrics would be most useful to report to a non-technical stakeholder, and explain why in a sentence each.
Mini Quiz
What does 'defect leakage' measure?