Computer Engineering and Applications ›› 2017, Vol. 53 ›› Issue (1): 57-62.DOI: 10.3778/j.issn.1002-8331.1503-0221

Previous Articles     Next Articles

Generating test scenarios from UML activity diagram using hybrid genetic algorithm

WANG Xinying1, JIANG Xiajun2   

  1. School of Computer Science and Technology, Nanjing University of Aeronautics and Astronautics, Nanjing 210016, China
  • Online:2017-01-01 Published:2017-01-10

基于UML活动图及混合遗传算法的测试场景生成

王馨樱1,蒋夏军2   

  1. 南京航空航天大学 计算机科学与技术学院,南京 210016

Abstract: Reducing cost of software testing is the essential issue in the study of software testing optimization. Genetic Algorithm(GA) is introduced into the software testing, which provides necessary impetus to get divergent test scenarios. However, the GA is time-consuming because of having a poor local search and slow convergent speed at later evolution process. This paper presents the Hybrid Genetic Algorithm(HGA) in test scenarios generation based on Unified Modeling Language’s(UML) activity diagram, it contains genetic algorithm and hill climbing algorithm. This new algorithm accelerates the speed of generation of the test scenarios from the UML activity diagram, adding new members at the beginning of each operation of the hybrid genetic algorithm to avoid localized optimization. Experimental results show that the approach not only solves the localized optimization effectively but also greatly improves the efficiency of the generation of test scenarios compared with the simple genetic algorithm and reduces the software testing cost.

Key words: software testing, test scenarios, UML activity diagram, genetic algorithm, hill climbing, localized optimization

摘要: 有效降低测试成本是软件测试优化的重要研究问题。将遗传算法引入到软件测试中,对生成测试场景提供了必要的动力,然而遗传算法局域搜索能力差,在进化后期搜索效率低,导致算法比较费时。基于UML活动图提出了混合遗传算法生成测试场景的方法,该方法结合遗传算法和爬山法,有效地加快了测试场景的生成速度。为了避免局部性问题,在算法每次进行爬山操作之前调用种群生成函数。实验结果表明,与简单的遗传算法相比,混合遗传算法不仅有效地解决了局部性问题,而且较大地提高了生成测试场景的效率,降低了软件测试成本。

关键词: 软件测试, 测试场景, UML活动图, 遗传算法, 爬山法, 局部性