Font Size: a A A

Research On Test Case Generation Based On Particle Swarm Optimization

Posted on:2019-08-31Degree:MasterType:Thesis
Country:ChinaCandidate:D J LiFull Text:PDF
GTID:2428330548995008Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
With the advancement of modern technology and the rapid development of computers,a great variety of computer software has become a necessity in daily life.As a result,people attach great importance to the quality of software which is often used every day.Software testing is an important technical means to test the quality of software,and the design of test case is the core difficulty and an important part of software testing.Test case which is generated automatically can greatly improve the efficiency of software testing,and can save a lot of manpower and material resources.Therefore,the research subjects of automatic test case generation is of great theoretical value and practical significance.It is necessary to transform the problem of automatic test case generation into an optimization problem by constructing an effective fitness function.Then,intelligent search algorithm is an efficient way to solve an optimization problem.In this paper,the Particle Swarm Optimization(PSO),which has the advantages of few parameters,simple concepts and easy implementation and is one of intelligent search algorithm,is selected to solve the problem.In order to overcome the problem of slow convergence rate and easy to fall into local optimum in the PSO algorithm,this paper analyzes and optimizes the PSO algorithm,and applies the improved algorithm to improve overall efficiency of automatic test case generation.The main work includes the following two parts :(1)Firstly,the inertial weighting factor of the PSO algorithm is researched and analyzed,an dynamic adjustment strategy of inertia weighting based on exponential transformation which considers the fitness of all particles in the population and introduces random factors of population is proposed to ensure the diversity of algorithm;Secondly,the research and analysis of the PSO algorithm show it is easy to fall into the local optimum when solving the high-dimensional multi-modal function optimization.An mutation strategy of repairing algorithm is introduced to recalculate the new velocity values for the individuals with the worst fitness to guide the population to jump out of the local optimum.Based on the above two improvements,a novel variant PSO algorithm with exponential inertia weight(Exponentia Inertia Weight in Particle Swarm Optimization,EIW-PSO)is proposed.Finally,the experimental results show that the EIW-PSO algorithm which the convergence speed is faster and the solution accuracy is higher,improves the overall performance of the PSO.(2)Firstly,a new fitness function construction method is proposed to effectively combine the PSO algorithm and the problem of automatic test case generation.According to the branch coverage criterion,the branch weight factor is introduced to give different weights to each branch so that the fitness value obtained from the test cases is more accurate;Then,the proposed EIW-PSO algorithm is applied to the generation of test cases,and the overall framework of the test case generation algorithm based on EIW-PSO is proposed;Finally,the experimental results show that the proposed method can achieve the highest branch coverage with the fastest speed,and the algorithm which can effectively achieve the full coverage of the program branches has strong stability in the process of convergence.
Keywords/Search Tags:Particle swarm optimization, Inertia weight, Test case generation, Fitness function
PDF Full Text Request
Related items