Branch Coverage
Did we exercise both sides of decisions? Better than line coverage. Path coverage is better still, but usually expensive and impractical at scale.
Branch coverage catches the case where a conditional’s true path is tested but the false path is not — a common gap that line coverage misses because the line containing the branch executes either way.
Sensor properties
| Property | Value |
|---|---|
| Oracle strength | Low — execution is not correctness |
| Independence | Low — same author writes tests |
| Scope | Function-level |
| Feedback latency | Seconds |
| Actionability | Guiding — shows which branches weren’t exercised |
| Type | Predictive |
What it cannot detect
Same limitations as line coverage — execution is not assertion. Branch coverage tells you the branch ran, not that the right thing happened when it did.