Site icon TestingDocs.com

Code Coverage Metrics

Overview

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

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.

https://www.testingdocs.com/statement-coverage/

Branch Coverage

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%.

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/

Exit mobile version