What is Defect Density and how can we calculate Defect Density ?

Questions by Puneetmehta79   answers by Puneetmehta79

Showing Answers 1 - 5 of 5 Answers


  • Feb 4th, 2007

Defect density is one of the metric which is equal to the ratio of number of defects to the number of lines of code .

  Was this answer useful?  Yes

Sachin Umrikar

  • Mar 7th, 2007

Defect Density:

Defect Density = Defect/unit size

Ex: Suppose 10 bugs are found in 1 KLOC
Therefore DD is 10/KLOC

  Was this answer useful?  Yes

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
Number of Defects
Defect Density =  --------------------------------

Defect Density 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.

  Was this answer useful?  Yes

Defect density is a measure of the total known defects divided by the size of the software entity being measured.

    Number of Known Defects

The Number of Known Defects is the count of total defects identified against a particular software entity, during a particular time period. Examples include:
 Defect to date since the creation of module
 Defects found in a program during an inspection
 Defects to date since the shipment of a release to the customer

Size is a normalizer that allows comparisons between different software entities (i.e., modules, releases, products).
Size is typically counted either in Lines of Code or Function Points.

Uses: Defect Density is used to compare the relative number of defects in various software components. This helps identify candidates for additional inspection or testing or for possible reengineering or replacement.

  Was this answer useful?  Yes

Defect density is a metric used to make informed decisions about software quality.

Defect density = # of defects / unit or component size

The size is measured in:
> Software lines of code (SLOC)
> Function points (FP)

This measure is often used to determine high-risk components that will require more attention in future projects.  It is also used to provide a baseline for process improvements.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions