defect density and inspection rate code example Example: defect density Defect density is the total number of defects per lines of code.