计算机应用 ›› 2017, Vol. 37 ›› Issue (1): 108-113.DOI: 10.11772/j.issn.1001-9081.2017.01.0108

• 2016年全国开放式分布与并行计算学术年会(DPCS2016)论文 • 上一篇    下一篇

基于离散粒子群算法的测试用例优先排序

张卫祥1,2, 齐玉华1,2, 李德治1,2   

  1. 1. 北京跟踪与通信技术研究所, 北京 100094;
    2. 中国宇航学会 飞行器测控专委会, 北京 100094
  • 收稿日期:2016-08-24 修回日期:2016-09-04 出版日期:2017-01-10 发布日期:2017-01-09
  • 通讯作者: 张卫祥
  • 作者简介:张卫祥(1979-),男,山东济宁人,工程师,硕士,主要研究方向:软件评测、智能化测试;齐玉华(1985-),男,河南睢县人,助理研究员,博士,主要研究方向:软件评测、缺陷分析与修复;李德治(1963-),男,河南偃师人,高级工程师,硕士,主要研究方向:软件评测、软件工程化。
  • 基金资助:
    国家自然科学基金资助项目(61502015)。

Test case prioritization based on discrete particle swarm optimization algorithm

ZHANG Weixiang1,2, QI Yuhua1,2, LI Dezhi1,2   

  1. 1. Beijing Institute of Tracking and Telecommunications Technology, Beijing 100094, China;
    2. Committee of Spacecraft TT & C Technology, Chinese Society of Astronautics, Beijing 100094, China
  • Received:2016-08-24 Revised:2016-09-04 Online:2017-01-10 Published:2017-01-09
  • Supported by:
    This work is supported by the National Natural Science Foundation of China (61502015).

摘要: 测试用例优先排序技术能够有效提高回归测试效率,是软件测试的热点研究课题之一。针对基于需求的测试用例优先排序方法可操作性差的问题,提出了一种改进的基于测试点覆盖和离散粒子群优化算法的求解方法(TCP-DPSO)。首先,把影响排序的各种因素分为测试收益型因素和测试成本型因素两大类,通过加权平均的方式进行归一化,得到基于需求的通用测试平均收益率评价指标;然后,利用交换子和基本交换序列定义粒子的位置和速度,借鉴遗传算法(GA)变异策略引入变异算子,采用时变惯性权重调整粒子的探索能力和开发能力,促进可持续进化和逼近优化目标。实验结果表明,TCP-DPSO在最优解质量上与遗传算法相当,大幅优于随机测试,在最优解成功率和平均求解时间上优于遗传算法,具有更好的算法稳定性。

关键词: 软件测试, 测试用例优先排序, 离散粒子群优化, 评价指标, 黑盒测试

Abstract: With the ability to improve regression testing efficiency, test case prioritization has become a hot topic in software testing research. Since test case prioritization based on requirement is usually inefficient, a test case prioritization method based on discrete particle swarm optimization and test-point coverage, called Discrete Particle Swarm Optimization for Test Case Prioritization (TCP-DPSO) was proposed. Firstly, the various factors affecting prioritization were divided into two categories:Cost-Keys and Win-Keys, and then general test average yield index by normalizing was obtained. Then, particle's position and velocity were defined by use of switcher and basic switching sequence, the mutation operator was introduced by referencing mutation strategy of Genetic Algorithm (GA), and the exploration and development capabilities were adjusted by adopting variable inertia weight, which could promote sustainable evolution and approach optimization goals. The experimental results show that TCP-DPSO is similar to GA and dramatically better than random testing on optimal solution quality and it is superior to GA on success rate and average computing time, which indicates its better algorithm stability.

Key words: software testing, test case prioritization, Discrete Particle Swarm Optimization (DPSO), evaluation index, functional testing

中图分类号: