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:
Size of release can be measured in terms of line of code (LoC).
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