generating test data for software structural testing based on particle swarm optimization

15
Arab J Sci Eng (2014) 39:4593–4607 DOI 10.1007/s13369-014-1074-y RESEARCH ARTICLE - COMPUTER ENGINEERING AND COMPUTER SCIENCE Generating Test Data for Software Structural Testing Based on Particle Swarm Optimization Chengying Mao Received: 26 September 2012 / Accepted: 30 April 2013 / Published online: 30 March 2014 © King Fahd University of Petroleum and Minerals 2014 Abstract Testing is an important way to ensure and improve the quality of software system. However, it is a time- consuming and labor-intensive activity. In the paper, our main concern is software structural testing, and propose a search- based test data generation solution. In our framework, parti- cle swarm optimization (PSO) technique is adopted due to its simplicity and fast convergence speed. For test data genera- tion problem, the inputs of program under test are encoded into particles. Once a set of test inputs is produced, coverage information can be collected by test driver. Meanwhile, the fitness value of branch coverage can be calculated based on such information. Then, the fitness is used for PSO to adjust the search direction. Finally, the test data set with the highest coverage rate is yielded. In addition, eight well-known pro- grams are used for experimental analysis. The results show that PSO-based approach has a distinct advantage compared to the traditional evolutionary algorithms such as generic algorithm and simulated annealing, and also outperforms comprehensive learning-PSO both in covering effect and in evolution speed. Keywords Test data generation · PSO · Branch coverage · Fitness function · Convergence speed C. Mao (B ) School of Software and Communication Engineering, Jiangxi University of Finance and Economics, Nanchang 330013, China e-mail: [email protected] 1 Introduction Software has widely affected our work and lives, and brought us great convenience. However, its failure may lead to signif- icant economic loss or threat to life safety. For example, the explosion incident of Ariane-V rocket [1] and the BP deep- water horizon disaster [2] are the typical instances of such failures in the past years. As a consequence, software quality has become an important concern for people in the current information society. Testing has been proved as one of the effective approaches to ensure and improve software quality over the past three decades. Generally speaking, software testing methods can be divided into two categories: functional (black-box) test- ing and structural (white-box) testing [3, 4]. Compared with functional testing, structural testing exhibits much higher defect exposure capability, so it has been adopted as an impor- 123

Upload: chengying

Post on 24-Jan-2017

213 views

Category:

Documents


1 download

TRANSCRIPT

Arab J Sci Eng (2014) 39:4593–4607DOI 10.1007/s13369-014-1074-y

RESEARCH ARTICLE - COMPUTER ENGINEERING AND COMPUTER SCIENCE

Generating Test Data for Software Structural Testing Basedon Particle Swarm Optimization

Chengying Mao

Received: 26 September 2012 / Accepted: 30 April 2013 / Published online: 30 March 2014© King Fahd University of Petroleum and Minerals 2014

Abstract Testing is an important way to ensure and improvethe quality of software system. However, it is a time-consuming and labor-intensive activity. In the paper, our mainconcern is software structural testing, and propose a search-based test data generation solution. In our framework, parti-cle swarm optimization (PSO) technique is adopted due to itssimplicity and fast convergence speed. For test data genera-tion problem, the inputs of program under test are encodedinto particles. Once a set of test inputs is produced, coverageinformation can be collected by test driver. Meanwhile, thefitness value of branch coverage can be calculated based onsuch information. Then, the fitness is used for PSO to adjustthe search direction. Finally, the test data set with the highestcoverage rate is yielded. In addition, eight well-known pro-grams are used for experimental analysis. The results showthat PSO-based approach has a distinct advantage comparedto the traditional evolutionary algorithms such as genericalgorithm and simulated annealing, and also outperformscomprehensive learning-PSO both in covering effect and inevolution speed.

Keywords Test data generation · PSO · Branch coverage ·Fitness function · Convergence speed

C. Mao (B)School of Software and Communication Engineering,Jiangxi University of Finance and Economics,Nanchang 330013, Chinae-mail: [email protected]

1 Introduction

Software has widely affected our work and lives, and broughtus great convenience. However, its failure may lead to signif-icant economic loss or threat to life safety. For example, theexplosion incident of Ariane-V rocket [1] and the BP deep-water horizon disaster [2] are the typical instances of suchfailures in the past years. As a consequence, software qualityhas become an important concern for people in the currentinformation society.

Testing has been proved as one of the effective approachesto ensure and improve software quality over the past threedecades. Generally speaking, software testing methods canbe divided into two categories: functional (black-box) test-ing and structural (white-box) testing [3,4]. Compared withfunctional testing, structural testing exhibits much higherdefect exposure capability, so it has been adopted as an impor-

123

4594 Arab J Sci Eng (2014) 39:4593–4607

tant fault-revealing method during the software developmentprocess. While considering such kind of testing method, howto generate test data set which satisfies some specific cover-age criterion is not an easy task.

In recent years, search techniques have been widelyreferred in the field of software testing, so-called search-based software testing (SBST) [5], especially for test datageneration problem. The general idea behind search-basedtest data generation is to select a set of test cases from pro-gram input space to meet the testing requirement. The basicprocedure is to generate a test suite that covers a specifictest adequacy criterion, which is usually expressed as a fit-ness function [6]. When a coverage criterion is selected, thesearch activity should attempt to produce a test suite whichcan cover all construct elements mentioned in the criterion.Meanwhile, testing is a time-consuming and labor-intensiveactivity. Hence, the size of test suite should be as small aspossible to reduce the testing time and cost.

Among the existing search methods, meta-heuristic search(MHS) techniques, such as simulated annealing (SA) andgeneric algorithm (GA), are the most popular algorithms, andhave been widely adopted for generating test data. Althoughthey can produce test data with appropriate fault-prone ability[7,8], they fail to produce them quickly due to their slow evo-lutionary speed. Recently, as a swarm intelligence technique,particle swarm optimization (PSO) [9,10] has become a hotresearch topic in the area of intelligent computing. Its signif-icant feature is the simplicity and fast convergence speed. Inthis paper, we studied how to apply this novel optimizationtechnique to generate test data for software structural testing.Meanwhile, some well-known programs have been used forcomparison analysis, and the experimental results show thatPSO outperforms other traditional search techniques, suchas GA and SA, according to the quality of the generated testdata.

The paper is structured as follows. In the next section, wewill briefly introduce the basic procedure of SBST. Mean-while, the related work about this problem is also addressed.Then, PSO is introduced in Sect. 3. In Sect. 4, the over-all framework and some technical details of PSO-based testdata generation are discussed. The experimental and compar-ison analysis are performed in Sect. 5. Finally, concludingremarks are given in Sect. 6.

2 Background

2.1 Search-Based Test Data Generation

Test data generation is a difficult task in software testingactivity. In fact, it is a process of sampling the representativeinputs, which can reveal the potential faults in program, fromthe input space. In recent years, some search techniques has

been incorporated into test data generation. It has been recog-nized as a rational solution in the field of software testing,also known as SBST.

