Skip to content
Latchkey

Branch Coverage - CI/CD Glossary Definition

Branch coverage measures the percentage of decision branches (each side of every if, switch, and ternary) that the tests exercise, a stricter metric than line coverage.

Why it is stricter

A line like if (a && b) doX(); can hit 100% line coverage with one test, yet never exercise the case where a is true but b is false. Branch coverage forces both outcomes of each condition.

In CI

Coverage tools report branches separately; setting a branch threshold catches untested error paths that line coverage hides.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →