Skip to main content

Defect Density

Defect density measures the number of confirmed defects relative to the size of the software — typically defects per thousand lines of code, or per feature/module — allowing comparison of quality across different components, releases, or teams on a normalized basis rather than raw defect counts alone.

Raw defect counts are misleading on their own — a large, complex module having more bugs than a small one doesn't necessarily mean it's worse quality, just bigger. Normalizing by size (defects per thousand lines of code, or per story point) gives a fairer basis for comparing quality across genuinely different-sized pieces of work.

It's most useful as a trend indicator over time within the same codebase — a module whose defect density is climbing release over release is a meaningful signal worth investigating, more so than a single snapshot number compared across unrelated projects with very different contexts and risk profiles.

Defect Density — Definition, Example & How It's Used | QA Bash Glossary | QA Bash