What is Defect Density?
Defect Density is the number of defects confirmed in software/module during a specific period of operation or development divided by the size of the software/module. It enables one to decide if a piece of software is ready to be released.
Defect density is counted per thousand lines of code also known as KLOC.
Formula to measure Defect Density:
- Defect Density = Defect count/ size of the release
Size of release can be measured in terms of line of code (LoC).
Standard for defect density
However, there is no fixed standard for Defect density, studies suggest that one Defect per thousand lines of code is generally considered as a sign of good project quality.
Factors that affects the defect density metrics
- Code complexity
- The type of defects taken into account for the calculation
- Time duration which is considered for Defect density calculation
- Developer or Tester skills
Advantages of defect density
- It helps measure the testing effectiveness
- It helps to differentiate defects in components/software modules
- It is useful in identifying the areas for correction or improvement
- It is useful in pointing towards high-risk components
- It helps in identifying the training needs to various resources
- It can be helpful in estimating the testing and rework due to bugs
- It can estimate the remaining defects in the software
- Before the release we can determine whether our testing is sufficient
- We can ensure database with a standard defect density