MC/DC coverage calculator: the truth table, independence pairs and minimum test set of a C decision

MC/DC asks that every condition in a decision be shown to change the outcome on its own. For N conditions that takes at least N + 1 tests with the unique-cause rule, and sometimes fewer with masking. Type a C decision such as (speed > 30) && (brake || gap < min_gap). You get its truth table, with the conditions C's short-circuit && and || never evaluate, every independence pair and the smallest test set. Free, runs in your browser.

The second tab checks your own test vectors, as in Project 2 of Skill-Lync's software verification and validation course, which asks for 100% statement, branch/decision and MC/DC coverage with LDRA. The third lists what DO-178C, ISO 26262 and IEC 61508 ask for.

NASA/TM-2001-210876 MC/DC tutorial · DOT/FAA/AR-01/18 · CAST-6 · GCC 14 and Clang manuals · checked against a separate solution (5,551 checks at build) · Updated 23 Nov 2026

Up to 8 conditions (256 rows). Each relational test, bare variable, call or struct member between &&, || and ! is one condition. The same text twice is a coupled condition. Lower-case t/f in the table marks a value C never reads in that row.

Unique-cause4minimum: tests 2, 5, 6, 7
Masking4minimum: tests 2, 5, 6, 7
Short-circuit4minimum: paths 1, 2, 3, 4
  • A speed > 30
  • B brake
  • C gap < min_gap
TestABCOutcomePairs APairs BPairs CMin set
1FffF
2FftF6◆● in set
3FtfF7
4FttF8
5TFFF7◆6◆● in set
6TFTT2◆5◆● in set
7TTfT35◆● in set
8TTtT4

Rows are numbered as in the NASA tutorial: the first condition is the most significant, F before T. ◆ marks the pair the minimum set uses; ● the tests in it.

  • A speed > 30: 3 pairs, (2, 6) (3, 7) (4, 8); the minimum set uses tests 2 and 6.
  • B brake: 1 pair, (5, 7); the minimum set uses tests 5 and 7.
  • C gap < min_gap: 1 pair, (5, 6); the minimum set uses tests 5 and 6.
CoverageMinimum testsWhat it asks
Statement (C0), if with else2both branches run once: one true and one false outcome
Statement (C0), if without else1one test with a true outcome runs every statement
Decision (C1, branch)2the decision takes true and false
Condition2every condition takes true and false; the outcome may not change
Condition/decision2both of the above
MC/DC, unique-cause4each condition changes the outcome with all others fixed; at least N + 1 = 4
MC/DC, masking4others may change if they cannot affect the outcome; at least ⌈2√3⌉ = 4
MC/DC, short-circuit4unique-cause where conditions C does not evaluate are don't-care
Multiple condition8every combination of the 3 inputs: 2^3
Short-circuit evaluation paths4distinct ways C actually runs the decision

What is MC/DC coverage?

Modified condition/decision coverage is the structural coverage DO-178 asks of the most critical airborne software. The NASA tutorial quotes its DO-178B glossary definition: every point of entry and exit has been invoked, every condition and every decision has taken all possible outcomes, and "each condition in a decision has been shown to independently affect that decision's outcome".

A condition is a Boolean expression with no Boolean operator in it, such as speed > 30 or brake. A decision is conditions joined by &&, || and !. "If a condition appears more than once in a decision, each occurrence is a distinct condition". That is why (A && B) || (!A && C) has four conditions, not three.

How many test cases does MC/DC need?

At least N + 1 for N conditions under unique-cause, and possibly fewer under masking. Chilenski's FAA report (DOT/FAA/AR-01/18, Theorems 1 and 3) proves both floors:

The 2N ceiling holds because one pair per condition is always enough. In practice N + 1 is the usual answer: in Chilenski's study of airborne code, only 85 of 20,030 masking test sets went below N + 1, and none below ⌈2√N⌉. They can differ, though. For (A && B) || (C && D), unique-cause needs 5 tests and masking 4 (rows 4, 6, 11, 13: FFTT, FTFT, TFTF, TTFF). The NASA tutorial's own decision, (A || B) && (C || D), also needs only 4 under masking: tests 2, 5, 7, 10, all pairs from its Appendix C Table 2. Under unique-cause the calculator finds tests 2, 5, 6, 7, 10, the same set as the tutorial's Figure 1.

