摘要
采用遗传算法求解路径覆盖的测试用例生成问题是软件测试自动化的研究热点。针对传统标准遗传方法搜索测试用例易产生早熟收敛和收敛速度较慢的不足,设计了自适应的交叉算子和变异算子,提高了算法的全局寻优能力。基于动态生成算法框架,通过程序静态分析,考虑了分支嵌套深度的影响,结合层接近度和分支距离法,提出一种新的适应度函数。实验结果表明,该算法在面向路径的测试用例生成上优于传统方法,提高了测试效率。
Using genetic algorithms to solve the problem of generating test cases for path coverage is a hot topic in software testing automation.In view of the problems in traditional standard genetic methods,such as premature convergence and slow search efficiency,this paper designed adaptive crossover operator and mutation operator,thus enhancing the global optimal capability of genetic algorithm.Meanwhile,a new fitness function was introduced to evaluate individuals based on dynamic generation algorithm framework,which combines approach level and branch distance and takes the nesting degree of branches into consideration to compute the fitness values of test data.The experimental results confirm that the proposed improved method is more efficient in generating test cases for path coverage compared with the traditional method.
作者
包晓安
熊子健
张唯
吴彪
张娜
BAO Xiao-an;XIONG Zi-jian;ZHANG Wei;WU Biao;ZHANG Na(School of Information Science and Technology,Zhejiang Sci-tech University,Hangzhou 310018,China;The Graduate School of East Asian Studies,Yamaguchi University,Yamaguchi 753-8513,Japan)
出处
《计算机科学》
CSCD
北大核心
2018年第8期174-178,190,共6页
Computer Science
基金
国家自然科学基金(61502430
61379036
61562015)
浙江理工大学521人才培养计划资助
关键词
软件测试
测试用例生成
遗传算法
适应度函数
Software testing
Test cases generation
Genetic algorithm
Fitness function