Skip to content

Branch Testing and Branch Coverage

Design test cases that encompass all branches in the code until desired coverage is attained.

Branch coverage is a metric that quantifies the proportion of tested branches to the toal branches within the code

Branch coverage inherently includes statement coverage, but the opposite isn’t true.

EXAM: Know how to calculate the number of branch and statement tests to achieve 100% coverage.

Importance of branch testing:

  • Understanding the control flow graph, representing the multitude of code paths.
  • Measuring coverage: Aspires to attain predefined coverage level by probing every branch in the code.
  • Inclusive of statement coverage

Summary:

  • White box testing allows testers to design test cases with preciison
  • Level of granularity helps identify subtle programming craft REVIEW