| Regression testing is frequently used in the whole process of software development to maintain good software quality, which has brought the enormous consumption of resources. Therefore, how to effectively carry out regression test suite optimization has caused widespread concern and become a research hotspot. At present, the research method of regression testing is to select a subset from the original test suite which can meet all test requirements mainly by using some optimization algorithms or interactive strategy, in order to lower the original test suite size and reduce resource consumption. Although the use of above methods to optimize regression test suite has achieved certain results, many researches are only limited to the simulation environment, nowhere near meeting the actual needs of software testing. So, how to optimize regression test suite for the real software testing environment still needs further research and in-depth discussion.The optimization technique presented in this paper is test suite minimization. Considering the different test case running cost and testing requirements importance in actual software testing environment, aiming at the problem of combinatorial optimization, an improved genetic algorithm is designed in this paper to solve the optimization problem.Genetic algorithm has a good effect in solving combinatorial problems, but at the same time, the algorithm has several shortcomings like premature convergence, loss gene easily during evolution. The improved algorithm designed in this paper can effectively overcome these shortcomings, the main thoughts and process: Firstly, the improved algorithm structures gene codes of the individuals and sets the initial population based on the test case code coverage, devises the fitness function by combing with the weight of test requirement, code coverage rate and execution cost of test suite. Then, the algorithm puts forward improvement strategy on selection operator, in order to ensure the diversity of population and individual, reduce redundancy degree; improves the single point crossover operation of crossover operator, in order to delete the redundant genes, prevent gene duplication and loss. At the same time, this paper also proposes the adaptive crossover probability algorithm, which can effectively avoid the genetic algorithm falling into a local optimum at early stage and improve the convergence speed at late stage of genetic algorithm. Finally, the improved genetic algorithm and the canonical genetic algorithm are respectively applied to test suite minimization problem and through the simulation to experiment. Comparison of results shows that the improved genetic algorithm is much better than canonical genetic algorithm, which not only can reduce the original test suite size, can also reduce the consumption of resources and execution costs. |