A decision with one condition, like LDRA's Ggrocers.c if (customer.cash >= fruit_prices[name]), needs 2 tests: MC/DC adds nothing to decision coverage there. Clang's coverage documentation says the same: one-condition expressions "are not included in MC/DC analysis".

Unique-cause vs masking MC/DC: what is the difference?

Unique-cause holds every other condition fixed; masking lets them change if they cannot affect the outcome. The CAST-6 position paper, printed in the NASA tutorial's Appendix C, defines both. For unique-cause, the condition is varied "while holding fixed all other possible conditions". For masking, "principles of Boolean logic" show that "no other condition influences the outcome (even though more than one condition in the decision may change value)".

Chilenski writes masking out exactly with the Boolean difference, which is true when flipping ci alone flips F:

Tests x and y are a masking pair for ci when

The calculator finds masking pairs another way, as the NASA tutorial does in section 3.2.3: at each gate on the path from the condition to the output, every other input must be non-controlling (true at an and, false at an or). Skill-Lync's verifier uses the Boolean difference, and both give the same pairs, including all 16 rows of the tutorial's Table 2. Every unique-cause pair is also a masking pair, and the two are the same for a decision with a single kind of operator, such as A && B && C.

Masking is the only one of the two that works for coupled conditions: in (A && B) || (!A && C), flipping A flips both appearances, so neither can change alone. The NASA tutorial's Example 2 (Tables 17 to 20) is the classic case: its five tests give MC/DC under masking, because D is shown by FTFT and TFFF, which also change A and B. Change test 2 to TFFT (Example 2A) and they meet unique-cause too. That example is the default in the second tab.

How does C's short-circuit evaluation change MC/DC?

In C, && skips its right side when the left is false, and || skips it when the left is true. The NASA tutorial (section 3.6) compares them to Ada's and then and or else and treats a value that is never evaluated as "don't care". For A && B && C && D its Table 32 needs only TTTT, Fxxx, TFxx, TTFx and TTTF. Those are the 5 ways C can run that decision, against 16 rows in the truth table.

The short-circuit column applies that rule: a pair needs the condition evaluated in both tests, a change in the outcome, and no change in any other condition evaluated in both. Clang's documentation describes its MC/DC the same way, with other conditions "held fixed (or they are masked out as unevaluatable...)". The tutorial adds a warning: relying on short-circuit tests is valid "only if the compiler works correctly, even when optimizing". In the truth table, lower-case t and f mark the values C never reads.

& and | are bitwise operators: C always evaluates both sides. Left as they are, (a > 1) & (b < 2) is one condition, an integer expression. Tick the box to read them as two conditions joined with no short-circuit.

Statement vs branch vs MC/DC coverage: how many tests each?

Each level adds a demand. These definitions are from the NASA tutorial, section 2.3:

  • Statement (C0): every statement runs once. An if without an else needs one test with a true outcome. The tutorial quotes Myers: the criterion is "so weak that it is generally considered useless".
  • Decision (C1, branch): the decision is true once and false once, 2 tests. For A || B, TF and FF do it without ever testing B.
  • Condition: each condition is true once and false once, also 2 tests. TF and FT for A || B meet it, yet the outcome never changes.
  • Condition/decision: both of the above. TT and FF for A || B meet it, yet they cannot tell A || B from A && B.
  • MC/DC: each condition shown to flip the outcome on its own, N + 1 tests in general. TF, FT and FF for A || B.
  • Multiple condition: all 2N combinations, impractical for large N.

The table under the calculator gives each count for your decision. LDRA's report headings in Project 2, "Statement", "Branch/Decision" and "MC/DC", match the first, second and fifth rows. LDRA treats decision and branch coverage as the same thing.

Which coverage do DO-178C and ISO 26262 require?

DO-178C Table A-7 asks for MC/DC only at Level A. Decision coverage applies at Levels A and B, and statement coverage at A, B and C. Rapita and Qt quote these levels, and the FAA's AR-06/54 gives the same ones for DO-178B. Independence applies to all three at Level A and to decision and statement at Level B.

