计算机应用 ›› 2019, Vol. 39 ›› Issue (2): 534-539.DOI: 10.11772/j.issn.1001-9081.2018071467

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

基于弱变异准则的测试用例约简方法

王曙燕, 袁佳娟, 孙家泽   

  1. 西安邮电大学 计算机学院, 西安 710061
  • 收稿日期:2018-07-16 修回日期:2018-08-17 出版日期:2019-02-10 发布日期:2019-02-15
  • 通讯作者: 王曙燕
  • 作者简介:王曙燕(1964-),女,陕西西安人,教授,博士,主要研究方向:软件测试、数据挖掘、智能信息处理;袁佳娟(1991-),女,陕西宝鸡人,硕士研究生,主要研究方向:软件设计与测试、数据挖掘;孙家泽(1980-),男,陕西西安人,副教授,博士,主要研究方向:软件测试、数据挖掘、智能信息处理。
  • 基金资助:
    陕西省科技厅工业攻关项目(2018GY-014,2017GY-092);西安邮电大学研究生创新基金资助项目(CXJJ2017063)。

Test suite reduction method based on weak mutation criterion

WANG Shuyan, YUAN Jiajuan, SUN Jiaze   

  1. School of Computer Science and Technology, Xi'an University of Posts and Telecommunications, Xi'an Shaanxi 710061, China
  • Received:2018-07-16 Revised:2018-08-17 Online:2019-02-10 Published:2019-02-15
  • Supported by:
    This work is partially supported by the Industrial Science and Technology Research Project of Shaanxi Province (2018GY-014, 2017GY-092), the Innovation Foundation of Xi'an University of Posts & Telecommunications (CXJJ2017063).

摘要: 针对为数较多的测试用例增加了回归测试成本的问题,提出一种基于弱变异准则的测试用例约简方法。首先,基于弱变异准则获得测试用例和变异分支关系矩阵;然后,重复约简4种无效测试需求和子集测试用例;最后,结合人工鱼群算法选择当前最优测试用例,并且交替执行简化和测试用例选择操作直至覆盖所有测试需求。该方法针对6个经典程序与贪心算法和HGS算法相比,基于弱变异准则并且不改变或稍微改变变异评分的条件下,约简率分别提高了73.4%和8.2%,且耗时分别降低了25.3%和56.1%。实验结果表明,所提方法在回归测试中可有效约简测试用例,降低测试代价。

关键词: 回归测试, 弱变异准则, 变异分支, 测试用例约简, 人工鱼群算法

Abstract: In view of the problem that the test cost is increased by a large number of test suites in regression testing, a test suite reduction method based on weak mutation criterion was proposed. Firstly, the relation matrix between test suites and mutation branches was obtained based on weak mutation criterion. Then, four invalid test requirements and subset test suites were reduced repeatedly. Finally, the current optimal test suite was selected by using artificial fish swarm algorithm, and the simplification and test suite selection operations were performed alternately until all the test requirements were covered. Compared with Greedy algorithm and HGS (Harrold-Gupta-Soff) algorithm on six classical programs, when using weak mutation criterion with no changing or slightly changing mutation score, the reduction rate was improved by 73.4% and 8.2% respectively, and the time consumption was decreased by 25.3% and 56.1% respectively. The experimental results show that the proposed method can effectively reduce the test suites and save the test cost in regression testing.

Key words: regression testing, weak mutation criterion, mutation branch, test suite reduction, artificial fish swarm algorithm

中图分类号: