COVERAGELAB
MC/DC Generator
MC/DC Test Suite Generator
Windows · coveragelab.kr
CoverageLab

MC/DC Test Suite Generator

User manual · Windows

1. Introduction

MC/DC (Modified Condition / Decision Coverage) requires, for every condition in a decision, a pair of test cases that shows the condition alone changes the outcome of the decision. This program generates a test suite from a condition you type or from the decisions found in a source file, using the Robin's Rule algorithm.

2. Quick start

  1. Type a condition into the Condition box, e.g. !(a && b) || c.
    (Enter only the expression - without if and without the surrounding statement.)
  2. Press Enter or click Start.
  3. The Analysis complete screen shows the counts and the MC/DC Check; the table on the right lists the cases.
  4. For a source file, open it with Open code or drop it on the window, then press Start. A file with a single decision is analysed right away; with several, double‑click the Line you want in the decision list or press Analyse each / Combined (section 3).
Type a condition

The operator buttons (&& || ! ( ) = < >) add the operator to the condition; ⌫ deletes one character and the bin clears the whole condition (Ctrl+L clears the input and the result).

Supported: &&, ||, !, parentheses and the comparisons < <= > >= == !=. Not supported: XOR and other operators. Everything that is not a logical operator - a Boolean variable, a function call, a member access, an array element, an arithmetic or bit expression - is treated as one condition. Two conditions with the same text count as the same condition (Duplicate).

3 conditions → 4 test cases, verified PASS

MC/DC criterion - Unique‑Cause / Masking

The MC/DC criterion toggle above the Start button selects the generation criterion (the choice is remembered in the settings). For a source file too, choose it here before pressing Start. Results and saved files always say which criterion was used - the ※ Criterion : … line at the top of the log and the txt, and the # Criterion : … comment on the first line of the csv.

With Masking the check line reads MC/DC Check : PASS (masking n/n · unique‑cause k), coupled conditions are reported as "Note : coupled condition(s)", and the analysis log and saved files start with ※ Criterion : Masking MC/DC. Section 4 ("MC/DC criterion") has the details.

3. Source files

Choose File ▸ Open code… (Ctrl+O), click Open code, or simply drop a file onto the window. C, C++, Java, JavaScript and Python files are recognised by their extension; comments, string literals and preprocessor lines are ignored. When #if … #else appears inside a condition, only the first branch is read; in JavaScript written without semicolons, a line end is taken as the end of the statement. Code switched off with #if 0 is not read. A file can be dropped anywhere on the window - on the condition field or the analysis log as well.

Or open C, C++, Java, JavaScript or Python source
ActionResult
Double‑click a decision (or select it and press Enter)Only that decision is analysed. A single click just selects it.
Analyse eachEvery decision is analysed on its own - a Test Suite table and an Input Data table are generated for each decision.
CombinedAll decisions are analysed and merged into one table (see section 5).
Every decision in the file is found

While the analysis runs, a Cancel button appears next to the Start button. It stops the analysis and leaves the previous result on screen.

After loading the code, double‑click the Line you want in the list and that decision is analysed right away. A single click only selects it; pressing Enter after selecting does the same.

Long conditions are shortened in the list; hover the mouse to see the complete text.

Assignments, constants and values fixed above

A source file is analysed exactly as written. For a condition that is not a comparison, the input values are made for what actually decides true / false, and the app tells you in the Needs attention box of the Analysis complete screen, in the decision rows and in the analysis log.

ConditionHow it is handled
Constant condition
while (1)
do { … } while (0)
if (true)
The result never changes, so the case with the opposite result is marked infeasible with a warning.
Constant assignment
if (a = 3)
if (a = 0)
An assignment, not a comparison: always T (3) / F (0). The opposite case is marked infeasible with a warning. Inner decisions take a = 3 on their path, and a decision inside the branch that cannot run (else) becomes unreachable.
Value assignment
if (a = b)
The actual condition is b (true when not 0), so the input is given for b, and inner decisions take a as having b's value (the inner cases of if (a = b) { if (a > 5) … } use a = b = 6). It may be a mistyped ==, so a warning is shown. An assignment marked as intended by its own parentheses (while ((p = p->next)), if (!(fp = fopen(…)))) and Python's := get a note only.
Comparing an assigned value
(c = getchar()) != EOF
A normal idiom. The input is given for the value of getchar(), and c in inner decisions takes the same value (note).
Increment / decrement
n-- > 0
i++ < 10
The input is the value before the change (note).
Chained comparison
a < b < c
The result of the first comparison (0 / 1) is compared with the next value, so the input is left as ? with a warning. In Python, a < b < c is converted into two conditions.

Values fixed above : when a variable gets a constant earlier in the same function (b = 0; before if (a = b)), the app warns that the decision looks always the same or that an inner decision looks unreachable, and writes the path in the decision row and the analysis log.

※ Fixed values : Line 3 b = 0 → a=b = F → decision always F
※ Fixed values : Line 3 b = 0 → Line 4 if = F → this decision unreachable

