摘 要: 针对检测缺陷的测试数据生成效率低下问题,提出变异测试和路径覆盖测试技术结合的测试数据生成方法。首先,采用变异测试技术生成的变异分支融入程序,生成新的被测程序;然后,在原路径集中挑选目标路径,通过分析变异分支与路径关联关系,将变异分支融入路径。最后,基于遗传算法生成覆盖路径的测试数据。实验结果表明,多种群遗传算法生成测试数据的时间,比单种群遗传算法节约了41.15%。由此可见,对于覆盖多路径测试数据生成,多种群遗传算法的效率比单种群遗传算法高。 |
关键词: 软件测试;变异测试;测试数据生成;遗传算法 |
中图分类号: TP311
文献标识码: A
|
基金项目: 江苏省高等学校自然科学研究重大项目(21KJA520006);徐州市科技计划项目(KC21007). |
|
An Evolutionary Generation Method for Path Coverage Test Data based on Mutation Testing |
DANG Xiangying, LI Jinfeng
|
(School of Information Engineering, Xuzhou University of Technology, Xuzhou 221018, China)
dangpaper@163.com; 41407770@qq.com
|
Abstract: Aiming at the low efficiency of test data generation for defect detection, this paper proposes a test data generation method combining mutation testing and path coverage testing. Firstly, the mutation branches generated by mutation testing technology are incorporated into the original program to generate a new program under test. Then, some paths of the original program are selected as the target paths, and the mutation branches are integrated into the target path by the correlation between mutation branches and paths. Finally, Test results show that the time of generating test data by Multi Population Genetic Algorithm (MGA) is 41.15% less than that by Single Population Genetic Algorithm (SGA). It can be seen that the efficiency of MGA is higher than that of SGA for test data generation of multi-path coverage. |
Keywords: software testing; mutation testing; test data generation; GA |