Skip to main content

Software testing metrics

Short answer

Software testing metrics are quantitative measures for testing progress, quality, and effectiveness. Key metrics include test execution percentage, pass rate, defect density (defects/KLOC), defect removal efficiency (DRE = E/(E+D)), defect leakage, and code coverage. They guide release readiness and process improvement, not individual blame.

Explain software testing metrics.

Software testing metrics are quantitative measures used to estimate the progress, quality and effectiveness of testing. They help managers decide whether the software is ready to release and how to improve the test process.

Base metrics are raw counts collected during testing: number of test cases written, executed, passed, failed and blocked, number of defects found, and effort spent. Derived metrics are calculated from them.

MetricFormula / meaning
Test execution %Tests executed / total tests × 100
Pass rate %Tests passed / tests executed × 100
Defect densityDefects found / size (KLOC or function points)
Defect removal efficiency (DRE)E / (E + D), E = errors found before delivery, D = defects found after delivery
Defect leakage %Defects found by users / total defects × 100
Requirements coverageRequirements tested / total requirements × 100
Code coverageStatements or branches executed / total × 100
Defects by severityCount of critical, major, minor defects
Mean time to failure (MTTF)Average operating time between failures
Test effortPerson-hours per test case or per defect

Example: 95 errors are found during testing and 5 defects are reported by users after release. DRE = 95 / (95 + 5) = 0.95, so testing removed 95% of the defects. If the system is 20 KLOC, defect density = 100 / 20 = 5 defects per KLOC.

Metrics should be used to improve the process, not to blame individual testers.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Software Engineering chapter 8 questions →