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.
Related tools
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.