Decision coverage in software testing: meaning and examples
Decision coverage is reached when every decision in the code, every Boolean expression that steers control, has evaluated to both TRUE and FALSE during the tests. It is also called branch coverage.
A decision is the whole condition of an if, a while or a guard, however many sub-conditions it contains. Decision coverage asks only about the whole: two test cases, one that makes the decision true and one that makes it false, cover it completely, even if some of its conditions never changed value. It is stronger than statement coverage, which can pass without ever taking the false branch, and weaker than condition coverage and MC/DC, which look inside the expression. Testing standards order the criteria in that sequence.
The artefact on this page is the alarm rule armed AND (door OR window), true on rows 5, 6 and 7. Decision coverage needs a true row and a false row; the satisfiable witness armed = TRUE, door = FALSE, window = TRUE and the tautology counterexample armed = FALSE, door = FALSE, window = FALSE supply them. The engine's independence pairs go further: the pair for armed is armed = FALSE, door = FALSE, window = TRUE against armed = TRUE, door = FALSE, window = TRUE, alarm FALSE then TRUE, with similar pairs for door and window.
Decision coverage is the usual floor in industry coverage targets and the first criterion a coverage tool reports. Its blind spot is the inside of a compound condition: the two cases above leave door at FALSE throughout, so a bug in how door is combined would not be seen. That is why safety standards for critical software require MC/DC instead. The term is confused with condition coverage and with path coverage, which counts combinations of decisions along a run.
Example
alarm := armed AND (door OR window) · output
Exact checks
Truth table (8 rows)
| # | armed | door | window | alarm |
|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE |
| 1 | FALSE | FALSE | TRUE | FALSE |
| 2 | FALSE | TRUE | FALSE | FALSE |
| 3 | FALSE | TRUE | TRUE | FALSE |
| 4 | TRUE | FALSE | FALSE | FALSE |
| 5 | TRUE | FALSE | TRUE | TRUE |
| 6 | TRUE | TRUE | FALSE | TRUE |
| 7 | TRUE | TRUE | TRUE | TRUE |
Plain-language reading
Beginneralarm is true exactly when both of the following hold:
1. armed is true
2. at least one of door or window is true (both may be true)
In every other case, alarm is false.
About the operators:
- AND is true only when all of its parts are true.
- OR is inclusive: it is true when at least one part is true, including when several are.
Intermediatealarm is true exactly when both of the following hold:
1. armed is true
2. at least one of door or window is true (both may be true)
In every other case, alarm is false.
Advancedalarm is true exactly when both of the following hold [conjunction ∧]:
1. armed is true
2. at least one of door or window is true (both may be true) [inclusive disjunction ∨]
In every other case, alarm is false.
Formal notation: armed ∧ (door ∨ window)
MC/DC
| Input | Status | Independence pair (only that input changes) |
|---|---|---|
| armed | found | armed=F, door=F, window=T → F | armed=T, door=F, window=T → T |
| door | found | armed=T, door=F, window=F → F | armed=T, door=T, window=F → T |
| window | found | armed=T, door=F, window=F → F | armed=T, door=F, window=T → T |
The common slip
Reporting 100% decision coverage as if the conditions were tested. The two cases that cover this decision never vary door; decision coverage says nothing about any single condition. The pitfall page on coverage versus correctness has the general version of this warning.
Questions
How many tests does decision coverage need?
At least two per decision, one for each outcome, regardless of how many conditions the decision contains. MC/DC on the same rule needs at least one more than the number of conditions, which for this three-condition alarm is four.
Related
See also
- Condition coverage vs decision (branch) coverage
- Condition coverage in software testing: meaning and examples
- MC/DC (modified condition/decision coverage): meaning and examples
- Coverage is not correctness: tests still need expected results
- Lesson 12: Designing tests that find bugs (advanced, 15 min)
- Alarm rule: armed AND (door OR window OR motion) AND NOT disarm_code
Glossary
Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.