Software Testing Metrics
Overview
Metrics are the means by which software quality can be measured, managed, improved, etc. They provide the visibility you need into the product or process you follow. You may use different metrics for different purposes. Some examples of Testing metrics are the number of defects found, the number of test cases written, etc.
Testing Metrics
There are lots of metrics that we can use to track the progress of the project and measure the quality. Every project should be measured for its schedule, cost, effort, and quality. We will look at some of the testing metrics below. Each metric has a different purpose.
Defect Density
The number of defects per KLOC or 1,000 lines of code. It is the ratio of the number of defects found vs. the total number of lines of code. This metric indicates the quality of the application under test.
Defect Density =
For example, if a module has 2000 LOC. If 4 defects are uncovered during the testing of the module. The defect density is :
The defect density of module =
= 2
Note that = 2000 LOC = 2 KLOC.
Defect Removal Efficiency
This metric indicates the efficiency of defect removal methods used in the organization. It is the ratio of the number of defects that are removed per time unit. ( man hours or weeks ) . The total effort required for defect detection, resolution time, and retesting time of the defects removed.
Defect Removal Efficiency =
Test Coverage
It is calculated as the number of test cases executed or covered vs. the total number of test cases. This metric is an indication of the completeness of the testing. It provides a clue to which extent the testing covers the product’s requirements. Note that it does not indicate the effectiveness of the testing. Furthermore, this metric can be used as a criterion to stop testing.
Most of the time it is calculated as a Percentage.
Test Coverage percentage =
For example, if the project has 100 total number of testcases and 25 cases have been executed then the
Test Coverage =
= 25% coverage.