10.12.2012 Views

Domain Testing: Divide and Conquer - Testing Education

Domain Testing: Divide and Conquer - Testing Education

Domain Testing: Divide and Conquer - Testing Education

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

For example, consider a function that has five variables a, b, c, d <strong>and</strong> e. ‘a’ has 3<br />

test cases corresponding to it <strong>and</strong> each of the remaining four have two test cases<br />

each. Let us apply all-pairs combination to this function <strong>and</strong> see how we could<br />

achieve all-pairs, that is, each test case value of each of the five variables is paired<br />

(at least once) with each of the test case values of the remaining four variables.<br />

Let’s assume that all the five variables are useful for all-pairs combination, since<br />

we really don’t have any information about the variables other than the number of<br />

test cases they have. Let us also assume that each of their test cases produces an<br />

acceptable result by the function. Let us give symbolic representations to the test<br />

cases of each of the variables:<br />

Variable Test Cases<br />

a A1, A2, A3<br />

b B1, B2<br />

c C1, C2<br />

d D1, D2<br />

e E1, E2<br />

The following is the result of all-pairs combination:<br />

Test<br />

case#<br />

a(3) b(2) c(2) d(2) e(2)<br />

1. A1 B1 C1 D1 E1<br />

2. A1 B2 C2 D2 E2<br />

3. A2 B1 C2 D2 E1<br />

4. A2 B2 C1 D1 E2<br />

5. A3 B1 C1 D2 E2<br />

6. A3 B2 C2 D1 E1<br />

If you observe carefully, you will see that every test case of ‘a’ has been paired at<br />

least once with every test case of ‘b’, ‘c’, ‘d’ <strong>and</strong> ‘e’. This holds true for ‘b’, ‘c’,<br />

‘d’ <strong>and</strong> ‘e’ also. Hence, all-pairs of the five variables have been achieved in the<br />

above arrangement. Also, note that the number of combinations needed to arrive<br />

at this all-pairs configuration is six, which is the product of the number of test<br />

cases of ‘a’ <strong>and</strong> ‘b’ (3x2).<br />

In general, if we were to sort the variables in descending order in terms of the<br />

number of representatives (values chosen to be tested) <strong>and</strong> if Max1 <strong>and</strong> Max2 are<br />

the first two in this sorted list (the two highest) then the minimal number of<br />

combinations in all-pairs combination would be (Max1) x (Max2). We might not<br />

be able to fit in all pairs within Max1 x Max2 combinations, in which case,<br />

additional combinations might have to be added.<br />

© Sowmya Padmanabhan, 2003<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!