Font Size: a A A

Test Case Generation Based On Particle Swarm Optimization

Posted on:2016-04-01Degree:MasterType:Thesis
Country:ChinaCandidate:L S WangFull Text:PDF
GTID:2308330479486046Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
Software testing plays a vital role in the whole software development cycle, and it is an important part to ensure the quality of software. Traditional method of software testing designs test cases manually, which not only consumes a lot of time, but also may miss some cases. The technology of test case generation can generate test cases automaticly, which can reduce the resources of human, money and time in the process of software development. Therefore, it is important to study the subject of software tesing.Search-based test case generation transforms the problem of test case generation into a problem of function optimization by fitness function. Then the heuristic search algorithm solves the problem of function optimization, so it is vital to select the heuristic algorithm. Particle swarm optimization as one of heuristic algorithms, has been widely applied in test case generation, since it is simple and effective, and it has a strong robustness. Therefore, the subject of this paper is test case generation technology based on particle swarm optimization. Focused on this subject, our work is as follows:(1) The mechanism of orthogonal exploration is introduced in the process of test case generation base on particle swarm optimization. Orthogonal exploration uses singular value decomposition to estimate the evolution direction of the population, driving the population towards orthogonal direction, so that our method can avoid searching those traversed areas so far and jump out of local optimum. Futhermore, the velocity is changed so that it is able to be consistent with the orthogonal direction, and as a result, the population can be affected continually, which can decrease the frequency of singular value decomposition and reduce the time consumption.(2) The local search strategy is used in the process of test case generation base on particle swarm optimization. The best particle in each generation is searched by alternating variable method. As a result, this algorithm enhances its local search ability, and particle swarm optimization enhances its global search ability, which makes coordination of the global search and local search ability, so as to improve the efficiency of test case generation. The experimental results show that our method has advantages in coverage and the number of generations.(3) Some branches can not be evaluated completely by fitness function due to the complex structure of the program. To solve the problem, this paper presents a definition called “schema” for the branches those are able to improve the fitness value, but can’t be evaluated by fitness function. Firstly, we obtain the branch function of the schema. Then we find the individual that has the minimum value of branch function of the schema, and the individual is said to contain the best schema. Furthermore, we design a crossover operator, which view each best schema as a whole and combine all the optimal schemata into a single individual. So that our crossover not only can prevent schemata destroyed in the process of evolution, but also can accelerate the evolution process, because other individuals learn to the optimal individual, improving the efficiency of test case generation.(4) This paper designs and implements a Java-based platform for test case generation, which is called TCGPSO. The platform is able to apply all the programs under test referred in our work. Futhermore, the parameters in our algorithms are able to be set to various values flexibly, and the output information can be collected and processed in various forms.
Keywords/Search Tags:Software testing, Test case generation, Particle swarm optimization, Local search strategy, Crossover operator
PDF Full Text Request
Related items