高级检索
王雅文, 宫云战, 肖庆. 基于区间必然集的测试用例生成方法[J]. 计算机辅助设计与图形学学报, 2013, 25(4): 550-556,563.
引用本文: 王雅文, 宫云战, 肖庆. 基于区间必然集的测试用例生成方法[J]. 计算机辅助设计与图形学学报, 2013, 25(4): 550-556,563.
Wang Yawen, Gong Yunzhan, Xiao Qing. A Method of Test Case Generation Based on Necessary Interval Set[J]. Journal of Computer-Aided Design & Computer Graphics, 2013, 25(4): 550-556,563.
Citation: Wang Yawen, Gong Yunzhan, Xiao Qing. A Method of Test Case Generation Based on Necessary Interval Set[J]. Journal of Computer-Aided Design & Computer Graphics, 2013, 25(4): 550-556,563.

基于区间必然集的测试用例生成方法

A Method of Test Case Generation Based on Necessary Interval Set

  • 摘要: 针对自动化单元测试中面向路径的测试用例生成问题,通过改进传统的基于符号执行的测试用例生成方法,提出"符号化区间"来表示和分析变量的静态取值范围,并给出简单表达式和逻辑表达式中"区间可能集"和"区间必然集"的计算方法.提出了面向路径的值区间分析算法,通过对给定路径进行前向数据流分析来计算各条边上的区间上下文环境以及各符号的必然取值区间,在路径出口处的符号值区间必然集中任意取值,可得到覆盖给定路径的测试用例.与基于约束求解的传统方法相比,文中方法省去了表达式变换及调用约束求解器的过程,对输入变量弱关联的情况能够快速、准确地生成测试用例.

     

    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.

     

/

返回文章
返回