Information Technology Reference
In-Depth Information
Algorithm 2 The AETG Algorithm
1: test _ suite
=∅
2: init
;
3: while uncov _ target _ combs
(
uncov _ target _ combs
)
=∅
do
4:
candidates =∅
5:
for m = 1to M do
6:
candidate = empty _ test _ case
7:
( p , v ) = selectFirstParameterAndValue ( uncov _ target _ combs )
8:
Assign v to parameter p in candidate
9:
paraOrder = permuteRemainingParameters ()
10:
for each remaining parameter p in paraOrder do
v = selectValue ( p , uncov _ target _ combs )
11:
12:
Assign v to parameter p in candidate
13:
end for
14:
candidates = candidates ∪{ candidate }
.
15: end for
16: Choose the test case in candidates covering the greatest number of uncovered target combi-
nations as new _ test _ case .
17:
test _ suite
=
test _ suite
∪{
new _ test _ case
}
18:
update
(
uncov _ target _ combs
,
new _ test _ case
)
19: end while
thus the heuristic for maximizing the number of newly-covered target combinations
will lose effectiveness. Cohen et al. [ 7 , 9 ] proposed the AETG-SAT algorithm which
is better in constraint handling. Before doing any assignment, the algorithm uses a
SAT solver 1 to check the validity of the resulting partial test case. (If the assigned
parameter is not related to any constraint, the validity check is not necessary). If
the resulting partial test case is invalid, it tries with the next-best one, until a valid
assignment is found. This method guarantees that at any moment, there must exists
an assignment of the unassigned parameters that completes the partial test case into
a valid test case.
3.2.2 AETG Example
Now we give an example to illustrate how AETG works. Suppose we are testing
a web-based application on different client platforms to see whether it can work
normally on different system configurations. Possible factors include the operating
system (OS), web browser, whether Flash plugin is installed and the proxy config-
urations. For simplicity, we assume that each parameter has two values. The SUT
model can be described as follows:
1 For a brief introduction to SAT, see Sect. 6.1 .
 
 
Search WWH ::




Custom Search