• •    

基于动态集合进化的弱变异测试用例集生成

郭后钱1,王微微1,尚颖2,赵瑞莲3   

  1. 1. 北京化工大学
    2. 北京化工大学 信息学院
    3. 北京化工大学 信息科学与技术学院,北京100029
  • 收稿日期:2017-03-30 修回日期:2017-04-23 发布日期:2017-04-23
  • 通讯作者: 尚颖

Weak mutation test set generation based on dynamic set evolutionary algorithm

  • Received:2017-03-30 Revised:2017-04-23 Online:2017-04-23

摘要: 摘 要: 为解决基于集合进化算法的弱变异测试用例集生成过程中个体规模固定和执行开销大的问题,提出一种基于动态集合进化算法的弱变异测试用例集生成方法。该方法以测试用例集为个体,生成覆盖所有变异分支的弱变异测试用例集。在进化过程中,集合精简算子根据最优个体的最小子集及其未覆盖变异分支数量计算所需测试用例集的最小规模,并基于该最小规模调整种群中所有个体的规模,以生成最小规模的弱变异测试用例集。同时设计了适用于评估以测试用例集为个体的适应度函数。实验结果表明,动态集合进化算法指导弱变异测试用例集生成,获得的测试用例集规模比个体初始规模平均约简了50.15%,执行时间相比于集合进化的弱变异测试用例集生成最高降低了74.58%。因此,动态集合进化算法为最小规模的弱变异测试用例集生成和提升算法速度提供了一种解决方案。

关键词: 测试用例生成, 弱变异测试, 分支覆盖, 集合进化, 贪心算法

Abstract: Abstract: To solve the problem of fixed individual scale and high execution cost of weak mutation test set generation based on Set Evolutionary Algorithm, a new method called Dynamic Set Evolutionary Algorithm was proposed. In this method, different test sets have been made as individuals to generate some weak mutations to cover all mutant branches. In the evolutionary process, a reduction operator on those sets was presented to adjust the scale of individuals. Then a suitable fitness function has been designed to evaluate those test sets. First, the minimal size of test sets has been calculated according to the minimum subset of the optimal individual and the number of the optimal individual uncovered mutant branches. Then the size of all individuals was adjusted based on a test set minimal size. Finally, the minimal weak mutation test set was generated. In experiments, the results show that weak mutation test set generation guided by dynamic Set Evolutionary Algorithm can effectively reduce the scale of the generated test set. The minimized size is about 50.15% on average than the initial size of the individual. And the execution time is also lower than the original algorithm, which has a maximum reduction of 74.58%. Therefore, this method provides a better and faster solution for a minimal weak mutation test set generation.

Key words: test case generation, Weak mutation testing, Branch coverage, Set evolutionary algorithm, Greedy algorithm

中图分类号: