Elementary comparison testing is a formal white boxcontrol flowtest design method.[1] Its purpose is detailed testing of important and complex functionality. Tests to assess the coverage of conditions are based on the code or pseudocode behind the functionality being tested. Restricted from multiple-condition coverage[2] and basis path testing[1], coverage of all independent isolated condition paths is reached through modified condition/decision coverage (MC/DC)[3]. Isolated conditions are forming connected situations creating test cases. The independence of a condition is demonstrated by changing the condition value of each condition in isolation. Each relevant condition value is covered by test cases.
A test case
A test case consists of a logical consonant path from start to end passing one or many decisions. Contradicting situations are excluded and deduced from the test case matrix. The MC/DC approach isolates every condition neglecting all possible subpath combinations and path coverage[1]
where
T is the amount of test cases per decision, and
n the amount 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. All program situations are addressed by an edge. Each situation is connected to one preceding and successive condition. Test cases might overlap due to isolated conditions.
Inductive Proof Isolated Condition Paths
The elementary comparison testing method can be proofed inductively.
Figure 2: ECT Inductive Proof Anchor
There are possible condition value combinations
,
when each condition is isolated, the amount of relevant test cases per decision is:
Figure 3: ECT Inductive Proof End
there are edges connecting from preceding nodes and edges towards succeeding nodes from .
Each individual condition connects with 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 amount of paths from start to end (test cases) increases by:
This example explains in Detail ETC applied to a holiday booking system. The discount system offers reduced vacations. The offered discounts are for average customers, for expensive vacations and members otherwise discount. The example has undertaken detailed testing creating logical and physical test cases isolating all conditions.
Figure 4: ECT Example Control Flow Graph
Pseudocode
if days > 15 or price > 1000 or member
return -0.2
else if (days > 8 and days < 15 or price>500 and price < 1000) and workday
return -0.1
else
return 0.0
The highlighted diagonals in the MC/DC Matrix are describing the isolated conditions:
all duplicate situations are striked like proven.
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 marking situations. For every decision a succeeding and preceding consonant subpath is searched till 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 result.
Test Case Graph
Figure 6: ECT Example 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.