QA Fundamentals · Middle · Question 10 of 75
Why is branch coverage stronger than statement coverage?
if (isVip) price = price * 0.9;
return price;- 1It also measures how long each statement takes
- 2It counts each line twice, so the number is higher
- 3It requires both the true and the false outcome to run
Show the answer
Correct answer: It requires both the true and the false outcome to run
Explanation
One test with isVip = true runs every line here (100% statements) but never tests the path where the discount is skipped. Branch coverage needs both.