ISO 26262-6:2018 is softer. Parasoft's summary of Table 9 marks MC/DC highly recommended (++) only at ASIL D, and recommended (+) at A to C. Branch coverage is ++ from ASIL B and statement coverage ++ at A and B. Table 12 adds function and call coverage at the architectural level, ++ at ASIL C and D. Rapita gives the same marks. IEC 61508-3 Table B.2 highly recommends MC/DC only at SIL 4. The third tab has the three tables.

What do gcov, Clang and LDRA report as MC/DC?

  • GCC 14 and gcov. -fcondition-coverage records "what terms in a conditional contributes to a decision". gcov --conditions reports whether each condition "at least once had an independent effect on the outcome of the boolean expression (modified condition/decision coverage)". Its JSON output lists the terms "not seen as true" and "not seen as false". The GCC patch that added it describes masking MC/DC.
  • gcovr passes --conditions to gcov from GCC 14 and reads condition data from gcovr 8.0.
  • Clang uses -fcoverage-mcdc, with -show-mcdc-summary in the report. The LLVM 18 documentation limits it to six conditions per expression; the current documentation gives 32,767 terms. It leaves one-condition expressions to branch coverage.
  • LDRA TBrun (the tool the course uses) shows a truth table of the pairs usable for each condition and which combinations form a complete minimal test set. LDRA's page states "a minimum of (n+1) tests" for n conditions, and its blog mentions an MC/DC planner. Its public pages do not say which form, unique-cause or masking, it applies.

What do 726 V&V project reports say about MC/DC?

Skill-Lync read the text of every public report of the hand-code V&V course on 23 Nov 2026: 414 for Project 1 and 311 for Project 2. Text in screenshots is not counted (233 reports have them, 304 have under 300 characters of text), so each count is a floor.

  • Project 1 is black-box testing. 311 reports write a test plan and 268 say "black box", for the mobile phone requirements in the brief.
  • Project 2 runs LDRA. 173 name Testrain.c (the static code review), 38 Ggrocers.c (the unit test file) and 41 the Cashregister integration test. 98 name TBrun, 67 the Test Manager report and 41 MISRA C:2012.
  • MC/DC is nearly absent from the text. 12 reports mention it, 10 of them only to quote the brief's "100% statement, Branch/Decision and MC/DC coverage" (example). None of the 726 writes out an independence pair, or the words unique-cause or masking. The coverage itself sits in LDRA's HTML reports and screenshots.

What this calculator does not cover

  • Conditions coupled through a shared variable. Only the same text twice is caught. x == 0 and x != 0 always change together; Chilenski calls that strongly coupled. state == RAISING and state == LOWERING sometimes do (weakly coupled). The calculator treats them as free, so some of its rows may be impossible in your code.
  • A decision split across statements. The NASA tutorial shows that MC/DC of A = B || C; E = A && D; taken one statement at a time is not MC/DC of E = (B || C) && D.
  • XOR and comparisons between Boolean results. a ^ b or (x > 0) == (y > 0) stay one condition each. Chilenski's report proposes extensions for these; they are not part of MC/DC as defined.
  • Object code. DO-178B asks for extra verification of the object code at Level A when the compiler generates code that does not trace to the source.
  • Very large searches. For 7 or 8 conditions the masking search can stop after a time limit and show "best found" rather than "minimum".
Learn software verification

Picking the N + 1 tests is the easy part. Writing them from requirements, getting LDRA to 100% statement, branch and MC/DC, and explaining a masked pair in an interview is what verification teams at Tier-1 suppliers look for. Both are in Skill-Lync's V&V course.

Frequently asked questions

How many test cases are needed for MC/DC?

For N conditions that each appear once, unique-cause MC/DC needs at least N + 1 tests and never more than 2N. Masking can need fewer: at least ⌈2√N⌉, by Chilenski's FAA report. (A && B) || (C && D) needs 5 tests unique-cause and only 4 with masking. Testing every combination would take 2^N.

What is the difference between unique-cause and masking MC/DC?