As shown in Fig. 1, the basic process of search-based testdata generation [11] can be described as follows. At the initialstage, the search algorithm generates a basic test suite by therandom strategy. Then test engineer or tool seeds test inputsfrom the test suite into the program under test (PUT) andruns it. During this process, the instrumented code monitorsthe PUT and can produce the information about executiontraces and results. Based on such trace information, the cov-erage metric for some specific criterion can be calculatedautomatically. Subsequently, the metric is used to update thefitness value of the pre-set coverage criterion. Finally, testdata generation algorithm adjusts the search direction in thenext-step iteration according to the fitness information. Thewhole search process could be terminated until the generatedtest suite Stc satisfies the pre-set coverage criterion.

There are three key issues in the above framework: tracecollection, fitness function construction and search algorithmselection. In general, execution traces are collected by codeinstrumentation technology, which can be settled with com-piling analysis. While constructing fitness function, testersshould determine which kind of coverage is needed. Expe-rience shows that branch coverage is a better cost-effectivecriterion [12]. For the last issue, we adopt PSO to producetest inputs due to its excellent features, such as easy imple-mentation and fast convergence speed.

2.2 Related Work

Test data generation is a key problem in automated softwaretesting, which has attracted researcher’s extensive attentionin the past decades. Here, we mainly concern on the test datageneration methods based on MHS algorithms.

In the 1990s, genetic algorithm has been adopted to gen-erate test data. Jones et al. [13] and Pargas et al. [14] inves-tigated the use of GA for automatically generating test data

Test Suite

executes

Program Under Test

produces

Results &Traces

statisticalanalysis

SearchAlgorithm

generates

FitnessFunction

uses

updates

CoverageCriterion

srefersrefer

Coverage Info.

Fig. 1 The basic framework for search-based test data generation

123

Arab J Sci Eng (2014) 39:4593–4607 4595

for branch coverage. Experiments on some small programsshowed that GA could usually outperform random algorithmsignificantly. In recent years, McMinn [7] and Harman andMcMinn [8] performed empirical study on GA-based testdata generation for large-scale programs, and validated itseffectiveness over other MHS algorithms.

Another well-known search algorithm is simulated anneal-ing [15], which can solve complex optimization problemsbased on the idea of neighborhood search. Tracey et al. [25]proposed a framework to generate test data based on SAalgorithm. Their method can incorporate a number of test-ing criteria, for both functional and non-functional proper-ties, but their experimental analysis is not sufficient. On theother hand, Cohen et al. [16] adopted simulated annealingtechnique to generate test data for combinatorial testing. Buttheir method is mainly intended for functional testing. In thispaper, we introduce a new emerging algorithm (i.e. PSO) tosettle this problem. In our experimental analysis, we foundthat the test data set generated by GA or SA had lower aver-age coverage than that generated by PSO. Meanwhile, PSOshows relatively faster speed to generate test data than bothGA and SA.

Although GA and SA are classical search algorithms, theirconvergence speed is not very significant. PSO proposed byKennedy and Eberhart [9,10] can overcome this shortcom-ing. Windisch et al. [17] firsT applied a variant of PSO com-prehensive learning particle swarm optimization (CL-PSO)to generate structural test data, but some experiments haveconfirmed that the convergence speed of CL-PSO is perhapsworse than the basic PSO [18]. Meanwhile, their experimentsmainly focused on the artificial test objects. In our experi-ments, we also performed comparison analysis on these twoalgorithms, and results show that the basic PSO is more suit-able for test data generation problem than CL-PSO.

Recently, Chen et al. [19] used PSO to generate test suitefor pairwise testing. Ahmed and Zamli [20] also adopted PSOfor generating variable–strength interaction test suite withsmall size. Their work belongs to the combinatorial testing,which is a kind of functional testing. However, our researchmainly concerns on the perspective of program code-orientedtesting. Furthermore, PSO algorithm has been introduced tosettle some other testing problems, such as regression testing[21] and test case prioritization [22]. In the paper, we willaddress how to utilize the basic PSO algorithm to generatetest data for branch coverage testing, and perform comparisonanalysis on some well-known benchmark programs.

Moreover, our previous work in [11] have presented thebasic idea of applying PSO to generate test data for soft-ware structural testing, and only reported the preliminaryresults. In this paper, the detailed descriptions on some keytechniques such as algorithm process, fitness function con-struction and branch weight estimation have been provided.On the other hand, the experimental analysis on the larger

benchmark program set is also performed. Moreover, morein-depth analysis like impact analysis on population size aswell as statistical analysis on repeated trials is also addressedin detail. Based on these intensive investigations, it is muchclear that PSO algorithm is more suitable to generate struc-tural test cases than GA and SA.

3 Particle Swarm Optimization

PSO is a typical new technique in the field of swarm intel-ligence. It emulates the swarm behavior of insects, ani-mals herding, birds flocking and fish schooling where theseswarms search for food in a collaborative manner.

PSO was first introduced in 1995 by Kennedy and Eber-hart [9], and has been exploited across a vast area of research[23,24]. Although PSO shares some similarities with geneticsearch techniques, it does not use evolution operators such ascrossover and mutation. Each member in the swarm, calleda particle, adapts its search patterns by learning from itsown experience and other members’ experiences. Duringthe iteration process, each particle maintains its own currentposition, its present velocity and its personal best position.The iterative operation leads to a stochastic manipulation ofvelocities and flying direction according to the best expe-riences of the swarm to search for the global optimum insolution space. In general, the personal best position of par-ticle i is denoted by pbesti , while the global best position ofthe entire population is called gbest.

Suppose the population size is s in the D-dimensionalsearch space, a particle represents a potential solution. Thevelocity and position of the dth dimension of the i th particlecan be updated by formulas (1) and (2) [10], respectively.

V di (t) = w · V d

i (t − 1) + c1 · rd1i ·

(pbestd

i − Xdi (t − 1)

)

+ c2 · rd2i ·

(gbestd − Xd

i (t − 1))

(1)

Xdi (t) = Xd

i (t − 1) + V di (t) (2)

where Xi = (X1i , X2

i , . . . , X Di ) is the position of the i th

particle, Vi = (V 1i , V 2

i , . . . , V Di ) represents the velocity of

particle i. pbestdi is the personal best position found by the i th

particle assigned for dimension d, and gbestd is the globalbest position of dimension d. The inertia weight w controlsthe impact of the previous history on the new velocity. Theparameters c1 and c2 are the acceleration constants reflectingthe weighting of stochastic acceleration terms that pull eachparticle toward pbesti and gbest positions, respectively. rd

1iand rd

2i are two random numbers in the range [0, 1]. More-over, a particle’s velocity on each dimension is clamped to amaximum magnitude Vmax.

123

4596 Arab J Sci Eng (2014) 39:4593–4607

The concept of inertia weight is introduced in [10], whichis used to balance the global and local search abilities. Gen-erally speaking, a large inertia weight is more appropriatefor global search, and a small inertia weight facilitates localsearch.

