Code Coverage is a measure used in software testing to describe the degree to which the source code of a program has been tested. It is a form of testing that inspects the code directly and checks the active and non-active parts of the source-code.
Basically there are number of code coverage criteria, the main ones being:
- Function coverage Has each function in the program been executed?
- Statement coverage Has each line of the source code been executed?
- Decision coverage (also known as Branch coverage) Has each control structure (such as an if statement) evaluated both to true
- Condition coverage Has each boolean sub-expression evaluated both to true and false (this does
- Modified Condition/Decision Coverage (MC/DC) Has every condition in a decision taken on all possible outcomes at least
- Path coverage Has every possible route through a given part of the code been executed?
- Entry/exit coverage Has every possible call and return of the function been executed?
and false?
not necessarily imply decision coverage)?
once? Has each condition been shown to affect that decision outcome
independently?