The purpose behind software testing is to bring to forefront all such errors that can cause malfunction. Today competition is so high that every company wants to have a perfect final product. In order to validate the functioning of the program, it has to go through rigorous rounds of testing. The defects found during testing are then removed so as to make the final launch product near perfect. Through this article, we shall try and impart to you more knowledge about Defect Density.
Defect Density in any software or program can be defined as the ratio of total number of defects that have been confirmed to the size of the program. In metric terms, it is defined as the ratio of total defects to the total number of line codes. One thing that needs to be clearly understood is that, here, defects refer to all those errors that have been confirmed and not just reported. So any defect that has been reported but not validated or agreed upon will not be counted.
The mathematical formula for calculating Defect density is:
Defect Density = Number of Defects / Size of the Software
Here, the size of the project can be measured in terms of feature points or function points.
Many times Defect Density is also calculated per thousand lines of written code. This is also known as KLOC, where "K" stands for "thousand" and LOC is the "Lines of Code".
Defect density is usually calculated to serve one of the two below mentioned purposes:
The prime advantages of calculating Defect Density are:
Those factors that can affect the Defect Density are:
There is no fixed standard for calculating Defect Density. One standard might be suitable to a particular type of software but it might not serve the purpose in another. The popular belief is that KLOC method is the most advisable.