Information Technology Reference
In-Depth Information
Table 3.4 Number of occurrences of parameter-value pairs (4th iteration)
p 1
p 2
p 3
p 4
1
2
1
2
1
2
1
2
0
2
2
0
1
3
1
3
Iteration #4 For the fourth iteration, the number of occurrences of parameter-value
pairs are shown in Table 3.4 .
We choose p 3 and value 2, which now appears the greatest number of times in
uncovered target combinations, and is a valid parameter-value pair.
To generate the first candidate test case, we choose p 2 ,
p 1 ,
p 4 as the order of the
remaining parameters, and a possible selection of values for this order is “1(valid),
2(invalid, choose 1 instead), 2(valid)”. The resulting test case is
.Note
that when selecting value for p 1 , the first choice was 1, which makes the partial
test case
(
1
,
1
,
2
,
2
)
(
2
,
1
,
2
, )
violates constraint “ p 2
==
1
p 1
==
1”, so the value
was abandoned, and 1 was chosen.
To generate the second candidate test case, we choose p 1 ,
p 4 as the order of the
remaining parameters, and a possible selection of values for this order is “2(valid),
1(invalid, choose 2 instead), 2(valid)”. The resulting test case is
p 2 ,
.Note
that when selecting value for p 2 , the first choice was 1, which makes the partial
test case
(
2
,
2
,
2
,
2
)
(
2
,
1
,
2
, )
violates constraint “ p 2
==
1
p 1
==
1”, so the value
was abandoned, and 2 was chosen.
Both of the two candidate test cases cover two uncovered target combinations.
We choose
as the fourth test case.
Now we remove the target combinations covered by the fourth test case. So the
set of uncovered target combinations now becomes:
(
1
,
1
,
2
,
2
)
{
///////////////////////////
( 1 , 1 , - , - ) ,
///////////////////////////
( 1 , 2 , - , - ) ,
/////////////////////////
( 2 , 1 , - , - )
/////////////////////////
(2,2,-,-),
///////////////////////////
( 1 , - , 1 , - ) ,
///////////////////////////
( 1 , - , 2 , - ) ,
/////////////////////////
(2,-,1,-),
(2,-,2,-),
///////////////////////////
( 1 , - , - , 1 ) ,
///////////////////////////
( 1 , - , - , 2 ) ,
/////////////////////////
(2,-,-,1),
(2,-,-,2),
///////////////////////////
( - , 1 , 1 , - ) ,
///////////////////////////
( - , 1 , 2 , - ) ,
/////////////////////////
( - , 2 , 1 , - ) ,
///////////////////////////
(-,2,2,-),
///////////////////////////
( - , 1 , - , 1 ) ,
///////////////////////////
( - , 1 , - , 2 ) ,
/////////////////////////
( - , 2 , - , 1 ) ,
///////////////////////////
(-,2,-,2),
///////////////////////////
( - , - , 1 , 1 ) ,
( - , - , 1 , 2 ) ,
( - , - , 2 , 1 ) ,
/////////////////////////
(-,-,2,2)
} .
Iteration #5 The rest of the test generation process is described briefly. For the fifth
iteration, p 1 and value 2 are selected (valid). And for parameter order p 3 ,
p 2 ,
values “2(valid), 2(valid), 1(invalid, choose 2 instead)” are selected, and candidate
(
p 4 ,
p 4 , values “1(invalid,
choose 2 instead), 2(valid), 2(valid)” are selected, and candidate
2
,
2
,
2
,
2
)
is generated. Then for parameter order p 2 ,
p 3 ,
is gener-
ated. The two candidates are identical and cover 2 uncovered target combinations, and
finally the first candidate is chosen. Then, the set of remaining target combinations
becomes:
(
2
,
2
,
2
,
2
)
 
Search WWH ::




Custom Search