A test case consists of a logical path through one or many decisions from start to end of a process. Contradictory situations are deduced from the test case matrix and excluded. The MC/DC approach isolates every condition, neglecting all possible subpath combinations and path coverage.[1]
where
T is the number of test cases per decision and
n the number of conditions.
The decision consists of a combination of elementary conditions
The transition function is defined as
Given the transition
the isolated test path consists of
Test case graph
A test case graph illustrates all the necessary independent paths (test cases) to cover all isolated conditions. Conditions are represented by nodes, and condition values (situations) by edges. An edge addresses all program situations. Each situation is connected to one preceding and successive condition. Test cases might overlap due to isolated conditions.
Inductive proof of a number of condition paths
The elementary comparison testing method can be used to determine the number of condition paths by inductive proof.
There are possible condition value combinations
When each condition is isolated, the number of required test cases per decision is:
there are edges from parent nodes and edges to child nodes from .
Each individual condition connects to at least one path
from the maximal possible connecting to isolating .
All predecessor conditions and respective paths are isolated. Therefore, when one node (condition) is added, the total number of paths, and required test cases, from start to finish increases by:
Q.E.D.
This example shows ETC applied to a holiday booking system. The discount system offers reduced-price vacations. The offered discounts are for members or for expensive vacations, for moderate vacations with workday departures, and otherwise. The example shows the creation of logical and physical test cases for all isolated conditions.
Pseudocode
if days > 15 or price > 1000 or member thenreturn −0.2
else if (days > 8 and days ≤ 15 or price ≥ 500 and price ≤ 1000) and workday thenreturn −0.1
elsereturn 0.0
The highlighted diagonals in the MC/DC Matrix are describing the isolated conditions:
all duplicate situations are regarded as proven and removed.
Step 3: Logical test-Case matrix
Table 3: Example Logical Test Case Matrix
Situation
x
x
x
x
x
x
x
x
x
x
x
Test cases are formed by tracing decision paths. For every decision a succeeding and preceding subpath is searched until every connected path has a start and an end :
Step 4: Physical test-case matrix
Table 4: Example Physical Test Cases
Factor\Test Case
days
16
14
8
8
8
price
1100
600
departure
sa
member
silver
Result
0
0
-10
1
1
1
-20
1
1
1
Physical test cases are created from logical test cases by filling in actual value representations and their respective results.
Test-case graph
In the example test case graph, all test cases and their isolated conditions are marked by colors, and the remaining paths are implicitly passed.