badge icon

This article is not approved yet.

Article

Modified Condition/Decision Coverage Test (MC/DC)

Quote

Modified Condition/Decision Coverage (MC/DC) is a structural code coverage criterion that requires each logical condition in a decision statement to be shown, through testing, to independently affect the outcome of that decision.

What is it?

In software systems, decisions are typically implemented using control structures such as if, while, or for. These decisions may consist of multiple logical conditions combined using Boolean operators. MC/DC requires that each individual condition within a decision be evaluated in such a way that its independent impact on the decision result is demonstrated, while all other conditions remain unchanged.

Purpose

The main objectives of MC/DC are:

  • To ensure that every condition within a decision takes both true and false values during testing,
  • To demonstrate that changing a single condition alone can change the overall decision outcome,
  • To detect logical errors in decision structures that may not be revealed by statement or branch coverage alone.

How is it applied?

MC/DC is applied by defining at least one test pair for each condition in a decision. In these test pairs:

  • All other conditions are held constant,
  • Only the condition under examination is changed,
  • The change in that condition causes the decision outcome to change.

The general application steps are:

  1. Identify decision statements containing multiple conditions.
  2. Decompose each decision into its individual conditions.
  3. Define test pairs that demonstrate independent condition influence.
  4. Execute tests and analyze coverage results.

Number of test cases

MC/DC does not require testing all possible combinations of condition values. For a decision containing n conditions, it is commonly stated that n + 1 test cases may be sufficient to achieve full MC/DC coverage. This approach balances test efficiency with thorough logical verification.

Tool support

During structural coverage analysis, instrumentation is typically added to the source code to collect coverage data during test execution. Some software testing and analysis programs are capable of measuring and reporting statement, decision, and MC/DC coverage levels, highlighting uncovered conditions and decisions.

Code Example

The following example illustrates how MC/DC can be achieved for a decision with three conditions:

Code Example

This decision consists of three conditions: A, B, and C. The decision outcome depends on their logical combination.

To satisfy MC/DC, each condition must be shown to independently affect the decision outcome while the other conditions remain unchanged. The following test cases meet this requirement:

Test Decision Table

Using this test set:

  • Condition A independently affects the decision outcome.
  • Condition B independently affects the decision outcome.
  • Condition C independently affects the decision outcome.

Therefore, 100% MC/DC coverage is achieved for this decision.

Author Information

Avatar
AuthorHüsnü Umut OkurDecember 26, 2025 at 8:40 AM

Tags

Discussions

No Discussion Added Yet

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

View Discussions

Contents

  • What is it?

  • Purpose

  • How is it applied?

  • Number of test cases

  • Tool support

  • Code Example

This article was created with the support of artificial intelligence.

Ask to Küre