摘要
回归测试就是验证对程序的修改是否达到了预期的目的,同时检查修改是否损害了程序原有的正常功能。随着程序新版本的不断推出,测试用例集不断扩大,回归测试成本越来越高。测试用例最小化就是从已有的用例集中,找到一个测试运行代价最小的用例子集用于回归测试,并保持原来的测试覆盖率。本文主要研究用遗传算法解决测试用例最小化问题:基于测试历史数据,设计基因编码并构建初始种群;利用测试覆盖率和测试运行代价设计适应度函数;通过遗传算子完成进化过程并找到最优或近似最优解。最后本文给出了对算法进行实例研究的结果。结果表明,本文提出的用例最小化技术能有效缩减回归测试用例集,大幅度降低回归测试费用。
Regression testing is an expensive process used to revalidate the modified program. As the software is modified and new test cases are added to the test suite, the test suite grows and the cost of regression testing increases. Regression test-suite minimization techniques attempt to reduce the cost of regression testing by identifying a minimized test-suite that provides the same coverage of the software according to some criterion as the original test-suite. This paper investigates the use of an evolutionary approach, called genetic algorithms, for test-suite minimization. The algorithm designs the gene codes of the individuals and builds the initial population based on the test history, calculates the fitness value of each individual using coverage and cost information, and then selectively breeds the successive generations using genetic operations. This generational process is repeated until a minimized test-suite is founded. Finally, some results of studies of this minimization algorithm are presented. The results show that, genetic algorithms can significantly reduce the size and the cost of the test-suite for regression testing, and achieves good cost-effectiveness.
出处
《计算机科学》
CSCD
北大核心
2007年第1期285-288,F0004,共5页
Computer Science
基金
国家自然科学基金资助项目(60073027)
浙江省教育厅科研基金(119034031)
浙江财经学院二○○五年度重大科研课题(YJZ0505)