Why Defect Density
If you want to:
- take decision whether a product is ready for release/shipping.
- predict the count of remaining bugs.
- estimate the testing and rework due to bugs
- identify the areas having more bugs
- determine if the enough testing is done
Defect Density and Formula:
Defect Density is the calculated by dividing the Valid Bugs identified in a specific duration, by the size of the release.
The formula is simple, Defect Density= Defect Count / Size of the release
Size of the release, can be measured in terms of Line of Code (LoC), which is very popular. However, it is better to size the projects using Function Point, Use Case Point, Size of iterations/sprints etc.
It is based on the concept that if you have historical data, then you can predict the count of the bugs in a release. Then based on the difference of Expected Bug count and actual bug count, one can take decision.
This example calculates the Defect Density using KLoC
|Release #||Lines of Code||Defect Count
The Defect Density in above product is in range 3 to 6. Hence if we consider release 9, then you may like to spend more time on testing as the defect density is yet to go near expected density. In other words, there is still scope of finding 430 to 1180 bugs.
Once you close the testing of Release 9.0, then you will updated the above table, and it may possible that expected Defect Density dips/surges further.
Following Graph is the example, of Defect Density using size (Function/Use point).