software-qualitydefects

How should one measure Defect Density?


Is there a standard way of measuring Defect Density? Most sites online state that it should be measured as:

number of defects discovered / the code size

My questions are:

Our ultimate goal is to be able (a) to compare our defect density against industry standards (b) to identify modules which are fragile and more buggy and deserve more attention (c) to use a consistent metric in order to draw a trend line demonstrating improvement in the quality of a module over time


Solution

  • I'm guessing that Defect Density is used in order to detect the rate at which your programmers are generating defects, whereas subtracting fixed defects is to do with the number of complaints made by your customers/end users.

    Of your goals, (a) seems unsound, (b) is hugely incisive and will pay dividends and (c) may induce false optimism.

    You should really be aiming for Zero Defects and you should, for metrics purposes, ignore bugs found and fixed before release.