Skip to content

MC/DC tests

MC/DC, Modified Condition / Decision Coverage, is the test coverage that standards such as DO-178C ask of the most critical software: each condition of a decision must be shown to affect the decision's outcome on its own. The editors generate the tests that show it.

Decision and conditions

The decision is a block with a boolean output: a gate, a comparison, an Out, an Assertion or a Target block. Select it and tick MC/DC decision in its properties; it is marked MC/DC on the canvas.

Its conditions are found by walking back from the decision through the logic operators (and, or, not, xor, xnor, implies, switch), into subsystems, down to the first blocks that are none of them: inputs, unit delays, comparisons, library blocks. Constants are not conditions; a block reached twice is one condition. The properties panel lists the conditions, and outlines them on the canvas. Any operator on the way can be made a condition itself, which stops the walk there.

The tests

MC/DC tests, in the toolbar, searches, for each condition, a pair of tests that differ in that condition and in the outcome, and in each of which the condition alone decides the outcome (masking MC/DC). A test is a run of one or more steps, whose last step is the one that counts.

The MC/DC tab of the panel shows, per decision, a table:

  • a row per test: the values of the inputs the decision reads, of each condition (its expression under its name, such as speed > 5), and of the decision;
  • below it, each condition's pair (a click marks its two rows), or why it has none: unreachable, when the condition never decides the outcome alone (it is masked, or the logic is redundant), or not found within the longest test and the timeout, both set in the tab and saved with the circuit.

A click on a test's row plays it on the canvas and in the scope; Use as stimuli, in the row's right-click menu, copies its inputs. The tab's ⋯ menu exports the table and the tests' inputs, step by step, as CSV. The tests are not a minimal set: two conditions share a test only when they happen to.

An assumption (an Assume block) holds in every test.

Requirements

The circuit of a requirement has its decision already: the Out block of its formula. Generate MC/DC, in the requirements table, generates the tests of the selected requirements, or of all those without tests up to date; the table and the side bar show, per requirement, the conditions covered of all. The tests are kept next to each circuit (name.mcdc.json), and are out of date when the circuit changes.

A requirement whose formula looks ahead with next(x, N) has a circuit late by N steps: its decision counts from step N.