| The stages of testing the basic units of the software at each stage of the software testing activity are unit testing,which is the lowest level of testing activity in the software development process and is the basis for software testing.Unit testing ensures the quality of the basic units in the early stages of software testing and lays a solid foundation for subsequent integration test activities and system test activities.It can prevent a large number of bugs in the late software testing and cause a lot of rework so that the cost of software development and time will be out of control.Therefore,the research on unit testing is valuable in practice.With the rapid development of computer science and technology,the demand for software is growing exponentially,and the size and structure of the monomer also become too large and complex.Traditional manual testing has been unable to meet the needs of the testing activities.At present,a number of unit testing automation technologies are emerging,but all kinds of unit testing automation technologies have their own flaws.This paper focus on the problem that the symbol execution technology can not effectively test the path of non-linear relationship in the field of unit testing.This paper introduces the research background,significance and research status of unit testing,as well as the basic principles of unit testing,common unit test case generation method,symbol execution technology and ant colony algorithm and other related basic theories.Furthermore,it expounds the key to the implementation of symbols,which is the constraint solving technique.At the same time,the paper analyzes the specific reasons that the symbol execution technique can not be tested for the existence of non-linear path.On this basis,the paper introduces a method to compensate for some kind of loopholes in the application of unit testing through improved ant colony algorithm.The loopholes refers to the inability to cover the path that have the branches with nonlinear constraints in the tested program.Firstly,using symbol implementation technique to collect the constraint relations in the path branch which can not be covered and transform these constraint relations into multi-objective optimization problem.Secondly,based on the multi-objective optimization feature of ant colony algorithm,the nonlinear equations can be solved and then the optimal solution is obtained.Then,inorder to improve the accuracy of the optimal solution,using quasi-Newton algorithm to optimize the optimal solution.Finally,the test cases of paths which contain the non-linear relationship branch and the symbol execution technique are combined to get the test case collection.In this paper,the traditional triangular problem and the new triangular problem are used as the experimental test program to test,and the results are compared to verify the feasibility of the proposed method. |