Description of the method
9.2.1. Description of the Method
The branch coverage criterion (also called edge coverage) requires that tests cover all possible control flows between basic blocks. In the terminology of the Control Flow Graph (CFG), this simply means covering all the edges of the graph. In the definition of branch coverage, we will additionally require the instruction coverage criterion to be met. This will guarantee subsumption between these criteria. If we did not add this requirement, for a program composed of a single basic block (e.g., a single instruction), its control flow graph would have no edges, and thus the branch coverage criterion could be satisfied by an empty set of tests, which would obviously not cover any instructions. If there is at least one edge in the CFG, branch coverage obviously implies vertex (instruction) coverage.
Branch – a control flow between two blocks (instructons).
Task 2
The Textbook, section 9.2.1, from the frame [branch testing] up to the frame [branch coverage]
Task 3
Table 9.3
Test conditions | Control Flow Graph Edges |
Covering elements | Control Flow Graph Edges |
Coverage criterion | For each edge of the CFG there is a test that, when executed, causes control to pass through that edge. |
coverage |