4 PSO-Based Test Data Generation

4.1 Algorithm Description

In the framework of search-based test data generation, it isessentially a cooperation process of MHS algorithm and pro-gram dynamic execution. Once the search algorithm pro-duces a test suite in the search process, it needs to seed theminto PUT and execute program to gather coverage informa-tion. Based on such information, the fitness value of the cor-responding coverage criterion can be calculated. Then, thefitness value is used to adjust the search direction to finda new test suite which can achieve the maximum possiblecoverage. However, the key problem is how to realize theperfect interaction between basic search algorithm and cov-erage information extraction.

The overall algorithm of PSO-based test data generationis graphically represented in Fig. 2, whose execution stepscan be described as follows. At the initialization stage, weencode the argument list arg = (a1, a2, . . . , am) of PUT into

m-dimension position vector. For a given structural coveragecriterion C , such as branch coverage, the fitness functionf (∗) for PSO should be designed. Meanwhile, the initialvalues of f (pbesti ) and f (gbest) are assigned with 0. Tocalculate the fitness of each particle (i.e. test case), we shouldinstrument the PUT (P) to gather the coverage informationabout construct elements. On the other hand, some randomvalues are utilized to initialize the velocity vector V d

i andposition vector Xd

i .In the main part of algorithm, formulas (1) and (2) are

used to determine the current position Xdi and velocity V d

iof particle i at different dimension d, respectively. Then, theposition vector Xd

i of particle i is decoded into a test case.The test case is seeded in PUT to collect execution traceinformation. Subsequently, the fitness f (Xi ) of the test caserepresented by Xi is evaluated. Based on the fitness valueof each particle (i.e. test case), the personal best positionpbesti and global best position gbest can be updated. Thewhole particle evolution process is controlled by the termi-nation condition. For the test data generation problem, ter-mination condition can be one of the following two cases:(1) all construct elements (e.g. branches) have been cov-ered, (2) the maximum evolution generation (maxGen) isreached.

Finally, the particles in the last generation can be decodedinto the set of test cases for PUT. Obviously, the size of testsuite is the pre-set number of particle population.

start

static analysisfor PUT

constructfitness function

instrumentPUT

extractinterface info.

execute PUT withreal parameters

collect coverageinfo.

Testing Perspective

initialize position X, associatedvelocities V, pbest and gbest, set k=0

update Xi and Vi for particlei in each dimension

k >= maxGen or allbranches are covered

pbesti=Xi

stop the search process, andgenerate the final test data set

end

Y

N

reference

decoding

use

PSO Algorithm Perspective

encoding

i=1

fit(Xi)>fit(pbesti)Y

fit(Xi)>fit(gbest)

gbest=Xi

k=k+1

i<n

i=i+1

calculate the fitness ofparticle i

YN

Y

N

Fig. 2 The PSO-based test data generation algorithm

123

Arab J Sci Eng (2014) 39:4593–4607 4597

4.2 Fitness Function

To ensure search algorithm to find a solution satisfying somespecific coverage criterion, coverage information plays animportant role in adjusting search direction. In structural test-ing, the construct elements, such as statements, branches,paths and definition-use pairs, can be treated as coverageobjects. In our study, we mainly consider the widely usedbranch coverage as searching objective. That is to say, theapproving test suite is the one which can traverse all branchesin program code. The branch coverage information is col-lected via the probes which are previously embedded inprogram code. For each branch, a corresponding probe isinstalled to judge whether it has been traversed or not.

In search-based test data generation, fitness function playsan important role for finding the optimal solution, becausethe search algorithm knows nothing but fitness informationduring the search process. In PSO, fitness reflects how goodthe solution of the particle is in relation to the global optimumsolution. In general, the optimal solution can be attained bycomparing the fitness function of each particle in each pop-ulation. In most situations, fitness is measured by decodingthe position vector of program’s arguments to an objectivefunction.

According to the previous testing experience, branch cov-erage in the most cost-effective approach in structural testing.In our work, we adopt the concept of branch distance to con-struct the final fitness function by considering Korel’s andTracey’s work [7,25,26]. In fact, the so-called branch dis-tance is the deviation for a given branch predicate when thevariables are assigned with input values.

In Table 1, the branch functions for several kinds of predi-cates are listed in the third column. Here, the value k (k > 0),refers to a constant which is always added if the term is nottrue. It is not hard to find that, k is used as penalty factor forthe deviation of the real execution branch of a test case fromits expected execution branch. Its value is always added if the

Table 1 The branch functions for several kinds of branch predicates

No. Predicate Branch distance function f (bchi )

1 Boolean If true then 0 else k

2 ¬a Negation is propagated over a

3 a = b If abs(a − b) = 0 then 0 else abs(a − b) + k

4 a �= b If abs(a − b) �= 0 then 0 else k

5 a < b If a − b < 0 then 0 else abs(a − b) + k

6 a ≤ b If a − b ≤ 0 then 0 else abs(a − b) + k

7 a > b If b − a < 0 then 0 else abs(b − a) + k

8 a ≥ b If b − a ≥ 0 then 0 else abs(b − a) + k

9 a and b f (a) + f (b)

10 a or b min( f (a), f (b))

branch predicate is not true. In our experiments, we assign itwith 0.1 through referring the previous studies in [7,25–28].As stated in Table 1, branch distance can be divided into thefollowing three categories: (1) for the atomic proposition,the distance is set to 0 if the proposition is true, otherwise k.(2) For the arithmetic expression or relation expression, sim-ilarly, the distance is 0 if expression’s value is true. Con-versely, the distance is the sum of k and the absolute differ-ence between two operands in the corresponding expression.(3) For the compound logical expression, the branch distanceis also the combination of the distance for basic proposition(i.e., the above two kinds). For the conjunctive logic, the com-bination relation is adding operation. Alternatively, functionmin() is performed for the case of disjunctive logic.

A branch distance function can be constructed for eachbranch predicate in PUT according to the rules in Table 1.Then, the fitness function of the whole program can bedefined by comprehensively considering fitness of eachbranch. Suppose a program has s branches, the fitness func-tion of whole program can be calculated via formula (3).

fitness = 1

/[θ +

s∑i=1

wi · f (bchi )

]2

(3)

where f (bchi ) is the branch distance function for the i thbranch in program, θ is a constant with little value and is set to0.01 in our experiments.wi is the corresponding weight of thei th branch. Obviously,

∑si=1 wi = 1. Generally speaking,

each branch is assigned with different weight according toits reachable difficulty. The calculation method of branchweight will be addressed in next subsection.

Since the covered status of a branch is usually determinedby the test data set, in fact, fitness in formula (3) depends onthe test suite Stc. As a consequence, the optimization objec-tive on test suite Stc can be represented via fitness in ouralgorithm implementation.

4.3 Branch Weight

