Skip to content

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

Always true (tautology)? No Counterexample: armed = F, door = F, window = F · Exhaustively checked and solver cross-checked · 1 rows
Always false (contradiction)? No Counterexample: armed = T, door = F, window = T · Exhaustively checked and solver cross-checked · 6 rows
Can be true? Yes Example assignment: armed = T, door = F, window = T · Exhaustively checked and solver cross-checked · 6 rows

Truth table (8 rows)

Decision coverage in software testing: meaning and examples
#armeddoorwindowalarm
0FALSEFALSEFALSEFALSE
1FALSEFALSETRUEFALSE
2FALSETRUEFALSEFALSE
3FALSETRUETRUEFALSE
4TRUEFALSEFALSEFALSE
5TRUEFALSETRUETRUE
6TRUETRUEFALSETRUE
7TRUETRUETRUETRUE

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

InputStatusIndependence pair (only that input changes)
armedfoundarmed=F, door=F, window=T → F  |  armed=T, door=F, window=T → T
doorfoundarmed=T, door=F, window=F → F  |  armed=T, door=T, window=F → T
windowfoundarmed=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

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.