It may be defined as a metric tool, use to measure the coverage of the programming code, in terms of line of code, under the test. It is a type of white-box testing, used to measure the quantity of code covered, during the execution of a program or code.
The chief purpose, behind code coverage, is to ensure that no line of code or area of the program, left unvisited or untouched for the testing purpose. Through code coverage, we may be able to get the answers to the following questions:
There are various parameters & criteria, to measure the code coverage. Below given are some of the important types:
Whether, each and every function which is declared and defined, has been called or not during the execution of the program.
The simplest form of the code coverage to check that whether, each and every statement not the lines has been brought under the execution during the running of the software program. Here, we have specifically said the statements not the lines, as a statement may be dispersed or covered in multiple lines or the line may contain more than one statement.
Here, it is checked that if a node is able to traverse or jump to its all possible branches during the execution of the code.
All the elements of a particular condition, i.e. boolean expression have been used and if the given expression is able to produce result in 'Yes' and 'No' form during the execution of the code .
Sometimes, condition coverage may also be seen as the decision coverage, which is the combination of function and branch coverage and used to check that every possible entry and exit points in the programming code has been called upon or not, at least once, and if all the possible outcomes of every decision has been invoked or not during the execution.
Apart from the above mentioned important criteria, following types may also be approach for measuring the code coverage
Below given are some of the tools to measure the code coverage under the test.