According to formula (3), we can find that the fitness willcompel search algorithm to spend more effort generating testcases which can cover the branches with high weight. There-fore, it is very important to assign a precise weight to eachbranch in accordance with to its reachable difficulty. Withoutloss of generality, the reachable difficulty of a branch is usu-ally determined by the following two factors: nesting weightand predicate weight.

Generally speaking, the branch in deep nesting level ishard to reach. For branch bchi (1 ≤ i ≤ s), suppose itsnesting level is nli . Then, the maximum and minimum nestinglevels of all branches can be represented as nlmax and nlmin,respectively. Thus, the nesting weight for branch bchi can be

123

4598 Arab J Sci Eng (2014) 39:4593–4607

computed as follows.

wn(bchi ) = nli − nlmin + 1

nlmax − nlmin + 1(4)

Furthermore, this weight can be normalized via formula(5).

wn′(bchi ) = wn(bchi )∑si=1 wn(bchi )

(5)

In general, the nesting level of a branch can be automat-ically analyzed by program static analysis. When nli of thei th branch is yielded, its nesting weight can be calculatedaccording to formulas (4) and (5). It is not hard to find that,the branch in much deeper nesting level will have the greaterweight.

Except for the nesting depth of a branch, the difficulty indegree of satisfying the branch coverage also depends on itspredicate condition. According to the semantic of predicatestatement, we can roughly classify the predicate conditionsinto the following four groups: equation, boolean expression,inequality and non-equation. From the perspective of cog-nitive information, different program constructs will causedifferent difficulties or complexities for comprehension andexecution. At present, the existing researches mainly con-cern on the complexity measurement for different controllogic constructs in program code or process, but the researchon measuring the satisfiability of a given predicate is rel-atively rare. In fact, different types of program predicateswill also cause different difficulties in satisfying it. Roughlyspeaking, a predicate formed by operator ‘>’ or ‘! =’ will beeasier to be satisfied than the predicate with operator ‘==’.Similarly, we classify the usual condition operators into fourcategories shown in Table 2. To determine the satisfactiondifficulty of four condition types (i.e., the reference weightsin Table 2), ten experienced and skilled programmers areconsulted for rating the difficulty coefficients of them, thenthe final weights accordingly established.

The above reference model mainly aims at the case ofbranch predicate with only one condition. However, a branchpredicate may contain several conditions in practice. Thisstructural information can also be automatically achieved viastatic analysis for program code. Here, we assume that branchpredicate bchi (1 ≤ i ≤ s) contains u conditions. For eachcondition c j (1 ≤ j ≤ u), its reference weight wr(c j ) can be

Table 2 The reference weights of predicate conditions

No. Condition type Reference weight

1 = = 0.9

2 <, <=, >, >= 0.6

3 Boolean 0.5

4 ! = 0.2

determined according to Table 2. Thus, the weight of branchpredicate [i.e. wp(bchi )] of bchi can be assigned with valuevia the rules shown in formula (6).

1. If predicate bchi is formed by combining u conditionswith and operation, its predicate weight is square rootof the sum of w2

r (c j ). Generally speaking, the numberof conjunctions in a predicate is not more than four, sowp(bchi ) will <2.0 in most situations.

2. If the condition conjunction is or , the predicate weight isthe minimum element in the set of wr(c j ) (1 ≤ j ≤ u).

wp(bchi )={√∑u

j=1 w2r (c j ), if conjunction is and

min{wr(c j )}, if conjunction is or

(6)

Similarly, the predicate weight of each branch can alsobe normalized as follows.

wp′(bchi ) = wp(bchi )∑si=1 wp(bchi )

(7)

For each branch (a.k.a. predicate) bchi (1 ≤ i ≤ s), itscorresponding weight wi in formula (3) can be viewedas the combination of wn′(bchi ) and wp′(bchi ).

wi = α · wn′(bchi ) + (1 − α) · wp′(bchi ) (8)

where α is an adjustment coefficient, and is set to 0.5 inour experiments.

Here, we introduce a code fragment to demonstrate how tocalculate branch weight. In the example shown in the follow-ing code list, given parameters year and month, methodgetDayNum returns the number of days in such month.Obviously, there are seven branches in the example codefragment. The nesting weight, predicate weight and overallweight for each branch are listed in Table 3.

Table 3 Branch weight calculation for the example program code

Branch wn(bchi ) wn′(bchi ) wp(bchi ) wp′(bchi ) wi

bch1 1/3 1/14√

0.72 0.1120 0.0917

bch2 2/3 1/7√

1.53 0.1632 0.1530

bch3 1 3/14√

2.34 0.2019 0.2081

bch4 1 3/14√

1.57 0.1654 0.1899

bch5 2/3 1/7√

1.53 0.1632 0.1530

bch6 2/3 1/7√

0.76 0.1151 0.1290

bch7 1/3 1/14√

0.6 0.0792 0.0753

123

Arab J Sci Eng (2014) 39:4593–4607 4599

int getDayNum(int year, int month){

int maxDay=0;if( month>=1 && month<=12) //bch1: branch 1{

if(month==2) //bch2: branch 2{

if(year%400==0||(year%4==0&&year%100==0))//bch3: branch 3

maxDay=29;else //bch4: branch 4

maxDay=28;}else if(month==4||month==6||month==9||month==11)//bch5: branch 5

maxDay=30;else //bch6: branch 6

maxDay=31;}else //bch7: branch 7

maxDay=-1;return maxDay;

}

To exhibit the practical application of Eqs. (4)–(8), thefirst (i.e., bch1) and third (i.e., bch3) branches are taken asexamples for detailed analysis. For bch1 denoted in the exam-ple code, its nesting level is 1. Since the maximum nestinglevel in this code fragment is 3, the nesting weight of bch1

is 13 . On the other hand, the predicate of the first branch is

month>=1 && month<=12. According to the referenceweights in Table 2, the weights of conditions month>=1and month<=12 both are 0.6, so the predicate weight ofbch1 can be calculated as

√0.62 + 0.62 = √

0.72 throughapplying Eq. (6).

For the third branch (i.e., bch3), obviously, its nesting levelis 3, so wn(bch3) = 3

3 = 1. It is not hard to find that, ifstatements in the third branch are to be executed, the pred-icate (month>=1 && month<=12) && month==2&& (year%400==0 || (year%4==0 && year%100==0)) should be satisfied ahead. It is should be noted that, ifwe expect a branch in deep nesting level to be satisfied, boththe predicate in its own branch statement and the predicatesin its bypass branches should be considered in our method.According to Table 2 and Eq. (6), we can know that the weightof the partial predicate year%400==0 || (year%4==0&& year%100==0) is 0.9, so the overall predicate weightof bch3 is

√0.62 + 0.62 + 0.92 + 0.92 = √

2.34.After the basic nesting weight and predicate weight of

each branch are achieved, their normalized values can alsobe computed. Finally, as shown in Table 3, the comprehensiveweight of each branch in program code can be calculated inaccordance with Eq. (8).

5 Experimental Analysis

5.1 Experiment Setup

