wise-1 testing

When combinations’ number is high, it is possible at least verify that - at least once - each individual value of the variables is given as input to the program to be tested. In other words, if the variable A can take the values A1, A2, A3, it must be executed at least a first test in which the variable A = A1, a second test in which A = A2, and a third test in which the variable A = A3; the same goes for the other variables. This type of test provides a so-called wise-1 cover, and we will see shortly the meaning. In practice, we have the following table:

 

# TEST

A

B

C

1

A1

*

*

2

A2

*

*

3

A3

*

*

4

A4

*

*

5

*

B1

*

6

*

B2

*

7

*

B3

*

8

*

*

C1

9

*

*

C2

Table 3 – Max wise-1 Test Set

 

A first reduction that is possible to do is to set a value for the first variable and assign a random (but permitted) value to the other variables (stated with * in Table 3) and proceeding in this way for all the variables and values. In this way we reduce the test cases from 24 to just 9. It’s still possible to further reduce the number of test cases considering that instead of * you can put a value of the variable which can then be excluded from the subsequent test cases.

Put into practice, for test case # 1 in place of B = * put B = B1, instead of C = * put C = C1 and remove test case # 5 and test case # 8, which –now - are both covered by the test case # 1;

Test case # 2: in place of B = * put B = B2 and n place of C = * put C = C2 and erase test cases # 6 and # 9 both of which are now covered by the test case # 2 .

Test case # 3: instead of B = * put B = B3 and in place of C = * insert any value C1 or C2, considering that the values of the variable C equal to C1 and C2 are already been covered by test cases # 1 and # 2; we can let C=* and postpone the choice of whether to enter C1 or C2. Now, remove test case # 7, since B = B3 is now covered by the test case # 3.

Having understood the mechanism, there remains only the test case # 4, which covers A = A4; we can let B=* and C=* postponing the choice of what to actually select when we will really perform the test.

The symbol * represents the "don’t care"; any value we put in it, the coverage of the test set does not change and all variables values will be used at least once. Those with "*" value ​​should be covered more than once.

The final minimized Test Set for wise-1 coverage is the following:

 

# TEST

A

B

C

1

A1

B1

C1

2

A2

B2

C2

3

A3

B3

*

4

A4

*

*

Table 4 – Minimized wise-1 Test Set

 

Tabella 4 is drawn from Tabella 3 moving up the columns of the variable B and C to fill the values ​​with * with specific values; the * values “stagnate” in the lines that cannot be covered from specific values ​​(row 3 variable C and row 4 variable B), because the number of values of the variables are different (for example, variable B has just 3 values, while variable A has 4 values; the missing B value – with respect to A – is replaced by *).

Therefore saying that a test set, such as that reported in Table 4 , provides wise-1coverage is equivalent to say that each individual value of each variable is covered at least once.

The general wise-1 rule we can deduce is the following:

 

N variables X1, X2, …Xk, the first assuming n1 possible values, the second n2 possible values, the k-th nk possible values, the maximum number of tests that provide coverage wise-1 is equal to , while the minimum number of tests is equal to the maximum value among {n1 , n2 ,…, nk }.”

 

In real cases, what is of interest is always the Test Set with the minimum number of test cases ensuring the chosen coverage (and this for obvious reasons).

Web Traffic

Today4
Yesterday34
This week35822
This month579
Total35822

Who Is Online

1
Online

Saturday, 16 December 2017 01:13
Powered by CoalaWeb