Home > Blog > ISTQB Certified Tester Foundation Level > ISTQB CTFL v4.0: Mastering Branch Testing and Coverage

ISTQB CTFL v4.0: Mastering Branch Testing and Coverage

Study Guide 2026-09-02 8 min read

Branch testing derives test cases to execute branches (decision outcomes) in the source code. Branch coverage is calculated as the number of executed branches divided by the total number of branches, providing a stronger coverage metric than statement coverage.

#ISTQB #Branch Testing #Branch Coverage #White-Box Testing

What Is Branch Testing in Software Testing?

Branch testing is a white-box test technique that aims to exercise all possible decision outcomes, or branches, within a software component's control flow. A branch occurs wherever the code can take more than one path, such as in an IF-THEN-ELSE statement, a switch/case block, or a loop.

The goal of branch testing is to ensure that both the True and False paths of a decision are executed at least once. This provides a more rigorous evaluation of the software's logic compared to merely executing every statement, as it forces testers to consider how the code behaves under different conditions.

How Is Branch Coverage Calculated?

Branch coverage measures the percentage of decision outcomes that have been executed by a test suite. The formula is: (Number of executed branches / Total number of branches) x 100. This metric is a key focus in the ISTQB CTFL v4.0 syllabus.

For example, an IF statement has two branches (True and False), even if there is no explicit ELSE clause. If a test suite only tests the True condition, it has achieved 50% branch coverage for that decision. To achieve 100% branch coverage, you must provide test inputs that evaluate the condition to both True and False.

Why Is Branch Coverage Stronger Than Statement Coverage?

A fundamental rule in the ISTQB syllabus is that 100% branch coverage guarantees 100% statement coverage, but the reverse is not true. This makes branch coverage the stronger and more comprehensive metric.

Consider an IF statement without an ELSE clause. You can achieve 100% statement coverage by only making the condition True, executing the code inside the IF block. However, the False condition is completely ignored. Branch coverage forces you to test the False condition as well, potentially revealing errors that occur when the IF block is bypassed.

How Do You Design Test Cases for 100% Branch Coverage?

Designing test cases for 100% branch coverage involves analyzing the control flow graph of the code. You identify all the decision nodes and ensure that your test paths traverse every outgoing edge from those nodes.

Exam questions often present a scenario or a flowchart and ask for the minimum number of test cases needed for 100% branch coverage. A useful heuristic is to count the number of simple decisions (like IF statements) and add one. This often, but not always, gives the minimum number of paths needed. You must trace the paths to confirm they cover all branches.

What Are the Limitations of Branch Testing?

While branch testing is powerful, it has limitations. It does not test all possible combinations of conditions within a complex decision. For example, in an IF (A AND B) statement, branch coverage only requires the overall result to be True once and False once.

It does not force you to test all combinations of A and B (e.g., A=True, B=False). For that level of rigor, condition testing or multiple condition testing is required. However, for the foundational level, understanding the leap in quality from statement to branch coverage is the most critical concept.

❓ Frequently Asked Questions

Does 100% branch coverage guarantee 100% statement coverage?

Yes, achieving 100% branch coverage guarantees that 100% statement coverage has also been achieved, as all possible paths and therefore all statements have been traversed.


How many branches does an IF statement without an ELSE clause have?

An IF statement without an ELSE clause still has two branches: one for the True outcome (which executes the IF block) and one for the False outcome (which bypasses it).

More from ISTQB Certified Tester Foundation Level

🧠

Test Your Knowledge

Ready to practice Certified Tester Foundation Level? Put what you've learned to the test.

Try 10 Free Questions

⭐ 1,000 expert-curated questions available with Premium

Upgrade Premium
📖 Browse the Glossary

Join thousands of certification students

Sign Up Free