Unit testing method based on automatic generation of path coverage test cases
Abstract:
The present invention provides a unit testing method based on automatic generation of path coverage test cases. First, obtain a control flow graph of a program to be tested is obtained. Then, an executable code is executed in the generated control flow graph based on of an automatically generated test case, and meanwhile, a fitness value is calculated and acquired based on of an execution result of the executable code, and a sub-node is selected to continue repeating the above process, until a terminal node in the control flow graph is found, and finally a path marker is generated and the fitness value corresponding to the path is obtained. Then, an automatic test case generation algorithm is executed, and the algorithm constantly automatically generates test cases based on of the returned fitness value, and exits when the path is completely covered, or a set execution is timed out.
Information query
Patent Agency Ranking
0/0