计算机应用 ›› 2015, Vol. 35 ›› Issue (2): 545-549.DOI: 10.11772/j.issn.1001-9081.2015.02.0545

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

混合粒子群算法的软件测试数据自动生成

董跃华, 戴玉倩   

  1. 江西理工大学 信息工程学院, 江西 赣州 341000
  • 收稿日期:2014-09-15 修回日期:2014-11-06 出版日期:2015-02-10 发布日期:2015-02-12
  • 通讯作者: 戴玉倩
  • 作者简介:董跃华(1964-),女,湖北乐亭人,副教授,硕士,主要研究方向:数据挖掘、软件工程、软件测试; 戴玉倩(1988-),女,安徽合肥人,硕士研究生,主要研究方向:软件测试。

Automatic software test data generation based on hybrid particle swarm optimization

DONG Yuehua, DAI Yuqian   

  1. Faculty of Information Engineering, Jiangxi University of Science and Technology, Ganzhou Jiangxi 341000, China
  • Received:2014-09-15 Revised:2014-11-06 Online:2015-02-10 Published:2015-02-12

摘要:

针对全连接拓扑结构的粒子群算法在生成测试数据过程中,存在收敛精度低,易陷入局部极值的问题,提出一种混合粒子群算法HPSO,并将其应用于测试数据自动生成。该算法在保证全局收敛性的前提下,对多样性匮乏的种群,首先采用定长环形拓扑结构取代粒子群的全连接拓扑结构;其次,采用轮盘赌方法选择候选解,更新粒子位置信息和速度信息;最后引入条件禁忌算法,对处于局部极值的粒子采取禁忌处理。通过实验比较表明:与基本粒子群算法(BPSO)相比,HPSO使种群多样性得到大幅度提升;在测试数据生成性能上,HPSO的搜索成功率和路径覆盖率均优于遗传算法与粒子群算法混合算法GA-PSO,而平均耗时与BPSO算法相当,性能表现优越。

关键词: 测试数据生成, 全连接粒子群, 拓扑结构, 轮盘赌选择法, 条件禁忌算法

Abstract:

Since the fully connected topology of particle swarm algorithm has low convergence precision and easily falls into local extremum, an approach for automatically generating structural test data based on a hybrid particle swarm algorithm named HPSO (Hybrid Particle Swarm Optimization) was proposed. Firstly, under the premise of global convergence, the population which lacked of diversity used fixed-length ring topology to replace the fully connected one. Secondly, the roulette wheel method was introduced to select the candidate solutions and update the location information and velocity information. Lastly, for controlling and directing the particles to escape from local minimum, the conditions of tabu search algorithm were introduced too. The result of experiment shows that HPSO has a better performance than the Basic Particle Swarm Optimization (BPSO) in population diversity. And HPSO exhibited superiority in search success rate and path coverage in contract with combination method of Genetic Algorithm and Particle Swarm Optimization algorithm named GA-PSO in test data generation, while the average time-consuming is not much different from BPSO.

Key words: test data generation, Global Particle Swarm Optimization (GPSO), topological structure, roulette selection method, conditional tabu search algorithm

中图分类号: