Abstract:
Aiming at path-oriented test generation in automatic unit testing, this paper improves the classic test generation method based on symbolic execution, proposes the symbolic interval to describe and analyze the range of variable value, and gives the computing method of possible interval set and necessary interval set of variable value in different condition expressions.Then, the paper designs a new path-oriented interval analysis algorithm using the forward data-flow analysis.Choosing value from the necessary interval set of symbolic variable on the path exit, the test case can be obtained.Compared to the classic method which is always dependent on constraint solver, this new method omits the steps of expression conversion and constraint solving, and it can generate test case appropriately and efficiently in case of the weakly relevant input.