电子学报 ›› 2017, Vol. 45 ›› Issue (8): 1970-1975.DOI: 10.3969/j.issn.0372-2112.2017.08.023

• 学术论文 • 上一篇    下一篇

一种变异测试中冗余变异体的寻找方法

钱茛南1,2,3, 王雅文1,2,3, 宫云战1,2,3, 孟凡荣4   

  1. 1. 北京邮电大学网络与交换技术国家重点实验室, 北京 100876;
    2. 桂林电子科技大学 广西云计算与 大数据协同创新中心, 广西桂林 541004;
    3. 桂林电子科技大学广西高校云计算与复杂系统重点实验室, 广西桂林 541004;
    4. 长春汽车工业高等专科学校, 吉林长春 130013
  • 收稿日期:2016-10-26 修回日期:2017-01-16 出版日期:2017-08-25 发布日期:2017-08-25
  • 通讯作者: 钱茛南
  • 作者简介:王雅文,女,1983年生于陕西.北京邮电大学副教授、硕士生导师.主要研究方向为软件测试、程序分析.E-mail:wangyawen@bupt.edu.cn
  • 基金资助:
    国家自然科学基金(No.91318301,No.61202080);广西云计算与大数据协同创新中心、广西高校云计算与复杂系统重点实验室资助(No.YD16508)

A Method for Finding Redundant Mutants in Mutation Testing

QIAN Gen-nan1,2,3, WANG Ya-wen1,2,3, GONG Yun-zhan1,2,3, MENG Fan-rong4   

  1. 1. State Key Laboratory of Networking and Switching Technology, Beijing University of Posts and Telecommunications, Beijing 100876, China;
    2. Guangxi Cooperative Innovation Center of Cloud Computing and Big Data, Guilin University of Electronic Technology, Guilin, Guangxi 541004, China;
    3. Guangxi Colleges and Universities Key Laboratory of Cloud Computing and Complex Systems, Guilin University of Electronic Technology, Guilin, Guangxi 541004, China;
    4. Changchun Automobile Industry Institute, Changchun, Jilin 130013, China
  • Received:2016-10-26 Revised:2017-01-16 Online:2017-08-25 Published:2017-08-25

摘要: 变异测试是一种有效的基于故障的测试方法,但大量冗余变异体所带来的昂贵的测试成本问题,阻碍了它在实际工程开发中的应用.为解决该问题,本文针对程序中的顺序语句所产生的变异体,基于故障的可达-感染-传播模型,提出了使用区间抽象域来表示程序状态,通过区间运算判断变异体之间冗余关系的算法;针对程序中的条件语句,基于谓词故障层级,分别给出了面向简单谓词和复合谓词的冗余变异体选择算法.并对这两种算法对冗余变异体的判定效果进行了分析,最后给出了在分层抽样背景下,非冗余变异体生成的约束边界条件.对Siemens和开源项目等共8个工程进行了实验,并与随机选择法进行了对比.结果表明,本文所提方法在减少变异测试时间成本的同时,可以保持较高的变异得分.

关键词: 变异测试, 变异算子, 冗余变异体, 变异成本, 变异体约减

Abstract: Mutation testing is an effective fault-based testing method.However,the application of mutation testing in engineering development has been restricted by the high testing costs caused by a large number of redundant mutants.Regarding the mutants arising from the sequential statements in a program,an algorithm based on propagation-infection-execution (PIE) model was proposed,which employs the interval abstract domain to represent program state and the interval algorithm to evaluate the redundancy relation between the mutants.Meanwhile,regarding the conditional statements in a program,the redundant mutant selection algorithms based on the predicate fault hierarchy are also presented.The algorithms are designed for simple predicate and compound predicate respectively.By analyzing the effects of these algorithms,the constrained boundary condition for the development of non-redundant mutants under the condition of stratified sampling is concluded.Siemens Test Suite and other three open source projects are used to conduct experiments to compare the proposed method with random selection method.Experimental results show that the proposed method can reduce the mutant testing time cost while maintaining a high mutation score.

Key words: mutation testing, mutation operators, redundant mutants, mutation cost, mutant reduction

中图分类号: