Elementary comparison testing

Elementary comparison testing (ECT) is a formal white-box, control-flow, test-design method.[1] Its purpose is to implement the detailed testing of complex and important software. Software pseudocode or code is tested to assess the proper handling of all decision outcomes. As with multiple-condition coverage[2] and basis path testing[1], coverage of all independent isolated condition paths is accomplished through modified condition/decision coverage (MC/DC)[3]. Isolated conditions are aggregated into connected situations creating test cases. The independence of a condition is shown by changing the condition value in isolation. Each relevant condition value is covered by test cases.

A test case

A test case consists of a logical path from start to end of a process, through one or many decisions. 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 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 of number of condition paths

The elementary comparison testing method can be used to determine the number of condition paths by inductive proof.

Figure 2: ECT Inductive Proof Anchor

There are possible condition value combinations

.

When each condition is isolated, the number of required test cases per decision is:



Figure 3: ECT Inductive Proof End

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:




Test-case design steps

  1. Identify decisions
  2. Determine test situations per decision point (Modified Condition / Decision Coverage)
  3. Create logical test-case matrix
  4. Create physical test-case matrix

Example

Figure 4: ECT Example Control Flow Graph
Figure 5: ECT Example D2 Conditions

This example shows ETC applied to a holiday booking system. The discount system offers reduced-price vacations. The offered discounts are for average customers, for expensive vacations, and for members or 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
  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

Factors

  • Number of days:
  • Price (euros):
  • Membership card:
  • Departure date:

possible combinations (test cases).

Step 1: Decisions

Table 1: Example D1 MC/DC
Outcome
Decision D1 1 0
Conditions c1c2c3c1c2c3
c1 100000
c2 010000
c3 001000





Step 2: MC/DC Matrix

Table 2: Example D2 MC/DC
Outcome
Decision D2 1 0
Conditions c4c5c6c4c5c6
c4 101001
c5 011001
c6 101100

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
xxxx
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
days1614888
price1100600
departuresa
membersilver
Result
00
-10111
-20111

Physical test cases are created from logical test cases by filling in actual value representations and their respective results.

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.

See also

References

  1. 1 2 3 Lee Copeland (2004). A Practitioners Guide to Software Test Design, chapter 10. Artech House Publishers, Norwood. ISBN 0140289712.
  2. Glenford J. Myers (2004). The Art of Software Testing, Second Edition, p. 40., John Wiley & Sons, New Jersey. ISBN 0-471-46912-2.
  3. Tim Kroom (2006). TMap Next, for result driven testing, p. 668. UTN Publishers, Rotterdam. ASIN B01K3PXI5U.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.