首页 | 本学科首页   官方微博 | 高级检索  
     

一种基于改进遗传算法的路径测试用例生成方法
引用本文:包晓安,熊子健,张唯,吴彪,张娜.一种基于改进遗传算法的路径测试用例生成方法[J].计算机科学,2018,45(8):174-178, 190.
作者姓名:包晓安  熊子健  张唯  吴彪  张娜
作者单位:浙江理工大学信息学院 杭州310018,浙江理工大学信息学院 杭州310018,浙江理工大学信息学院 杭州310018,山口大学东亚研究所研究生院 山口753-8513,浙江理工大学信息学院 杭州310018
基金项目:本文受国家自然科学基金(61502430,61379036,61562015),浙江理工大学521人才培养计划资助
摘    要:采用遗传算法求解路径覆盖的测试用例生成问题是软件测试自动化的研究热点。针对传统标准遗传方法搜索测试用例易产生早熟收敛和收敛速度较慢的不足,设计了自适应的交叉算子和变异算子,提高了算法的全局寻优能力。基于动态生成算法框架,通过程序静态分析,考虑了分支嵌套深度的影响,结合层接近度和分支距离法,提出一种新的适应度函数。实验结果表明,该算法在面向路径的测试用例生成上优于传统方法,提高了测试效率。

关 键 词:软件测试  测试用例生成  遗传算法  适应度函数
收稿时间:2017/6/23 0:00:00
修稿时间:2017/9/6 0:00:00

Approach for Path-oriented Test Cases Generation Based on Improved Genetic Algorithm
BAO Xiao-an,XIONG Zi-jian,ZHANG Wei,WU Biao and ZHANG Na.Approach for Path-oriented Test Cases Generation Based on Improved Genetic Algorithm[J].Computer Science,2018,45(8):174-178, 190.
Authors:BAO Xiao-an  XIONG Zi-jian  ZHANG Wei  WU Biao and ZHANG Na
Affiliation:School of Information Science and Technology,Zhejiang Sci-tech University,Hangzhou 310018,China,School of Information Science and Technology,Zhejiang Sci-tech University,Hangzhou 310018,China,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 and School of Information Science and Technology,Zhejiang Sci-tech University,Hangzhou 310018,China
Abstract: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.
Keywords:Software testing  Test cases generation  Genetic algorithm  Fitness function
点击此处可从《计算机科学》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号