To validate the effectiveness of PSO-based test data gen-eration, we performed experimental analysis on some real-world programs, which are the well-known benchmark pro-grams and have been widely adopted in other researchers’work [27–30]. The details of these programs are shown inTable 4.

The experiment is performed in the environment of MSWindows 7 with 32-bits and runs on Pentium 4 with 2.4 GHzand 2 GB memory. The algorithms are implemented in C++and run on the platform of MS Visual Studio .Net 2010. Inour experiments, we mainly compare GA, SA and PSO forconsidering the ability of test data generation. The commonparameters of these three algorithms are set as follows: thepopulation size (n) is set to 30 for the first six programs, andn = 50 for the last two programs. Meanwhile, punishmentfactor k = 0.1 (cf. Table 1), maxGen and number of runsare both set as 1,000. Other parameters of these algorithmsare shown in Table 5.

Why we have to set different Vmax values for different sub-ject programs? The reason lies in the different input domainsof these programs under test. That is to say, the ranges ofprogram input parameters are different, so the different steplengths have to be performed to realize full traversal withinthe appropriate iterations. Here, we assign the same Vmax tothe same type of input parameters as far as possible.

123

4600 Arab J Sci Eng (2014) 39:4593–4607

Table 4 The benchmark programs used for experimental analysis

Program #Args #Branch LOC Description Source

triangleType 3 5 31 Type classification for a triangle [27–29]

calDay 3 11 72 Calculate the day of the week [27–29]

cal 5 18 53 Compute the days between two dates [30]

remainder 2 18 49 Calculate the remainder of an integer division [28]

computeTax 2 11 61 Compute the federal personal income tax [31]

bessj 2 21 245 Bessel Jn function [28]

printCalendar 2 33 187 Print the calendar of a month in some year [31]

line 8 36 92 Check if two rectangles overlap [28]

Table 5 The parameter settings for three algorithms

Algorithm Parameter Value

GA Selection strategy Gambling roulette

Crossover probability (pc) pc = 0.90

Mutation probability (pm) pm = 0.05

SA Initial temperature T0 T0 = 1.0

Cooling coefficient cα cα = 0.95

PSO Inertia weight w It varies for different programs, but its range is [0.2, 1]

Acceleration constants c1 and c2 c1 = c2 = 2.05

The maximum velocity Vmax Set it according to the input space of the specific program.

Specifically, Vmax = 24 for programs triangleType,

gcd and line, Vmax = 10 for programs calDay, cal

and remainder, Vmax = 1 for program bessj, Vmax

vector (2, 80) for program computeTax, and Vmax

vector (100, 1) for program printCalendar

As stated in Sect. 4.1, each test case is represented as aparticle in PSO algorithm, so the population size is also thecardinal number of test suite. The position vector of a particlestands for the value of the corresponding test case. During theevolution process, particle’s position will adjust according toformulas (1) and (2). Once an evolution step is completed,all position vectors are decoded into test cases, and fitnessof each test case can be evaluated according to formula (3).Subsequently, PSO algorithm will adjust its search directionaccording to the fitness of whole test suite.

5.2 Overall Comparison

In this section, we first compare GA, SA and PSO on theoverall performance for generating test data. With regard tothe effectiveness and efficiency of these three algorithms, thefollowing four issues are adopted as evaluation metrics.

1. Average coverage (AC), i.e. the average of the branchcoverage achieved by all test inputs in 1,000 runs.

2. Success rate (SR), i.e. the probability of all brancheswhich can be covered by the generated test data.

3. Average (convergence) generation (AG), i.e. the averageevolutionary generation for realizing all-branch cover-age.

4. Average time (AT), i.e. the average execution time (ms)for realizing all-branch coverage.

According to the experimental results shown in Table 6,SA and GA have no significant difference for the ability ofgenerating test data, but PSO has the obvious improvement.According to the results, GA has a certain improvement onaverage coverage and success rate than SA for two relativelycomplex programs, i.e. printCalendar and line. Forprogram cal, the AC metric of SA is slightly higher thanthat of GA. However, GA’s success rate oversteps SA about2 %. For the remaining five programs, SA’s metrics (AG andSR) are both higher than those of GA. It should be noted that,either for metric AG or SR, PSO entirely outperforms twoother algorithms.

With regard to the metrics AG and AT (see Table 7), SAand GA have no clear difference w.r.t. metric AG, but SA’sAT has little decrease to the corresponding value of GA. Inother words, both of them need the approximate equivalent

123

Arab J Sci Eng (2014) 39:4593–4607 4601

Table 6 Comparison analysis on metrics AC and SR

Program Average coverage (%) Success rate (%)

SA GA PSO SA GA PSO

triangleType 99.88 95.00 99.94 99.40 76.40 99.80

calDay 99.97 96.31 100.0 99.60 65.00 100.0

cal 99.27 99.02 100.0 96.50 98.70 100.0

remainder 99.85 94.07 100.0 98.60 82.50 100.0

computeTax 94.44 91.51 99.98 88.50 62.80 99.80

bessj 99.45 98.61 100.0 97.40 94.90 100.0

printCalendar 94.31 95.06 99.72 20.10 61.60 99.10

line 82.86 97.43 99.86 62.30 86.90 99.20

Table 7 Comparison analysis on metrics AG and AT

Program Average generation Average time (ms)

SA GA PSO SA GA PSO

triangleType 42.17 13.79 5.36 3.77 10.83 0.19

calDay 28.29 35.80 10.37 1.79 35.73 0.35

cal 10.26 15.24 8.33 0.73 11.41 0.50

remainder 13.66 16.31 5.35 1.01 6.09 0.17

computeTax 19.44 43.00 11.88 1.14 18.28 0.25

bessj 21.13 24.85 9.85 6.10 8.89 0.66

printCalendar 53.60 42.03 12.59 35.38 35.48 1.41

line 21.95 29.62 18.15 11.00 47.65 2.69

AG to achieve full coverage, but the iteration time in a singlestep of SA has a slight advantage to GA. It is worth not-ing that, PSO shows a significant advantage both in AG andAT. Specifically, PSO reduces 61.16 and 58.66 % of averagegenerations of GA and SA, respectively. For another met-ric, i.e. AT, PSO’s performance is especially prominent. Itsvalue is only about 3.8 and 11.1 % to GA and SA in average,respectively.

Therefore, we can draw a conclusion that PSO has obviousimprovement than the traditional algorithms GA and SA forstructural test data generation problem.

5.3 Impact Analysis on Population Size

To deeply investigate the performance of PSO for generatingstructural test data, we also draw on experiments in the dif-ferent population sizes. Since AC and SR have the roughlyconsistent changing trend, and the similar case for AG andAT, we mainly analyze the impact on AC and AG here.

In the experiments, the population size (n) varies from 10to 60 for the first six programs, and n is from 30 to 80 for therelatively complex two programs. While considering the ACtrend vs. population size as shown in Fig. 3, the details canbe stated as follows. For all different population sizes, PSO

