引用本文:吴川,巩敦卫,姚香娟.基于分支覆盖的回归测试路径选择.软件学报,2016,27(4):839-854
【打印本页】   【下载PDF全文】   查看/发表评论  【EndNote】   【RefMan】   【BibTex】
←前一篇|后一篇→ 过刊浏览    高级检索
本文已被:浏览 5235次   下载 8096 本文二维码信息
码上扫一扫!
分享到: 微信 更多
基于分支覆盖的回归测试路径选择
吴川1, 巩敦卫2, 姚香娟3
1.中国矿业大学 计算机科学与技术学院, 江苏 徐州 221116;2.中国矿业大学 信息与电气工程学院, 江苏 徐州 221116;3.中国矿业大学 理学院, 江苏 徐州 221116
摘要:
回归测试是迭代式软件开发的重要环节,测试数据生成是回归测试的前提.传统的回归测试方法,从已有的测试数据中选择部分测试数据,并生成一些新的测试数据,以验证程序的正确性.但是,该方法容易生成冗余的测试数据,从而降低了回归测试的效率.研究了回归测试的分支覆盖问题,通过利用已有测试数据的路径覆盖信息,并选择一定个数的路径,以覆盖所有的目标分支.首先,以若干路径形成的集合作为决策变量,以路径最少、覆盖的分支最多以及包含的未覆盖路径最少为目标,建立路径选择问题的3目标优化模型;然后,采用遗传算法求解上述模型时,设计了基于目标重要性的个体评价策略;最后,基于已有的测试数据与选择的路径之间的覆盖关系,确定需要生成的测试数据.将所提方法应用于6个基准工业程序测试中,并与其他方法比较.实验结果表明,采用该方法选择的路径,能够覆盖更多的分支,需要生成的测试数据更少,回归测试消耗的时间更短.
关键词:  回归测试  分支覆盖  路径选择  多目标优化  遗传算法
DOI:10.13328/j.cnki.jos.004975
分类号:
基金项目:国家自然科学基金(61375067,61203304,61573362);江苏省自然科学基金(BK2012566);中央高校基本科研业务专项基金(2012QNA41)
Selection of Paths for Regression Testing Based on Branch Coverage
WU Chuan1, GONG Dun-Wei2, YAO Xiang-Juan3
1.School of Computer Science and Technology, China University of Mining and Technology, Xuzhou 221116, China;2.School of Information and Electrical Engineering, China University of Mining and Technology, Xuzhou 221116, China;3.College of Science, China University of Mining and Technology, Xuzhou 221116, China
Abstract:
Regression testing is an important part of the iterative software development, and test data generation is the premise of regression testing. Traditional regression testing methods select a part of test data from existing ones, and generate a number of new test data, so as to verify the correctness of a program. However, these methods are prone to generate redundant test data, therefore reducing the efficiency of regression testing. This paper researches the problem of branch coverage for regression testing, makes full use of information on the path coverage from existing test data, and selects a certain number of paths to cover all the target branches. First, taking a set consisting of several paths as the decision variable, the least number of paths, the largest number of covered branches, and the least number of uncovered paths as the objectives, a 3-objective optimization model for the problem of selecting paths is established. Then, a strategy of evaluating an individual based on the importance of an objective is designed in solving the above model using genetic algorithm. Finally, test data required to generate is determined according to the relation between existing test data and the selected paths. The proposed method is applied to test six benchmark and industrial programs, and compared with other regression testing methods. The experimental results show that paths selected by the proposed method can cover more branches, with fewer test data required to generate and less time consumption for regression testing.
Key words:  regression testing  branch coverage  path selection  multi-objective optimization  genetic algorithm