Elementary comparison testing
Elementary comparison testing (ECT) is a white-box, control-flow, test-design methodology used in software development.[1] The purpose of ECT is to enable detailed testing of complex software.[2] Software code or pseudocode is tested to assess the proper handling of all decision outcomes.[src] As with multiple-condition coverage and basis path testing, coverage of all independent and isolated conditions is accomplished through modified condition/decision coverage (MC/DC).[src] Isolated conditions are aggregated into connected situations creating formal test cases.[src] The independence of a condition is shown by changing the condition value in isolation.[src] Each relevant condition value is covered by test cases.[src]
Elementary comparison testing (ECT) is a white-box, control-flow, test-design methodology used in software development.[1] The purpose of ECT is to enable detailed testing of complex software.[2] Software code or pseudocode is tested to assess the proper handling of all decision outcomes.[src] As with multiple-condition coverage and basis path testing, coverage of all independent and isolated conditions is accomplished through modified condition/decision coverage (MC/DC).[src] Isolated conditions are aggregated into connected situations creating formal test cases.[src] The independence of a condition is shown by changing the condition value in isolation.[src] Each relevant condition value is covered by test cases.[src] ==Test case== A test case consists of a logical path through one or many decisions from start to end of a process.[src] Contradictory situations are deduced from the test case matrix and excluded.[src] The MC/DC approach isolates every condition, neglecting all possible subpath combinations and path coverage.[src] T=n+1 where T is the number of test cases per decision and n the number of conditions.[src] The decision d_i consists of a combination of elementary conditions \begin{align} \Sigma &= \{0, 1\}\\ C&=\{c_0, c_1, c_2, c_3,..., c_n\} \end{align} \epsilon : C \to \Sigma \times C D \subseteq C^* \,;\; d_i \in D The transition function \alpha is defined as \alpha : D \times \Sigma^* \to \Sigma \times D Given the transition \vdash \vdash \subseteq (\Sigma \times D \times \Sigma^*) \times (\Sigma \times D \times \Sigma^*) S_j=(b_j, d_m, v_j) \vdash (b_{j+1}, d_n, v_{j+1}) E_j=(a_j, c_j) \vdash (a_{j+1}, c_k) (b_{j+1}, d_n) = \alpha(d_m, v_j); (b_{j+1}, c_k) = \epsilon(c_j); a_j \in \Sigma, the isolated test path P_m consists of \begin{align} P_m &= (b_0, d_0, v_0) \vdash ...[1] \vdash (b_i, d_i, v_i) \vdash^*(b_n, d_n, v_n) \\ &= (b_0, c_0) \vdash ...[src] \vdash (b_m, c_m) \vdash^* (b_n, c_n) \end{align} b_i \in \Sigma; c_m \in d_i; v \in C^*; d_0=S; d_n=E.[src] ==Test case graph== A test case graph illustrates all the necessary independent paths (test cases) to cover all isolated conditions.[1] Conditions are represented by nodes, and condition values (situations) by edges.[src] An edge addresses all program situations.[src] Each situation is connected to one preceding and successive condition.[src] Test cases might overlap due to isolated conditions.[src] ==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.[1] There are r = 2^n possible condition value combinations \forall{i} \in \{1,...,n\},\ c_i\mapsto\{0,\ 1\}.[src] When each condition c_i is isolated, the number of required test cases T per decision is: T = \log_2(r)+1 = n + 1.[src] \forall{i}\in\{1,...,n\} there are 0 edges from parent nodes c_i and s = 2 edges to child nodes from c_i .[src] Each individual condition c_i connects to at least one path \forall{i}\in\{1,...,n-1\} , \ c_i\mapsto\{0,\ 1\} from the maximal possible n connecting to c_n isolating c_n .[src] All predecessor conditions c_i;\ i and respective paths are isolated.[src] Therefore, when one node (condition) is added, the total number of paths, and required test cases, from start to finish increases by: T = n-1+2 = n+1.[src] Q.E.D.[src] ==Test-case design steps== Identify decisions Determine test situations per decision point (Modified Condition / Decision Coverage) Create logical test-case matrix Create physical test-case matrix ==Example== This example shows ETC applied to a holiday booking system.[4] The discount system offers reduced-price vacations.[src] The offered discounts are -20\% for members or for expensive vacations, -10\% for moderate vacations with workday departures, and 0\% otherwise.[src] The example shows the creation of logical and physical test cases for all isolated conditions.[1] Pseudocode if days > 15 or price > 1000 or member then return −0.2 else if (days > 8 and days ≤ 15 or price ≥ 500 and price ≤ 1000) and workday then return −0.1 else return 0.0 Factors Number of days: 15 Price (euros): 1000 Membership card: none; silver; gold; platinum Departure date: workday; weekend; holiday T = 3 \times 3 \times 4 \times 3 = 108 possible combinations (test cases).[src] Example in Python: if days > 15 or price > 1000 or member: return -0.2 elif (days > 8 and days = 500 and price ===Step 1: Decisions=== \begin{align} d_1 &= \text{days} > 15\ \text{or}\ \text{price} > 1000\ \text{Eur}\ \text{or}\ \text{member} \\ c_1 &= \text{days} > 15 \\ c_2 &= \text{price} > 1000 \\ c_3 &= \text{member} \\ \end{align} \begin{align} d_2 &= (8 ===Step 2: MC/DC Matrix=== The highlighted diagonals in the MC/DC Matrix are describing the isolated conditions: (c_i,c_i) \mapsto \{1,0\} all duplicate situations are regarded as proven and removed.[src] ===Step 3: Logical test-Case matrix=== Test cases are formed by tracing decision paths.[src] For every decision d_i;\ 0 a succeeding and preceding subpath is searched until every connected path has a start S and an end E : \begin{align} T_1&=(d_1, 100) \vdash (1, E) \\ T_2&=(d_1, 000) \vdash (0, d_2, 100) \vdash (1, E) \\ T_3&=(d_1, 010) \vdash (1, E) \\ \vdots \\ T_{n+1} \end{align} ===Step 4: Physical test-case matrix=== Physical test cases are created from logical test cases by filling in actual value representations and their respective results.[src] ===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.[1] ==See also== Control-flow graph Decision-to-decision path ==References==[src]
44 sentences · 44 cited inline · 4 references stored
References
- All about the elementary comparison test | Testlearning · retrieved 2022-09-01 · rev 1306187737
Cite this reference
MLA "All about the elementary comparison test | Testlearning." 2022-09-01. https://www.testlearning.net/en/posts/elementary-comparison-test. Accessed 26 November 2026.
Chicago "All about the elementary comparison test | Testlearning." 2022-09-01. https://www.testlearning.net/en/posts/elementary-comparison-test.
APA encyclopegia.org. (2022). All about the elementary comparison test | Testlearning. Retrieved November 26, 2026, from https://www.testlearning.net/en/posts/elementary-comparison-test
- Glenford J. Myers (2004). The Art of Software Testing, Second Edition , p. 40., John Wiley & Sons, New Jersey. ISBN 0-471-46912-2 . Wikipedia revision 1306187737, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1306187737
Cite this reference
MLA "Glenford J. Myers (2004). The Art of Software Testing, Second Edition , p. 40., John Wiley & Sons, New Jersey. ISBN 0-471-46912-2 . Wikipedia revision 1306187737, retrieved 2026-11-19." Glenford J. 2026-11-18. https://en.wikipedia.org/wiki/ISBN_(identifier). Accessed 26 November 2026.
Chicago "Glenford J. Myers (2004). The Art of Software Testing, Second Edition , p. 40., John Wiley & Sons, New Jersey. ISBN 0-471-46912-2 . Wikipedia revision 1306187737, retrieved 2026-11-19." Glenford J. 2026-11-18. https://en.wikipedia.org/wiki/ISBN_(identifier).
APA Glenford J. (2026). Glenford J. Myers (2004). The Art of Software Testing, Second Edition , p. 40., John Wiley & Sons, New Jersey. ISBN 0-471-46912-2 . Wikipedia revision 1306187737, retrieved 2026-11-19. Retrieved November 26, 2026, from https://en.wikipedia.org/wiki/ISBN_(identifier)
- Tim Kroom (2006). TMap Next, for result driven testing , p. 668. UTN Publishers, Rotterdam. ASIN B01K3PXI5U . Wikipedia revision 1306187737, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1306187737
Cite this reference
MLA "Tim Kroom (2006). TMap Next, for result driven testing , p. 668. UTN Publishers, Rotterdam. ASIN B01K3PXI5U . Wikipedia revision 1306187737, retrieved 2026-11-19." Tim Kroom (2006). 2026-11-18. https://en.wikipedia.org/wiki/Amazon_Standard_Identification_Number. Accessed 26 November 2026.
Chicago "Tim Kroom (2006). TMap Next, for result driven testing , p. 668. UTN Publishers, Rotterdam. ASIN B01K3PXI5U . Wikipedia revision 1306187737, retrieved 2026-11-19." Tim Kroom (2006). 2026-11-18. https://en.wikipedia.org/wiki/Amazon_Standard_Identification_Number.
APA Tim Kroom (2006). (2026). Tim Kroom (2006). TMap Next, for result driven testing , p. 668. UTN Publishers, Rotterdam. ASIN B01K3PXI5U . Wikipedia revision 1306187737, retrieved 2026-11-19. Retrieved November 26, 2026, from https://en.wikipedia.org/wiki/Amazon_Standard_Identification_Number
- a b c Lee Copeland (2004). A Practitioners Guide to Software Test Design , chapter 10. Artech House Publishers, Norwood. ISBN 0140289712 . Wikipedia revision 1306187737, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1306187737
Cite this reference
MLA "a b c Lee Copeland (2004). A Practitioners Guide to Software Test Design , chapter 10. Artech House Publishers, Norwood. ISBN 0140289712 . Wikipedia revision 1306187737, retrieved 2026-11-19." a b c Lee Copeland (2004). 2026-11-18. https://en.wikipedia.org/wiki/ISBN_(identifier). Accessed 26 November 2026.
Chicago "a b c Lee Copeland (2004). A Practitioners Guide to Software Test Design , chapter 10. Artech House Publishers, Norwood. ISBN 0140289712 . Wikipedia revision 1306187737, retrieved 2026-11-19." a b c Lee Copeland (2004). 2026-11-18. https://en.wikipedia.org/wiki/ISBN_(identifier).
APA a b c Lee Copeland (2004). (2026). a b c Lee Copeland (2004). A Practitioners Guide to Software Test Design , chapter 10. Artech House Publishers, Norwood. ISBN 0140289712 . Wikipedia revision 1306187737, retrieved 2026-11-19. Retrieved November 26, 2026, from https://en.wikipedia.org/wiki/ISBN_(identifier)
Cite this article
MLA
"Elementary comparison testing." encyclopegia.org, 2025, https://encyclopegia.org/wiki/elementary-comparison-testing. Accessed 26 November 2026.
Chicago
"Elementary comparison testing." encyclopegia.org. Accessed November 26, 2026. https://encyclopegia.org/wiki/elementary-comparison-testing.
APA
encyclopegia.org. (2025). Elementary comparison testing. Retrieved November 26, 2026, from https://encyclopegia.org/wiki/elementary-comparison-testing
Accessed November 26, 2026 · CC BY-SA 4.0 · citation page · JSON