can keep the best record of AC metric for almost all subjectprograms.

A unique exception happens in the situation of n = 10 forprogram remainder. In this case, AC of PSO is slightlylower than that of SA, but is still much higher than GA’s.Regarding the changing trend of AC for SA and GA, therelation is basically even between them. A preliminary pat-tern is that, SA outperforms GA on metric AC for relativelysimple programs (see Fig. 3a–f). However, GA is better thanSA for complex programs (see Fig. 3g–h).

According to the results shown in Fig. 3, we can also findthe impacts on AC caused by the change of population size.For the first six programs, PSO can basically achieve full-branch coverage when n reaches to 20. However, SA andGA need much larger size, such as n = 40 or even greater.For the last two programs, PSO needs ∼50 particles to realizefull coverage. Accordingly, the population sizes of SA andGA for covering all branches are nearly close to 80. In aword, PSO-based approach can realize full-branch coveragewith relatively small size of population.

On the other hand, the trends of AG metrics of three algo-rithms caused by the variation in population size are illus-trated in Fig. 4. For programs triangleType, calDay,bessj andprintCalendar, PSO-based approach alwayskeeps the lowest record of AG metric regardless of the changeof population size. For other four programs, the AG of PSOwill be worse than that of SA when the size is small. ButPSO’s AG metric will back to the lowest when n > 45 forprogram line and n > 25 for the remaining three programs.Regarding to the effects of SA and GA, there is no significantdifference between them in our experiments.

According to above analysis, it is not hard to find thatPSO-based approach shows good stability w.r.t. the change ofpopulation size. Meanwhile, this approach also can achievefull coverage and quick convergence speed with very smallpopulation size.

5.4 Statistical Analysis on Repeated Trials

To validate PSO’s advantages to GA and SA from the per-spective of statistical analysis, the experiment on each subjectprogram was repeated 1,000 times. Then, the branch cov-erage information of each program was used for statisticaldifference test. We compare the coverage effect of PSO withthose of GA and SA, respectively. Thus, the following twotypes of null hypotheses can be formed. Here, Wilcoxon–Mann–Whitney rank sum test (or U test) [32] is used as testmethod, R [33] is utilized as the analysis tool for statisticaltest.

H01: PSO is not significantly different to GA with regardto branch coverage?

H02: PSO is not significantly different to SA with regardto branch coverage?

123

4602 Arab J Sci Eng (2014) 39:4593–4607

10 20 30 40 50 600.88

0.9

0.92

0.94

0.96

0.98

1

1.02

population

avg

. co

vera

ge

PSOGASA

(a) (b)

(c) (d)

(e) (f)

(g) (h)

triangleType

10 20 30 40 50 600.7

0.75

0.8

0.85

0.9

0.95

11.025

population

avg

. co

vera

ge

PSOGASA

calDay

10 20 30 40 50 600.65

0.7

0.75

0.8

0.85

0.9

0.95

11.025

population

avg

. co

vera

ge

PSOGASA

cal

10 20 30 40 50 600.4

0.5

0.6

0.7

0.8

0.9

11.025

population

avg

. co

vera

ge

PSOGASA

remainder

10 20 30 40 50 60

0.4

0.5

0.6

0.7

0.8

0.9

11.025

population

avg

. co

vera

ge

PSOGASA

computeTax

10 20 30 40 50 60

0.65

0.7

0.75

0.8

0.85

0.9

0.95

11.025

population

avg

. co

vera

ge

PSOGASA

bessj

30 40 50 60 70 800.8

0.85

0.9

0.95

1

1.025

population

avg

. co

vera

ge

PSOGASA

printCalendar

30 35 40 45 50 55 60 65 70 75 80

0.55

0.6

0.65

0.7

0.75

0.8

0.85

0.9

0.95

11.025

population

avg

. co

vera

ge

PSOGASA

line

Fig. 3 Average coverage (AC) vs. population size

123

Arab J Sci Eng (2014) 39:4593–4607 4603

10 20 30 40 50 600

10

20

30

40

50

60

population

avg

. gen

erat

ion

PSOGASA

10 20 30 40 50 600

10

20

30

40

50

60

population

avg

. gen

erat

ion

PSOGASA

10 20 30 40 50 600

10

20

30

40

50

60

population

avg

. gen

erat

ion

PSOGASA

10 20 30 40 50 600

20

40

60

80

100

population

avg

. gen

erat

ion

PSOGASA

10 20 30 40 50 600

20

40

60

80

100

population

avg

. gen

erat

ion

PSOGASA

10 20 30 40 50 600

10

20

30

40

50

60

population

avg

. gen

erat

ion

PSOGASA

30 40 50 60 70 800

10

20

30

40

50

60

70

population

avg

. gen

erat

ion

PSOGASA

30 40 50 60 70 800

10

20

30

40

50

population

avg

. gen

erat

ion

PSOGASA

(a) (b)

(c) (d)

(e) (f)

(g) (h)

triangleType calDay

cal remainder

computeTax bessj

printCalendar line

Fig. 4 Average convergence generation (AG) vs. population size

123

4604 Arab J Sci Eng (2014) 39:4593–4607

Table 8 p values of hypotheses H01 and H02 for repeated experimentson eight subject programs

Program p value of H01 p value of H02

triangleType 3.784e−12 0.0010150

calDay 1.102e−12 0.0006281

cal 1.167e−08 6.395e−12

remainder 1.140e−12 1.191e−7

computeTax 1.617e−12 1.614e−12

bessj 1.824e−11 0.002035

printCalendar 2.108e−11 2.099e−11

line 8.924e−11 6.097e−12

The results of statistical test are shown in Table 8. Fornull hypothesis H01, i.e. the comparison between PSO andGA, we can find that the p values for all eight programs arefar <0.05. So we can reject H01 and say PSO has significantdifference to GA for the test data generation problem for soft-ware structural testing. On the other hand, for null hypothesisH02, the p values are <0.05, so H02 is also rejected here. Thatis to say, PSO is also significantly different with SA from theperspective of coverage capability.

Apart from the analysis on the significant difference, thestability analysis of each algorithm is also necessary. Gen-erally speaking, an effective algorithm can usually yield theroughly same results in different experiments. Based on theabove 1,000 repeated experiments on each subject program,the main features of each algorithm’s coverage informationare listed in Table 9. According to these statistical results,the failed times of PSO to realize full coverage are extremelysmall. For about half of subject programs, the correspondingtimes are zero. For the remaining programs, the times are<10. On the contrary, the failed times of SA and GA arenot very optimistic, and quite a few surpass 100. From theperspective of the worst coverage in all trials, PSO’s value isalways superior to that of other two algorithms. Therefore,

Table 9 Stability analysis on average coverage (trials η = 1,000)

Program Failed times of full The worst coverage (%)coverage

SA GA PSO SA GA PSO

triangleType 6 236 2 60.00 60.00 80.0

calDay 4 350 0 92.31 76.92 100.0

