Code Coverage Metrics
Overview
In this tutorial, we will learn different types of Code Coverage Metrics. Code Coverage Testing is a white box testing technique that measures the extent of code exercised or executed during the test. Since we need to execute the code to get the code coverage analysis, 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
Line Coverage
This metric is also called Statement Coverage. It indicates the percentage of program code statements exercised by the tests. Line coverage checks whether all the statements are exercised during the test.
https://www.testingdocs.com/statement-coverage/
Branch Coverage
This metric is also called Decision Coverage. It indicates the percentage of the software program’s branches covered by the tests. Branch coverage checks whether all the branches are covered during the test.
For example, if the program has two branches and only one is executed by the test, then the branch coverage is 50%.
https://www.testingdocs.com/branch-coverage/
Condition Coverage
This metric is also called as Predicate Coverage. Percentage of the conditions that were executed by the tests.
Loop Coverage
This metric indicates the percentage of loops in the software program that were executed by the tests.
Path Coverage
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.
Function Coverage
This metric is also called as Method Coverage. This metric indicates the percentage of the functions executed by the tests.
https://www.testingdocs.com/method-or-function-coverage/
—
Software Testing Tutorials:
https://www.testingdocs.com/software-testing-tutorials/