摘要
在软件测试中,构造测试用例是非常重要的一环.传统的测试用例生成方法都由测试人员手动完成,这种生成方式效率低下成本高昂,同时生成的测试用例非常有限,覆盖率较低.首先探讨了通过约束求解的方法,通过分析程序路径中所有的约束表达式,逆推得到测试用例的过程;然后调查了不同类型的C语言工程的待测源码的统计结果,同时针对其特征,引入了不同的约束求解算法策略;最后通过各种策略的组合与配置,给出了一种具有普遍性的测试用例自动生成的约束求解方法.
Test case generation is an important process in software testing.The traditional work to generate a group of test cases is all done by manpower.However,the traditional method can only get few test cases and reach very low coverage,but costs a lot of time and resources.A method to generate test cases through constraint programming is put forward.All constraint expressions in one path of a program is analyzed,then test cases from constraint expressions are generated through several mathematic algorithms.Some softwares written in C are investigated,the statistic rules of constraint types are summarized.Finally,an optimized process to generate test cases using constraint programming is concluded.
出处
《内蒙古大学学报(自然科学版)》
CAS
CSCD
北大核心
2011年第5期540-546,共7页
Journal of Inner Mongolia University:Natural Science Edition
基金
国家自然科学基金项目(91018002)
关键词
软件测试
测试用例
约束求解
覆盖测试
software testing
test case
constraint programming
coverage testing