Branch coverage
The percentage of decision outcomes (branches) exercised by a test suite; 100% branch coverage implies 100% statement coverage.
Syllabus chapters: 4
Sources: ISTQB® Certified Tester Foundation Level syllabus 4.0.1 and the official ISTQB® Glossary. Glossary content © International Software Testing Qualifications Board; source: glossary.istqb.org.
Related terms
Branch coverage in a practice question
Question 1
A team's test suite exercises both outcomes of every if-then decision in a module as well as every unconditional transfer of control. What can the team conclude about the module's coverage?
- 100% statement coverage is reached, but branch coverage may still be below 100%
- 100% branch coverage is reached, and therefore 100% statement coverage as well
- 100% branch coverage is reached, but statement coverage may still be below 100%
- Both figures are necessarily equal, since every branch contains exactly one statement
Show answer
- 100% statement coverage is reached, but branch coverage may still be below 100%This reverses the subsumption: full statement coverage does not imply full branch coverage.
- Correct answer: 100% branch coverage is reached, and therefore 100% statement coverage as wellAll branches are exercised here, and full branch coverage also gives full statement coverage.
- 100% branch coverage is reached, but statement coverage may still be below 100%Full branch coverage cannot leave statements unexercised, because it subsumes statement coverage.
- Both figures are necessarily equal, since every branch contains exactly one statementBranches and statements are different coverage items, and the syllabus states no such equality.
When 100% branch coverage is achieved, all branches in the code, unconditional and conditional, are exercised by test cases; conditional branches typically correspond to the true or false outcome of an if-then decision. Branch coverage subsumes statement coverage: any set of test cases achieving 100% branch coverage also achieves 100% statement coverage, but not vice versa.
Syllabus section 4.3.2
Question 2
A team's test suite achieves 100% branch coverage of a module. A colleague asks whether statement coverage still has to be measured separately. What follows?
- Yes, because the two measures count unrelated coverage items and neither implies the other
- Yes, because 100% branch coverage can still leave some executable statements unexercised
- No, because statement coverage subsumes branch coverage and so has been reached as well
- No, because branch coverage subsumes statement coverage, so 100% statement coverage follows
Show answer
- Yes, because the two measures count unrelated coverage items and neither implies the otherThe syllabus states explicitly that one of the two subsumes the other.
- Yes, because 100% branch coverage can still leave some executable statements unexercisedFull branch coverage exercises every branch, and so every executable statement.
- No, because statement coverage subsumes branch coverage and so has been reached as wellThis reverses the subsumption: statement coverage does not imply branch coverage.
- Correct answer: No, because branch coverage subsumes statement coverage, so 100% statement coverage followsBranch coverage subsumes statement coverage, so it follows automatically.
Branch coverage subsumes statement coverage. Any set of test cases achieving 100% branch coverage also achieves 100% statement coverage, but not the other way round. Measuring statement coverage separately therefore adds nothing once full branch coverage has been demonstrated.
Syllabus section 4.3.2
Original PrepBench practice material, not official exam questions or exam dumps. PrepBench is independent and is not affiliated with or endorsed by ISTQB®.