cal 35 13 0 83.33 27.78 100.0

remainder 14 175 0 90.91 36.36 100.0

computeTax 115 372 2 36.36 63.64 81.82

bessj 26 51 0 78.95 42.11 100.0

printCalendar 799 384 9 84.85 69.70 90.90

line 377 131 8 43.75 68.75 87.50

PSO preserves much greater stability than SA and GA w.r.t.the metric of branch coverage for different trials.

For the metric of AG, its distribution of each program ispresented in Fig. 5. Compared to SA and GA, the medianof PSO’s AGs in 1,000 trials is always less than the corre-sponding values of these two algorithms. In further analy-sis, the AG median of SA is higher than GA’s for programstriangleType and printCalendar, and the oppositesituation for programs calDay and computeTax. More-over, the AG medians of algorithms SA and GA are roughlyidentical for the remaining four programs.

On the other hand, the intervals between the first and thirdquartile of PSO’s AG are always the shortest according to thestatistical results. The first quartile of PSO’s AG is remark-ably steady, and is basically within five generations. Mean-while, the difference of the first quartiles of three algorithmsis relatively minor, even for programs triangleType,computeTax and printCalendar, the disparity is notgreat. On the contrary, the difference of the third quartiles isquite conspicuous. For almost all subject programs, the thirdquartile of PSO’s AG is always <20. For the two complexprograms printCalendar and line, the third quartile of GA’sAG is lower than that of SA. Otherwise, the case is opposite.

According to the above analysis, we can argue that PSOhas significant difference to GA and SA. In another word,it has stronger ability than GA and SA to generate test datawith high coverage. Meanwhile, PSO also demonstrates thestrongest stability for different trials in all three algorithms.For the other two algorithms, GA is better than SA for thecomplicated programs, and SA is suitable for the relativelysimple programs.

5.5 PSO vs. CL-PSO

To compare with the work of Windisch et al. [17], we alsoimplemented CL-PSO to generate test data for these sub-ject programs. As shown in Tables 6, 7 and 10, in terms ofthe covering effect of the generated test data, the basic PSOis slightly better than CL-PSO. Take the metric AC as anexample, PSO’s results surpass the corresponding values ofCL-PSO for all programs, but the over range is not big, aboutseveral percent. However, the discrepancy on the metrics ofaverage generation and average time is very obvious. The AGand AT of PSO are always shorter than those of CL-PSO, andare about 30 and 27 % to CL-PSO’s metrics, respectively.

According to the above results, we can find that the basicPSO can achieve much higher branch coverage than CL-PSO approach, and its convergence speed is also faster thanthe latter. Therefore, compared with the improved versionof PSO, i.e. CL-PSO, the basic PSO is the best option toproduce test data set. Although CL-PSO is very effective forhigh-dimensional optimization problem, yet the dimension

123

Arab J Sci Eng (2014) 39:4593–4607 4605

0

20

40

60

80

100

GA SA PSO

algorithm

gene

ratio

n

0

20

40

60

80

100

GA SA PSO

algorithm

gene

ratio

n

0

20

40

60

80

100

GA SA PSO

algorithm

gene

ratio

n

0

20

40

60

80

100

GA SA PSO

algorithm

gene

ratio

n

0

20

40

60

80

100

GA SA PSO

algorithm

gene

ratio

n

0

20

40

60

80

100

GA SA PSO

algorithm

gene

ratio

n

0

20

40

60

80

100

GA SA PSO

algorithm

gene

ratio

n

0

20

40

60

80

100

GA SA PSO

algorithm

gene

ratio

n

(a) (b)

(c) (d)

(e) (f)

(g) (h)

triangleType calDay

cal remainder

computeTax bessj

printCalendar line

Fig. 5 Stability analysis on average convergence generation (trials η = 1,000)

123

4606 Arab J Sci Eng (2014) 39:4593–4607

Table 10 The experimental results for subject programs via using CL-PSO

Program AC (%) SR (%) AG AT

triangleType 99.88 99.60 33.49 1.08

calDay 97.35 68.50 27.33 1.26

cal 96.85 85.70 51.98 2.62

remainder 100.0 100.0 13.18 0.59

computeTax 98.91 93.00 41.64 0.89

bessj 99.69 96.50 20.34 1.20

printCalendar 93.40 46.80 50.15 8.68

line 98.07 90.00 37.20 6.72

of program’s input space is usually not very high, it showspoor performance for test data generation problem.

6 Concluding Remarks

Software testing is a labor-intensive activity in the whole soft-ware development life cycle, and accounts for nearly a thirdof the cost of the software development. Test data generationis the process of creating a set of data for satisfying a givencoverage criterion. It is an important part of software test-ing, and its primary objective is to generate quality test dataquickly, efficiently and accurately [3]. Until today, how toautomatically generate test data set is still an open problem.

In this paper, we attempt to introduce a new MHS tech-nique, i.e. PSO, to solve this difficulty. At first, we introducethe basic concept of search-based test data generation andPSO technique. Then, the concrete PSO-based algorithm isdeveloped for the practical problem of test data generation.For this problem, a fitness function constructed by cover-ing program elements is treated as optimization objective. Inour work, branch coverage is adopted as coverage criterion.During the search process, PSO algorithm is used to produceprogram input data with the fitness value as high as possible.The coverage information can be collected through executingthe PUT with such input data. Then, the search direction canbe adjusted in the next iteration according to the feedbackof coverage information. The experiments on eight subjectprograms are performed to validate our method and comparewith other’s work.

The results show that our proposed PSO-based methodhas a distinct advantage to the traditional evolutionary algo-rithms like GA and SA. The test suite generated by PSOshows advantages over the same-sized suite generated byGA or SA in terms of average coverage and success rate.The most significant improvement lies in the evaluation met-ric of average time. Specifically, PSO is 28 and 10 timesfaster than GA and SA, respectively. To validate the stabil-ity of PSO-based method, the analysis on varied population

size and analysis on repeated trials have been performed onthe above three algorithms. The results show that PSO-basedmethod exhibits excellent stability for different populationsize or trials. Meanwhile, PSO can achieve full-branch cov-erage with smaller population size and shorter evolution gen-eration than GA and SA. In addition, we also compare thebasic PSO and CL-PSO so as to find which kind of swarmintelligent methods is suitable for test data generation. Thecorresponding result indicates that basic PSO is a preferredchoice.

In future work, some issues should be incorporated intodeep investigation. The search capability of PSO algorithmcould be enhanced through absorbing some other strategiesin intelligent computing. To exploit more reasonable form offitness function is also a valuable research topic. At present,we only display the results of some benchmark programsfrom academe. So the experiments on some industrial pro-grams are worthy of being deeply studied.