The cases (tables and input values) are made as usual; please check the result yourself. C, C++, Java, JavaScript and Python files are checked, and nothing is reported when it is not certain: variables changed inside an earlier if, loop or block, variables whose address is passed (&x), references, volatile, variables changed by inner functions or lambdas, variables outside the function after a function call, statements inside #if blocks, code with switch or goto, and in Python, decisions inside try or match and functions that use exec or eval.

Guard conditions · constants in the same file · declared types

4. Reading the result

Analysis complete screen

Analyse each: 2 decisions → 8 cases, expected MC/DC coverage and the decision list

Result table

Concrete input values for every case

Decision rows and analysis log

Below the table each decision has a row with its source line, the normalised expression and the check result (unique‑cause k/N, masking, …). Analysis log opens the full text report - the same text that Save txt writes. Edit ▸ Copy analysis log (Ctrl+Shift+C) copies it to the clipboard.

Analysis log: expected MC/DC coverage, warnings that name the cause, Why FAIL

Edit ▸ Find in analysis log (Ctrl+F) or the magnifier in the title row of the result card opens the find bar. Enter goes to the next match, Shift+Enter to the previous one and Esc closes it. Long warning and note lines in the analysis log are folded to the width of the window. When a condition occurs twice and Unique‑Cause cannot be shown, the Needs attention box offers a Run again with Masking button.

For a decision that is FAIL, a Why FAIL box at the top of its details explains, for each condition whose independent effect is not shown, why: a constant condition (while (1)), a condition used more than once (Unique‑Cause), a test case of the pair that cannot run - conditions on the same variable conflict (x > 10 && x < 5), the declared type does not allow it (u < 0 for an unsigned u), a guard condition is in the wrong order, or the enclosing decisions cannot be met at the same time - or a condition that cannot change the result of the expression (b in a || (a && b)). The analysis log and the txt file carry the same text in Why FAIL : … lines.

Click FAIL to go to the decision; Why FAIL explains each condition

5. Combined analysis

The N+1 cases of every decision are placed in one table over the union of all variables, and cases whose shared variables do not conflict are merged into one. The Source column tells which decisions a merged case came from. Expected[n] is the outcome of decision n; a value marked * was computed because the row's values determine that decision's outcome although the case did not originate from it (an enclosing decision is determined by the path values alone). The merged count is not guaranteed to be N+1, but all cases of every decision are still present, so MC/DC per decision is preserved. Cases from mutually exclusive branches (an if and its else) are never merged, and a decision that is not executed by a row shows - for Expected. A - in the table is a condition or variable the row does not use (any value is fine). In saved files these cells can be filled automatically via Settings ▸ Blank cells (-) when saving (section 6).

Combined analysis: 2 decisions → 4 test cases
Analysis log of a combined analysis: merged table and the check of each decision

6. Saving

MenuContent
File ▸ Save txt… (Ctrl+S)The text report (analysis log). Open it with a monospaced font - Consolas, D2Coding, Courier New - so that the table columns line up.
File ▸ Save csv… (Ctrl+Shift+S)Input data as CSV: TC, one column per variable, Expected and Note (infeasible). UTF‑8 with BOM, so Excel opens it correctly.
Save as .txt or .csv for your test tool

While a file is being saved, a Saving… window shows the progress in percent. Cancel stops the save - the file is replaced only after everything has been written, so a file that was already there stays as it was. The window does not appear when the save finishes at once.

While a large result is saved, the Saving… window shows the progress

Settings ▸ Blank cells (-) when saving - chooses what happens in saved files to the - of combined results (conditions and variables the row does not use) and of path variable columns: Leave as is (-) (default) · Fill automatically (conditions T) · Fill automatically (conditions F). With automatic filling, each blank condition cell takes the chosen value (T or F) and Input Data gets an input that makes the condition come out that way - not just 1 / 0 but a value fitting the condition. For a > 50, a = 51 for T and a = 50 for F; for a boolean variable b, 1 / 0. Conditions already determined by existing variable values are evaluated from those values (with a = 51 present, a > 50 is T). Expected of decisions whose conditions are all known is computed too (marked *); Expected of decisions that are not reached and conditions that cannot be interpreted stay -. The on‑screen table does not change; the txt file gets a header line stating how the cells were filled. Filled values also stay inside the declared type (an unsigned variable never gets -1). A condition that cannot take the chosen value (it conflicts with another condition, or the type does not allow it) is filled with the opposite value.

7. Settings and shortcuts

Light and dark themes
ShortcutAction
EnterRun the condition (in the Condition box)
Ctrl+OOpen a source file
Ctrl+S / Ctrl+Shift+SSave txt / Save csv
Ctrl+LClear input and result
Ctrl+Shift+CCopy the analysis log
Ctrl+FFind in analysis log
Shift+WheelScroll a wide table horizontally
F1Manual
EscClose a dialog

8. Notes and limits

9. Contact

CoverageLab · astesia@me.com
Website : coveragelab.kr