计算机应用 ›› 2019, Vol. 39 ›› Issue (3): 845-850.DOI: 10.11772/j.issn.1001-9081.2018081692

• 计算机软件技术 • 上一篇    下一篇

基于改进细菌觅食算法的测试用例生成方法

王曙燕, 王瑞, 孙家泽   

  1. 西安邮电大学 计算机学院, 西安 710121
  • 收稿日期:2018-08-15 修回日期:2018-09-04 出版日期:2019-03-10 发布日期:2019-03-11
  • 通讯作者: 王曙燕
  • 作者简介:王曙燕(1964-),女,陕西西安人,教授,博士,主要研究方向:软件测试、数据挖掘、智能信息处理;王瑞(1995-),女,山西运城人,硕士研究生,主要研究方向:可信软件、软件测试、数据挖掘;孙家泽(1980-),男,陕西西安人,副教授,博士,主要研究方向:软件测试、数据挖掘、智能信息处理。
  • 基金资助:

    陕西省科技厅工业科技攻关项目(2018GY-014,2017GY-092);西安邮电大学研究生创新基金资助项目(CXJJ2017063)。

Test case generation method based on improved bacterial foraging optimization algorithm

WANG Shuyan, WANG Rui, SUN Jiaze   

  1. School of Computer Science and Technology, Xi'an University of Posts and Telecommunications, Xi'an Shaanxi 710121, China
  • Received:2018-08-15 Revised:2018-09-04 Online:2019-03-10 Published:2019-03-11
  • Supported by:

    This work is partially supported by the Industrial Science and Technology Research Project of Shaanxi Province (2018GY-014, 2017GY-092), the Innovation Funds for Graduates in Xi'an University of Posts and Telecommunications (CXJJ2017063).

摘要:

针对测试用例自动化生成技术中效率较低的问题,尝试引入新的细菌觅食算法,并结合测试用例生成问题提出了一种基于细菌觅食算法的改进算法(IM-BFOA)。IM-BFOA首先采用Kent映射来增加细菌的初始种群和全局搜索的多样性,其次针对算法中趋化阶段的步长进行自适应设计,使其在细菌趋化过程中更加合理化,并通过实验仿真验证其合理性,最后根据被测程序构造适应度函数来加速测试数据的优化。实验结果表明,与遗传算法(GA)、粒子群优化(PSO)算法和标准细菌觅食优化算法(BFOA)相比,该算法在保证覆盖率的前提下,在迭代次数和运行时间方面都是较优的,可有效提高生成测试用例的效率。

关键词: 测试用例生成, 细菌觅食算法, Kent映射, 自适应步长, 适应度函数

Abstract:

Aiming at the low efficiency of test case automatic generation technology, an IMproved Bacterial Foraging Optimization Algorithm (IM-BFOA) was proposed with introduction of Knet map. Firstly, Kent map was used to increase the diversity of the initial population and global search of bacteria. Secondly, the step size of chemotaxis stage in the algorithm was adaptively designed to make it more rational in the process of bacterial chemotaxis. Finally, a fitness function was constructed according to the program under test to accelerate the optimization of test data. The experimental results show that compared with Genetic Algorithm (GA), Particle Swarm Optimization (PSO) algorithm and standard Bacterial Foraging Optimization Algorithm (BFOA), the proposed algorithm is the best in terms of iterations number and running time with the guarantee of coverage and has high efficiency of test case generation.

Key words: test case generation, Bacterial Foraging Optimization Algorithm (BFOA), Kent map, adaptive step size, fitness function

中图分类号: