Software testing as an essential approach to guarantee software quality has penetrated into the whole process of software development.Among them,the cost of software testing accounts for more than 50% of the total cost of development cost.How to detect the most system failures with fewer test cases is a key issue in software testing research.The combination testing as a functional testing method,it can generate fewer test case that can detect system faults caused by interactions between factors while ensuring error detection capability.However,the generation of the minimum test case set is still an NP-hard problem in the combination testing.As a kind of swarm intelligence algorithm,particle swarm optimization algorithm is used to generate a minimum set of test cases due to its fast convergence,simple evolution process,and versatility.However,the algorithm has the problems of premature convergence to local extremum and low search accuracy when searching for the optimal solution.Therefore,this paper solves the problems of particle swarm optimization algorithm,improves the efficiency of generating test cases,and reduces the scale of test case sets by improving the particle swarm optimization algorithm.The main contributions of this paper are listed as follows:(1)To solve the problem of high possibilities of being trapped in local optimum in particle swarm optimization algorithm,the Reduced Adaptive Particle Swarm Optimization Algorithm(RAPSO)is applied to generate the combination testing cases.Firstly,the evolutionary equations of the particle swarm optimization algorithm is simplified by removing velocity of particle,so the algorithm completes the evolution process only rely on the position update,which can avoid the error caused by artificially setting the particle velocity and improve the convergence speed of PSO algorithm.Then,we adopt an adaptive adjustment scheme of inertia weight in the process of algorithm evolution,which can effectively avoid the premature convergence of the algorithm to the local extremum when searching for the optimal solution.(2)In order to generate a smaller set of test cases,this paper improves the inertia weighting strategy and fitness function of the reduced particle swarm optimization algorithm.According to the RAPSO algorithm only through the particle positive update completes the evolution process,this paper proposes a method to adaptively adjust the value of inertia weight based on the distance between the current particle and the optimal particle,and dynamically adjust the relationship between particle local search and global search.This strategy can dynamically adjust the search range of particles and improve the search ability of RAPSO algorithm.In order to evaluate the relationship between the currently generated test cases and the generated test cases,the Hamming distance is introduced in the fitness function.We can select the test case with the smallest Hamming distance as the optimal test case to improve the possibility of generating the minimum test case set.(3)To verify the effectiveness of our methods,we adopt 21 matrices with arbitrary coverage strength to analyze the two methods,and compares our methods with several classical algorithms.The experimental results show that the two methods can process the coverage matrix with arbitrary intensity and generate a smaller set of test cases. |