摘要
在软件测试自动化领域关于路径覆盖的测试用例生成方法一直是研究热点,传统通过构造新适应度函数的遗传算法要求每次迭代过程重新计算适应度函数,增加了计算量,因此提出一种基于分支进化理论的路径测试用例生成方法。首先计算基本路径集中所有节点的节点复杂度,考虑节点到分支的分支复杂度并改进适应度函数,同时根据节点复杂度对目标路径进行排序;使用遗传算法生成覆盖目标路径的测试用例时,当子种群覆盖当前目标路径后,根据目标路径距离继续覆盖其他路径。实验结果证明,该方法相比于现有的其他算法,在评价次数和运行时间方面有显著改善。
In the field of software test automation,the method of generating test cases about path coverage has always been a research hotspot.The traditional genetic algorithm,which constructs a new fitness function,requires the fitness function to be recalculated in each iteration pro⁃cess,which increases the amount of calculation.Therefore,a path test case generation method based on branch evolution theory is proposed.First calculate the node complexity of all nodes in the basic path set,consider the branch complexity from the node to the branch and improve the fitness function,and sort the target path according to the node complexity;when using the genetic algorithm to generate test cases covering the target path,after the subpopulation covers the current target path,it continues to cover other paths according to the distance of the target path.The experimental results show that the method has a significant improvement in evaluation times and running time compared with other existing algorithms.
作者
魏雄
李莉
WEI Xiong;LI Li(School of Computer and Artificial Intelligence,Wuhan Textile University,Wuhan 430200,China)
出处
《软件导刊》
2023年第8期117-123,共7页
Software Guide
关键词
测试用例生成
路径覆盖
遗传算法
分支进化
目标路径距离
test case generation
path coverage
genetic algorithm
branch evolution
target path distance