Unique-cause shows a condition's effect by flipping only that condition, holding every other one fixed. Masking also lets other conditions change, as long as the logic proves they cannot affect the outcome, such as anything ANDed with a false. Every unique-cause pair is also a masking pair, so masking is easier to reach.

Is MC/DC required by ISO 26262?

Only highly recommended (++) at ASIL D, as ISO 26262-6:2018 Table 9 is quoted by Parasoft and Rapita. At ASIL A, B and C, MC/DC is recommended (+). Branch coverage is highly recommended from ASIL B upwards, statement coverage at ASIL A and B. DO-178C makes MC/DC an objective for Level A software.

What is the difference between condition coverage and MC/DC?

Condition coverage only asks every condition to be true once and false once, which two tests can do without the decision ever changing. MC/DC also needs both outcomes and, for every condition, two tests where that condition alone flips the outcome. For A || B, TT and FF give condition and decision coverage but not MC/DC.

Does gcov support MC/DC?

Yes, from GCC 14. Compile with -fcondition-coverage and run gcov --conditions; the GCC manual says it shows whether each condition had an independent effect on the outcome, which it calls modified condition/decision coverage. Clang has its own -fcoverage-mcdc. gcovr reads the GCC data from version 8.0 onwards.

How do you write MC/DC test cases for A && B || C?

C reads it as (A && B) || C. Unique-cause needs 4 tests, for example (A, B, C) = FTF, FTT, TFF, TTF. FTF and TTF show A, TFF and TTF show B, and FTF and FTT show C. Each pair changes one condition and the outcome. Type the decision in the calculator to see every pair.

Related on Skill-Lync

Sources

  • Hayhurst, Veerhusen, Chilenski, Rierson, A Practical Tutorial on Modified Condition/Decision Coverage, NASA/TM-2001-210876 (May 2001): 2.3 coverage measures (p. 8-9), DO-178B glossary definitions and Table 3 (p. 12-14), masking 3.2.3 (p. 27-28), Examples 2 and 2A (p. 29-31), short-circuit logic 3.6 and Tables 29-33 (p. 42-45), Appendix C, the CAST position paper "Rationale for Accepting Masking MC/DC in Certification Projects", Tables 1 and 2 (p. 72-77).
  • J. J. Chilenski, An Investigation of Three Forms of the Modified Condition Decision Coverage (MCDC) Criterion, DOT/FAA/AR-01/18 (April 2001): masking defined by the Boolean difference (3.1.1, p. 13-14), Theorems 1 to 4 (p. 30-32), results (6.1.1, p. 40).
  • DO-178C Table A-7 as quoted by Rapita Systems and Qt (Coco documentation); FAA DOT/FAA/AR-06/54 for DO-178B. ISO 26262-6:2018 Tables 9 and 12 as quoted by Parasoft (Achieving Functional Safety in Automotive, p. 8) and Rapita. IEC 61508-3:2010 Table B.2 as quoted by Parasoft (Satisfying SIL requirements) and Qt.
  • GCC 14.1 manual: Instrumentation Options (-fcondition-coverage) and Invoking Gcov (--conditions, JSON format); GCC patch "Add condition coverage (MC/DC)" (Dec 2023); gcovr changelog. Clang Source-based Code Coverage (LLVM 18 and current). LDRA: MC/DC capability page and "DO-178C structural coverage analysis" (2025).
  • LDRA's Ggrocers.c example as pasted in the course reports (buy_fruit, how_many_favourite_fruit). Skill-Lync's landing gear state machine tool (src/lib/landing-gear.ts) for the two landing gear decisions; the ACC decision is illustrative.
  • Skill-Lync, all 726 public V&V course reports, read 23 Nov 2026. scripts/verify/mcdc.py re-derives everything another way (its own C parser, Python's short-circuit evaluation, masking by the Boolean difference, brute-force minimum sets, the NASA tables typed in), 338 cases; the page checks itself against it at build time (5,551 checks).
Free counselling

From an MC/DC table to a verification job.

Knowing why a masked pair counts, or why 100% decision coverage is not MC/DC, is the kind of answer verification teams look for. A Skill-Lync counsellor can map the V&V or embedded systems course that fits the role you want.

Talk to a course counsellor

Free. We call you back, usually the same day.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.