Defect Density

Defect Density Definition, Elaboration, Formula, and Uses:

DEFINITION

Defect Density is the number of confirmed defects detected in software/component during a defined period of development/operation divided by the size of the software/component.

ELABORATION

The ‘defects’ are:

  • confirmed and agreed upon (not just reported).
  • Dropped defects are not counted.

The period might be for one of the following:

  • for a duration (say, the first month, the quarter, or the year).
  • for each phase of the software life cycle.
  • for the whole of the software life cycle.

The size is measured in one of the following:

  • Function Points (FP)
  • Source Lines of Code

DEFECT DENSITY FORMULA

defect density image

USES

  • For comparing the relative number of defects in various software components so that high-risk components can be identified and resources focused towards them.
  • For comparing software/products so that quality of each software/product can be quantified and resources focused towards those with low quality.

5 thoughts on “Defect Density

  1. Thanks for the useful info.
    Just one addition : Calculation of defect density would be better if we calculate on the basis of the FP
    Though code churn can be taken as a early indicator for Defect Density.

  2. Thanks for the useful info.
    Just one more addition : The defect density is also measured in KLOC (per thousand line of code) e.g 12 defects are found in entire code of 2000 lines then defect rate is 6 per KLOC means current rate of defect is 6 defects per thousand line of codes

  3. The defect density is measured by adding up the number of defects reported by the Software Quality Assurance to the number of defects that are reported by the peer and dividing it by the actual size(which can be in either KlOC, SLOC or the function points to measure the size of the software product).

  4. The number of defects can be established without dispute; the size of the software product is more problematic. KLOC is meaningless for Object Oriented code so Function Points is the measure of last resort. It too can be quite subjective.

  5. Defect Density after execution phase (STLC) is total number of valid defect divide by Total number of Test cases executed.

Comments are closed.