Font Size: a A A

One Test Case Generation Method Based On PSO

Posted on:2021-03-21Degree:MasterType:Thesis
Country:ChinaCandidate:J WuFull Text:PDF
GTID:2428330602988599Subject:Software engineering
Abstract/Summary:PDF Full Text Request
With the development of the times and the development of the science and technology,computers are more and more infiltrated into people's lives,and software is constantly updated.People pay more and more attention to the quality requirements of software when using software.Software testing work in the software development cycle plays a role in testing the quality of the software to be tested.To a certain extent,software testing work ensures the quality of the software.When testing the software,the tedious test case assembly makes the efficiency of testing work become low,so it can generate simple and efficient test cases automatically,which can greatly improve the efficiency of testing work The efficiency of software testing saves manpower and material resources.In order to solve the problem of automatic generation of test cases,an effective fitness function is constructed to transform it into a function optimization problem,and then an efficient intelligent search algorithm is selected to solve the problem of automatic generation of test cases.This paper select the particle swarm optimization(PSO)algorithm which is one of the intelligent search algorithm.The reason why choose PSO isthat the parameters of the algorithm are few,there is no complex process of cross mutation in the genetic algorithm,and the implementation is relatively simple,so PSO algorithm is used to generate test cases in this paper.But the traditional PSO(particle swarm optimization algorithm)has some shortcomings,such as easy to fall into local convergence,slow convergence speed and so on.In order to optimize the current particle swarm optimization algorithm,which is easy to sink into the defects of local optimization and slow convergence in the later stage,this paper proposes a method to improve the inertia weight parameters to optimize the algorithm.Among them,the operation of mutation operator in differential evolution algorithm is combined to improve the algorithm's adaption,and cosine function is added to inertia weight parameter,so that it can produce a periodic oscillation effect when the algorithm is running,no longer as a fixed value as output,and the algorithm's speed and search space are limited to prevent particles from jumping out of the specified search space And stable particle speed to ensure the efficiency of the algorithm.Select the corresponding test function,and the Matlab software is used to compare the improved optimization algorithm with the other two algorithms.The results indicate that the particle swarm optimization algorithm proposed which is proposed in this paper has a certain improvement in the later convergence speed and the stability of thefitness value.For the combination of test case generation and particle swarm optimization,fitness function is proposed as a bridge between them,and a pile function based on branch coverage criterion is proposed.The fitness function is designed by branch distance method,and branch weight is introduced.Each branch has different weight values.The fitness value corresponding to test case is more accurate,and Improved particle swarm optimization algorithm based on dynamic adjustment of inertia weight is applied to test case generation,and an overall framework of the algorithm is used to intuitively understand the algorithm flow.Finally,experiments show that the test data generated by particle swarm optimization algorithm based on dynamic adjustment of inertia weight can achieve full coverage of program branches and improve the effectiveness.
Keywords/Search Tags:PSO, differential evolution, fitness, test case
PDF Full Text Request
Related items