badge icon

This article was automatically translated from the original Turkish version.

Article

Modified Condition/Decision Coverage (MC/DC)

Quote

Modified Condition/Decision Coverage (MC/DC) is an advanced testing criterion that verifies whether each individual condition in complex logical decisions actually influences the overall outcome of the system. It is particularly used in critical systems such as aviation and automotive industries to demonstrate that software is free from logical faults.


In software, decisions are typically expressed using constructs like "if A and B are true, perform X" (if, while). The essence of MC/DC is to prove that each condition within a decision—for example, condition A alone—can independently change the decision outcome (whether X is performed or not), while all other conditions are held constant.

Difference Between Decision and Condition

  • Condition: The smallest unit that does not contain a logical operator (e.g., A > 5).
  • Decision: A combination of multiple conditions connected by logical operators (AND, OR) (e.g., (A > 5) AND (B < 10)).

Purpose

While conventional testing only answers the question “did the code execute?”, MC/DC goes deeper:

  • Independent Influence: It proves that each condition (A, B, C...) can independently flip the decision outcome from “true” to “false”.
  • Hidden Errors: It uncovers code segments that are never executed or logically redundant (dead code).
  • Efficiency: It reduces the number of tests by focusing only on the most critical combinations, instead of testing all possible scenarios—which could require thousands of tests.

Applying the Analysis to Code

In applying MC/DC, at least one pair of test cases is defined for each condition. In these pairs, all other conditions are held constant while only the condition under examination is varied, demonstrating that this variation changes the decision outcome. The general process involves identifying decision expressions with multiple conditions, decomposing the conditions within each decision, creating test pairs that demonstrate independent influence for each condition, and executing the tests to analyze coverage.

Number of Tests

If a decision expression contains n conditions, testing all possible combinations would require 2n tests (e.g., 8 tests for 3 conditions). However, MC/DC intelligently reduces this number to a linear scale, typically just n + 1 test cases, thereby reducing testing cost without compromising safety.

Test Count Table

Tool Support

In structural coverage analysis, instrumentation is added to the source code to collect coverage data during test execution. This enables measurement of coverage at the statement, decision, and MC/DC levels. Some software tools can report uncovered conditions and decisions after test runs.

Software Example

The following example demonstrates how MC/DC is achieved for a decision expression with three conditions:

Code Example (Hüsnü Umut Okur)

This decision expression contains three distinct conditions: A, B, and C. The decision outcome depends on their logical combination. Under MC/DC, it must be shown that each condition can independently affect the decision outcome while all other conditions are held constant. To achieve this, the following test cases can be used:

Test Decision Table

Using this test set:

  • Condition A changes the decision outcome when other conditions are held constant.
  • Condition B changes the decision outcome when other conditions are held constant.
  • Condition C changes the decision outcome when other conditions are held constant.

Therefore, the given test cases achieve 100% MC/DC coverage for this decision expression.

Author Information

Avatar
AuthorHüsnü Umut OkurMarch 23, 2026 at 11:43 AM

Tags

Discussions

No Discussion Added Yet

Start discussion for "Modified Condition/Decision Coverage (MC/DC)" article

View Discussions

Contents

  • Difference Between Decision and Condition

  • Purpose

  • Applying the Analysis to Code

  • Number of Tests

  • Tool Support

  • Software Example

Ask to Küre