Quality Assurance

QA Metrics

Key performance indicators for software quality—measuring testing effectiveness and code reliability.

Definition

QA Metrics (Quality Assurance Metrics) are quantitative measurements used to evaluate the effectiveness of software testing and the overall quality of code. They help teams understand defect rates, test coverage, and how quickly issues are detected and resolved.

Core QA Metrics

Defect Density

Number of bugs per 1,000 lines of code

Defects / KLOC
Good
< 5 per KLOC
Average
5-15 per KLOC
Bad
> 15 per KLOC

Escape Rate

Percentage of bugs found in production

Prod bugs / Total bugs × 100
Good
< 5%
Average
5-15%
Bad
> 15%

Test Coverage

Percentage of code covered by tests

Covered lines / Total lines × 100
Good
> 80%
Average
60-80%
Bad
< 60%

MTTD (Mean Time to Detect)

How quickly bugs are found

Avg time from bug creation to discovery
Good
< 1 day
Average
1-7 days
Bad
> 7 days

MTTR (Mean Time to Repair)

How quickly bugs are fixed

Avg time from bug report to fix
Good
< 4 hours
Average
4-24 hours
Bad
> 24 hours

Categories of QA Metrics

⚙️

Process Metrics

Measure testing efficiency and workflow

Test execution timeTest pass rateTest case creation rateAutomation rate
📊

Coverage Metrics

Measure what code is being tested

Line coverageBranch coverageFeature coverageRisk coverage
🐛

Defect Metrics

Measure bugs found and fixed

Defect densityEscape rateDefect ageFix rate
⏱️

Speed Metrics

Measure testing and fixing velocity

MTTDMTTRTest cycle timeRelease velocity

Why QA Metrics Matter

  • Release confidence: Know when code is ready for production
  • Resource allocation: Understand where to focus testing efforts
  • Process improvement: Identify bottlenecks and inefficiencies
  • Risk management: Predict where bugs are likely to occur
  • Stakeholder communication: Provide data-backed quality reports

Shift-Left Quality Metrics

"Shift-left" means catching bugs earlier in the development cycle, when they're cheaper to fix:

$100
Bug found in dev
$1,500
Bug found in QA
$10,000
Bug found in production

Source: IBM Systems Sciences Institute

QA Metrics Anti-Patterns

Avoid These

  • • Targeting 100% test coverage blindly
  • • Counting bugs found as a QA "win"
  • • Measuring QA by hours spent testing
  • • Ignoring escaped defects

Do This Instead

  • • Cover critical paths thoroughly
  • • Measure bugs prevented, not just found
  • • Track quality outcomes, not effort
  • • Analyze production incidents

Connecting QA and Dev Metrics

QA metrics are most valuable when connected to development metrics:

  • High churn + high defects: Rework creating bugs—slow down and clarify requirements
  • Fast cycle time + low escape rate: Healthy process—keep optimizing
  • Long lead time + low coverage: Testing bottleneck—invest in automation
  • High velocity + high escape rate: Shipping too fast—add quality gates

Frequently Asked Questions

What are the most important QA metrics?

The most important QA metrics are: Defect Density (bugs per KLOC), Escape Rate (bugs found in production vs total bugs), Test Coverage, Mean Time to Detect (MTTD), and Mean Time to Repair (MTTR). Together, these indicate testing effectiveness and quality.

What is defect density?

Defect density measures the number of defects per unit of code, usually per 1,000 lines of code (KLOC). Lower defect density indicates higher code quality. Industry average is 1-25 defects per KLOC.

What is a good test coverage percentage?

While 100% coverage sounds ideal, 70-80% is often considered good for most projects. Coverage above 80% has diminishing returns. Focus on covering critical paths and business logic rather than chasing 100%.

What is escape rate in QA?

Escape rate (or defect leakage) is the percentage of bugs that "escape" to production versus total bugs found. A lower escape rate means your testing catches more bugs before release. Elite teams achieve <5% escape rates.

How do QA metrics relate to developer productivity?

Quality and productivity are interconnected. High defect rates slow development (fixing bugs instead of features). Good QA metrics enable faster iteration by catching issues early and building confidence in releases.

Connect Quality with Activity

DevSpy tracks development activity that feeds into quality metrics—commits, PRs, and code patterns across your team.

Start Free Trial