Code Coverage Metrics
In this tutorial, we will learn different types of Code Coverage Metrics. Code Coverage Testing is a Whitebox Testing technique that measures the extent of code exercised or executed during the test. We need to execute the code to get the code coverage analysis. So, it is a dynamic testing technique.
Types of Code Coverage Metrics
There are different types of coverage metrics. Some of them are listed below:
- Line Coverage
- Branch Coverage
- Condition Coverage
- Loop Coverage
- Path Coverage
- Function Coverage
This metric is also called as Statement Coverage. This metric indicates the percentage of the program code statements exercised by the tests. Line coverage checks whether all the statements are exercised during the test.
This metric is also called as Decision Coverage. This metric indicates the percentage of the branches in the software program covered by the tests. Branch coverage checks whether all the branches are covered during the test.
For example, if there are two branches in the program and only one is executed by the test. Then the branch coverage is 50%.
This metric is also called as Predicate Coverage. Percentage of the conditions that were executed by the tests.
This metric indicates the percentage of loops in the software program that were executed by the tests.
A path is an execution flow in the software program from start to end. This metric indicates the percentage of paths covered by the tests.
This metric is also called as Method Coverage. This metric indicates the percentage of the functions executed by the tests.
Software Testing Tutorials: