电子学报 ›› 2020, Vol. 48 ›› Issue (7): 1330-1342.DOI: 10.3969/j.issn.0372-2112.2020.07.011

• 学术论文 • 上一篇    下一篇

基于蚁群算法的多路径覆盖测试数据生成

廖伟志, 夏小云, 贾小军   

  1. 嘉兴学院数理与信息工程学院, 浙江嘉兴 314001
  • 收稿日期:2018-09-13 修回日期:2019-04-16 出版日期:2020-07-25 发布日期:2019-09-24
  • 作者简介:廖伟志 男.1974年1月出生,广西凤山人.博士、教授、硕士生导师.主要从事软件测试、计算智能方面的研究工作.E-mail:1507715916@qq.com;夏小云 男.1982年10月出生,江西南昌人.博士、副教授、硕士生导师.主要从事计算智能、机器学习方面的研究工作.E-mail:scutxxy@gmail.com
  • 基金资助:
    国家自然科学基金(No.61703183,No.61773410);浙江省公益技术应用研究计划(No.LGG19F030010,No.LGG20F010010);嘉兴市公益性研究计划(No.2018AY11008)

Test Data Generation for Multiple Paths Coverage Based on Ant Colony Algorithm

LIAO Wei-zhi, XIA Xiao-yun, JIA Xiao-jun   

  1. College of Mathematics Physics and Information Engineering, Jiaxing University, Jiaxing, Zhejiang 314001, China
  • Received:2018-09-13 Revised:2019-04-16 Online:2020-07-25 Published:2019-09-24

摘要: 为了提高多路径覆盖测试数据的生成效率,研究了一种基于蚁群算法的多路径覆盖测试数据生成方法.首先给出蚁群算法的一种改进方法,该算法以蚂蚁对生成测试数据的重要性作为蚂蚁状态转移和蚂蚁路径变异的依据,以引导更多蚂蚁穿越小概率节点,提高测试数据生成效率.其次,根据改进的蚁群算法分别提出了基于单信息素表和多信息素表的多路径覆盖测试数据生成方法.在基于多信息素表的方法中,每条目标路径的信息素表均被用于其它路径测试数据的求解,而且蚁群算法运行一次即可求解多条目标路径的覆盖测试数据.最后对所提出方法的有效性和复杂度进行了理论分析.实验结果表明,与其它方法相比,基于多信息素表的测试数据生成方法能够有效地生成多路径覆盖测试数据.

关键词: 测试数据生成, 蚁群算法, 多路径, 路径覆盖, 蚂蚁珍贵度

Abstract: In order to improve the generation efficiency of multipath coverage test data,a novel method is proposed based on ant colony algorithm (ACO).Firstly,an improved ACO is developed.The importance of an ant to generate test data is considered as a factor for ant state transfer and path mutation.As a result,more ants are guided to traverse small probabilities node and the efficiency of test data generation is improved.Secondly,according to the improved ACO,test data generation of multipath coverage based on single pheromone table and multiple pheromone tables are proposed.In a multiple pheromones table based approach,the pheromone table of each target path is also used to generate test data for other target path,and the test data of multiple paths are generated by running ACO only once.Finally,the effectiveness and complexity of the proposed method are analyzed theoretically.Experimental results show that test data generation based on multi-pheromone tables can effectively generate multipath coverage test data compared with other methods.

Key words: test data generation, ant colony algorithm, multiple paths, path coverage, valuableness of ants

中图分类号: