Journal of Frontiers of Computer Science and Technology ›› 2016, Vol. 10 ›› Issue (7): 915-923.DOI: 10.3778/j.issn.1673-9418.1507050

Previous Articles     Next Articles

Research on Metamorphic Testing for Model Transformation Program

YU Heng, BEN Kerong+   

  1. Department of Computer Engineering, Naval University of Engineering, Wuhan 430033, China
  • Online:2016-07-01 Published:2016-07-01

针对模型转换程序的蜕变测试方法研究

余  恒,贲可荣+   

  1. 海军工程大学 计算机工程系,武汉 430033

Abstract: The results of model transformation of model driven architecture (MDA) are often difficult to judge correct or wrong (that is, test Oracle problem), whereas metamorphic testing partially solves the Oracle problem by verifying whether the result of multiple executions satisfies the metamorphic relationships or not. To solve the Oracle problem of model transformation testing effectively, metamorphic testing is applied to the case of model transformation from UML to Java. Based on transformation rules, a set of metamorphic relations is constructed from four different aspects: add, delete, modify and replace. Finally, two common faults are transplanted in the program under test, the test cases are designed and executed to verify the metamorphic relations. The faults are exposed because the metamorphic relations are violated, which shows the effectiveness of metamorphic testing.

Key words: model transformation, software testing, test Oracle, metamorphic testing, metamorphic relations

摘要: 模型驱动架构中模型转换结果正确与否常常难以判断(即测试Oracle问题),而蜕变测试通过验证多个执行结果之间是否满足蜕变关系可以部分地解决测试Oracle问题。为有效地解决模型转换测试中的Oracle问题,以UML到Java模型转换程序为例,应用蜕变测试,依据转换规则,从增加、删除、修改、替换4个方面设计并构造出一组蜕变关系。最后对待测程序植入在实际测试中常见的两种错误,设计并执行测试用例后验证蜕变关系,发现违反了蜕变关系,暴露出程序缺陷,从而说明了蜕变测试的有效性。

关键词: 模型转换, 软件测试, 测试Oracle, 蜕变测试, 蜕变关系