White-box test techniques · Question 59 of 60
The control flow graph of a function has 12 branches, 4 of them unconditional. The tests exercise all unconditional branches and 5 of the conditional ones. What is the branch coverage?
1 answer is correct. Hard Created with AI
Show answer
Answer
- D 75%
Explanation
Branch coverage counts conditional and unconditional branches: 4 + 5 = 9 of 12 branches, i.e. 75%. Counting only conditional branches wrongly gives 5 of 8 = 62.5%.