
Variables
Description
What is this formula?
Defect Density measures the number of software defects found per thousand lines of source code (KLOC).
It is one of the most common software quality metrics used to compare the reliability and maintainability of software systems of different sizes.
A lower defect density generally indicates higher software quality.
When to use it
Use this formula when:
- evaluating software quality,
- comparing software projects,
- assessing development processes,
- tracking quality improvements,
- benchmarking software reliability.
Example
A software application contains:
KLOC = 120
A quality audit identifies:
D = 54 defects
Formula:
DD = D / KLOC
Substitution:
DD = 54 / 120
DD = 0.45
Result:
Defect Density = 0.45 defects/KLOC
Applications
- Software quality assurance
- Reliability engineering
- Process improvement programs
- Software audits
- Benchmarking software projects
Note
Defect Density is an empirical software quality metric rather than a fundamental law. Results depend on how defects are defined, reported, and counted. Different organizations may use different defect classification criteria, making direct comparisons difficult unless measurement methods are standardized.
