Skip to content
Omnikalc

How good is your testing at catching bugs before release?

Enter the defects found before and after release and the code size: get the defect density per thousand lines and the defect removal efficiency.

Updated on
Your inputs

Value out of range

Value out of range

Value out of range

Results

Defect removal efficiency

90.0%

Good defect removal, with room to improve testing
Total defect density (per thousand lines)
4.44
Post-release defect density (per thousand lines)
0.44
Total defects found
200

How good is a team at catching bugs before users do? Two simple ratios answer that. The defect density counts defects per thousand lines of code, and the defect removal efficiency (DRE) gives the share of defects found before the release. This calculator computes both, plus the density of defects that escaped to production, from your counts.

How the calculation works

  • Total defects = defects found before + defects found after release
  • Defect density = total defects ÷ code size in thousands of lines (KLOC)
  • Post-release density = defects found after ÷ KLOC
  • DRE = defects found before ÷ total defects

Example

A release of 45 KLOC has 180 defects found before release and 20 found after. The total is 200, so the defect density is 4.44 per KLOC. The defect removal efficiency is 90%, and the post-release density is 0.44 per KLOC, so one defect in ten reached users.

Why it matters

These measures turn quality into numbers that can be tracked from release to release. A falling post-release density with a rising DRE indicates that reviews and testing are working, while a rising density with a flat DRE shows that more defects are being introduced. They also help decide whether a release is ready.

Good to know

Defect counts depend on how defects are defined and logged, and on how long users have had to find them after release, so the post-release count keeps growing. Size measured in lines of code is crude. Use the figures to look at trends, not to compare people or rank teams. A high density is not always bad news: a team that tests thoroughly finds more defects early, which raises the density but also the removal efficiency. Look at both figures together and at the severity of the defects, since a few critical ones matter more than many minor ones. This tool is for education.

The A/B test calculator evaluates experiments, the MTBF calculator relates failures to repair time, and the cost of delay calculator helps decide what to work on first.

Frequently asked questions

What is defect density?

The number of confirmed defects divided by the size of the software, usually per thousand lines of code (KLOC). It gives a way to compare modules, releases or teams of different sizes.

What is defect removal efficiency?

The share of all defects that are found before release: defects found before ÷ (defects found before + defects found after). A DRE of 90 percent means 1 in 10 defects reaches users.

What is a good defect density?

It depends on the domain. Mature commercial software often has about 1 to 5 defects per KLOC found during testing and below 0.5 after release, while safety-critical software aims far lower. Compare against your own past releases.

Are lines of code a good measure of size?

They are crude, since languages and styles differ. Function points or the number of changes are alternatives. Use the same measure each time so the trend is meaningful.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.