• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学

• 软件工程 • 上一篇    下一篇

利用佳点集遗传算法的白盒测试用例优先排序

孙家泽1,2,王刚1   

  1. (1.西安邮电大学计算机学院,陕西 西安 710121;
    2.西安邮电大学陕西省网络数据分析与智能处理重点实验室,陕西 西安 710121)
  • 收稿日期:2017-05-05 修回日期:2017-11-09 出版日期:2018-10-25 发布日期:2018-10-25
  • 基金资助:

    陕西省工业科技攻关项目(2017GY-076)

White box test case prioritization based on
good point set genetic algorithm

SUN Jiaze1,2,WANG Gang1   

  1. (1.School of Computer Science and Technology,Xi’an University of Posts and Telecommunications,Xi’an 710121;
    2.Key Laboratory of Shaanxi for Network Dota Analysis and Intelligent Processing,
    Xi’an University of Posts and Telecommunications,Xi’an 710121,China)
  • Received:2017-05-05 Revised:2017-11-09 Online:2018-10-25 Published:2018-10-25

摘要:

在软件演化过程中,测试用例优先排序作为一种高效实用的回归测试技术,对于提高缺陷的早期检测速率和降低测试成本有重要意义。针对传统遗传算法在白盒测试用例优先排序中收敛速度慢和稳定性差的问题,采用佳点集遗传算法求解白盒测试用例优先排序问题。算法根据程序实体覆盖矩阵对个体进行编码,以程序实体覆盖平均百分比作为适应度函数,采用随机抽样选择算子和佳点集交叉算子产生新一代种群。实验选择6个典型的基准开源项目,以语句、分支和方法作为程序实体,实验结果表明佳点集遗传算法收敛速度快、稳定性好,为回归测试提供了一个有效的测试用例优先排序方法,有助于尽早发现软件缺陷,降低测试成本。

 

关键词: 白盒测试, 测试用例优先排序, 遗传算法, 随机抽样, 佳点集

Abstract:

Test case prioritization is an efficient and practical regression testing technique in the process of software evolution, and it is essential for improving early defect detection rate and reducing test cost. To solve the problem of slow convergence speed and poor stability of the traditional genetic algorithm (GA) in white box test case prioritization, we propose a test case prioritization method based on good point set GA (GGA). The GGA encodes the individuals according to the cover matrixes of program entities and uses average cover percentage of program entities as the fitness function. The GGA generates the new generation of population through random sampling selection operator and good point set crossover operator. We select six typical open source projects as benchmark programs, and take statements, branches and methods as program entities  in the experiments. Experimental results show that the GGA has faster convergence speed and better stability than the traditional GA. The GGA provides an effective method for test case prioritization in regression testing, which is helpful for finding software defects as early as possible and reducing test cost.
 

Key words: white box testing, test case prioritization, genetic algorithm, random sampling, good point set