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

J4 ›› 2012, Vol. 34 ›› Issue (2): 150-158.

• 论文 • 上一篇    下一篇

一种基于UML状态图的规约变异测试方法

米 磊,贲可荣   

  1. (海军工程大学计算机工程系,湖北 武汉 430033)
  • 收稿日期:2011-02-23 修回日期:2011-05-25 出版日期:2012-02-25 发布日期:2012-02-25

An Approach to Specification Mutation Testing Based on the UML State Diagram

MI Lei,BEN Kerong   

  1. (Department of Computer Engineering,Naval University of Engineering,Wuhan 430033,China)
  • Received:2011-02-23 Revised:2011-05-25 Online:2012-02-25 Published:2012-02-25

摘要:

规约变异测试从软件功能的角度,对规约进行分析,从而揭示规约中存在的问题。本文提出一种基于UML状态图的变异测试方法,针对每种变异算子,分析其是否会引入冲突,进而有效避免不合理的变异操作;分析了每种变异算子产生等价变异体的条件,能够在生成变异体的同时检测并移除等价变异体,进而减少其对测试过程的影响;给出了杀掉每种变异体所需满足的条件,可在此基础上产生杀掉特定变异体所需的测试用例,从而提高测试用例集的质量。在此基础上,根据变异算子的实际功能,整合了功能相同的算子,减少了变异算子的数量,从而进一步降低了变异测试的开销。实验结果表明,本方法能够较好地提高测试用例的质量,进而提升测试的效率。

关键词: 变异测试;UML;状态图;变异算子;等价变异体

Abstract:

Specification mutation testing analyzes the specification from the perspective of software functions, and can reveal the errors in the specification. In this paper, an approach to mutation testing based on the UML state diagram is proposed. For each mutation operator, a conflict analysis is introduced to avoid unreasonable mutation. The condition of the generation of equivalent mutants is analyzed, so these mutants can be detected in the implementation of testing, and the impact made by these mutants can be reduced. Then, the required condition of generating test cases for the mutants is also analyzed. Based on the basis, there is an integration of the operators according to the inclusion relation among them, which can reduce the cost of the mutation testing. The experiment shows that the proposed approach can improve the quality of the test cases effectively, and increase the efficiency of the mutation testing.

Key words: mutation testing;UML;state diagram;mutation operator;equivalent mutant