Acknowledgments The author would like to express his apprecia-tion to the reviewers for their thoughtful and constructive comments.The author would also like to thank Prof. Francisco Chicano and Dr.Javier Ferrer at University of Málaga in Spain for providing somebenchmark programs for experimental analysis, and thanks Xinxin Yuand Jifu Chen for their suggestions. This work was supported in partby the National Natural Science Foundation of China (NSFC) underGrant Nos. 60803046 and 61063013, the Natural Science Foundationof Jiangxi Province under Grant No. 2010GZS0044, the Science Foun-dation of Jiangxi Educational Committee under Grant No. GJJ10433,the Open Foundation of State Key Laboratory of Software Engineeringunder Grant No. SKLSE2010-08-23, and the Program for Outstand-ing Young Academic Talent in Jiangxi University of Finance and Eco-nomics.

References

1. Cargill, T.: Exception handling: a false sense of security. C++ Rep.6(9), 423–431 (1994). http://www.awprofessional.com/content/images/020163371x/supplements/ExceptionHandlingArticle.html

2. Shafer, D.; Laplante, P.A.: The bp oil spill: could software be aculprit? IT Prof. 12(5), 6–9 (2010)

3. Beizer, B.: Software Testing Techniques, 2nd edn. Van NostrandReinhold Co., New York (1990)

4. Mathur, A.P.: Foundations of Software Testing. Addison-WesleyProfessional, USA (2008)

5. McMinn, P.: Search-based software testing: past, present andfuture. In: Proceedings of ICSE Workshop on the Search-BasedSoftware Testing (SBST’11), pp. 153–163 (2011)

6. Harman, M.: Software engineering meets evolutionary computa-tion. IEEE Comput. 44(10), 31–39 (2011)

7. McMinn, P.: Search-based software test data generation: a survey.Softw. Test. Verif. Reliab. 14, 105–156 (2004)

8. Harman, M.; McMinn, P.: A theoretical and empirical study ofsearch-based testing: local, global, and hybrid search. IEEE Trans.Softw. Eng. 36(2), 226–247 (2010)

9. Kennedy, J.; Eberhart, R.C.: Particle swam optimization. In: Pro-ceedings of IEEE International Conference on Neural Networks(ICNN’95), pp. 1942–1948 (1995)

123

Arab J Sci Eng (2014) 39:4593–4607 4607

10. Shi, Y.; Eberhart, R.C.: A modified particle swarm optimizer. In:Proceedings of the 1998 IEEE International Conference on Evolu-tionary Computation (ICEC’98), pp. 69–73 (1998)

11. Mao, C.; Yu, X.; Chen, J.: Swarm intelligence-based test data gen-eration for structural testing. In: Proceedings of the IEEE/ACIS11th International Conference on Computer and Information Sci-ence (ACIS-ICIS’12), pp. 623–628 (2012)

12. Bertolino, A.; Mirandola, R.; Peciola, E.: A case study in branchtesting automation. J. Syst. Soft. 38(1), 47–59 (1997)

13. Jones, B.F.; Sthamer, H.H.; Eyres, D.E.: Automated structural test-ing using genetic algorithms. Softw. Eng. J. 11(5), 299–306 (1996)

14. Pargas, R.P.; Harrold, M.J.; Peck, R.: Automated structural testingusing genetic algorithms. Softw. Test. Verif. Reliab. 9(4), 263–282(1999)

15. Kirkpatrick, S.; Gelatt, J.C.D.; Vecchi, M.P.: Optimization by sim-ulated annealing. Science 220(4598), 671–680 (1983)

16. Cohen, M.B.; Colbourn, C.J.; Ling, A.C.H.: Augmenting simulatedannealing to build interaction test suites. In: Proceedings of the14th International Symposium on Software Reliability Engineering(ISSRE’03), pp. 394–405 (2003)

17. Windisch, A.; Wappler, S.; Wegener, J.: Applying particle swarmoptimization to software testing. In: Proceedings of the 9thAnnual Conference on Genetic and Evolutionary Computation(GECCO’07), pp. 1121–1128 (2007)

18. Liang, J.J.; Qin, A.K.; Suganthan, P.N.; Baskar, S.: Comprehen-sive learning particle swarm optimizer for global optimization ofmultimodal functions. IEEE Trans. Evol. Comput. 10(3), 281–295(2006)

19. Chen, X.; Gu, Q.; Qi, J.; Chen, D.: Applying particle swarm opti-mization to pairwise testing. In: Proceedings of the 34th AnnualIEEE Computer Software and Applications Conference (COMP-SAC’10), pp. 107–116 (2010)

20. Ahmed, B.S.; Zamli, K.Z.: A variable strength interaction testsuites generation strategy using particle swarm optimization. J.Syst. Softw. 84, 2171–2185 (2011)

21. Kaur, A.; Bhatt, D.: Hybrid particle swarm optimization for regres-sion testing. Int. J. Comput. Sci. Eng. (IJCSE) 3(5), 1815–1824(2011)

22. Hla, K.H.S.; Choi, Y.; Park, J.S.: Applying particle swarm opti-mization to prioritizing test cases for embedded real time soft-ware retesting. In: Proceedings of the 2008 IEEE 8th InternationalConference on Computer and Information Technology Workshops(CITWorkshops’08), pp. 527–532 (2008)

23. Maghsoudi, M.J.; Ibrahim, Z.; Buyamin, S.; Rahmat, M.F.: Dataclustering for the dna computing readout method implemented onlightcycler and based on particle swarm optimization. Arab. J. Sci.Eng. 37(3), 697–707 (2012)

24. Poli, R.: Analysis of the publications on the applications of particleswarm optimisation. J. Artif. Evol. Appl. 2008, 1–10 (2008)

25. Tracey, N.; Clark, J.; Mander, K.; McDermid, J.: An automatedframework for structural test-data generation. In: Proceedings ofthe 13th International Conference on Automated Software Engi-neering (ASE’98), pp. 285–288 (1998)

26. Korel, B.: Automated software test data generation. IEEE Trans.Softw. Eng. 16(8), 870–879 (1990)

27. Alba, E.; Chicano, F.: Observations in using parallel and sequentialevolutionary algorithms for automatic software testing. Comput.Oper. Res. 35, 3161–3183 (2008)

28. Ferrer, J.; Chicano, F.; Alba, E.: Evolutionary algorithms for themulti-objective test data generation problem. Softw. Pract. Exp.42(11), 1331–1362 (2012)

29. Bouchachia, A.: An immune genetic algorithm for software testdata generation. In: Proceedings of the 7th International Confer-ence on Hybrid Intelligent Systems (HIS’07), pp. 84–89 (2007)

30. Ammann, P.; Offutt, J.: Introduction to Software Testing. Cam-bridge University Press, Cambridge, UK (2008)

31. Liang, Y.D.: Introduction to Java Programming, 8th edn. PearsonEducation Inc., USA (2011)

32. Hollander, M.; Wolfe, D.A.: Nonparametric Statistical Meth-ods, 2nd edn. Wiley-Interscience, New York (1999). ISBN 978-0471190455

33. R Development Core Team. R: A Language and Environment forStatistical Computing. R Foundation for Statistical Computing,Vienna (2010)

123