An Automatic Testing Approach for Compiler Based on Metamorphic Testing Technique

Qiuming Tao, Wei Wu, Chen Zhao, Wuwei Shen
{"title":"An Automatic Testing Approach for Compiler Based on Metamorphic Testing Technique","authors":"Qiuming Tao, Wei Wu, Chen Zhao, Wuwei Shen","doi":"10.1109/APSEC.2010.39","DOIUrl":null,"url":null,"abstract":"Compilers play an important role in software development, and it is quite necessary to perform abundant testing to ensure the correctness of compilers. A critical task in compiler testing is to validate the semantic-soundness property which requires consistence between semantics of source programs and behavior of target executables. For validating this property, one main challenging issue is generation of a test oracle. Most existing approaches fall into two main categories when dealing with this issue: reference-based approaches and assertion-based approaches. All these approaches have their weakness when new programming languages are involved or test automation is required. To overcome the weakness in the existing approaches, we propose a new automatic approach for testing compiler. Our approach is based on the technique of metamorphic testing, which validates software systems via so-called \"metamorphic relations\". We select the equivalence-preservation relation as the metamorphic relation and propose an automatic metamorphic testing framework for compiler. We also propose three different techniques for automatically generating equivalent source programs as test inputs. Based on our approach, we developed a tool called Mettoc. Our mutation experiments show that Mettoc is effective to reveal compilers' errors in terms of the semantic-soundness property. Moreover, the empirical results also reveal that simple approaches for constructing test inputs are not weaker than complicated ones in terms of fault-detection capability. We also applied Mettoc in testing a number of open source compilers, and two real errors in GCC-4.4.3 and UCC-1.6 respectively have been detected by Mettoc.","PeriodicalId":161686,"journal":{"name":"2010 Asia Pacific Software Engineering Conference","volume":"513 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2010-11-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"71","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2010 Asia Pacific Software Engineering Conference","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/APSEC.2010.39","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 71

Abstract

Compilers play an important role in software development, and it is quite necessary to perform abundant testing to ensure the correctness of compilers. A critical task in compiler testing is to validate the semantic-soundness property which requires consistence between semantics of source programs and behavior of target executables. For validating this property, one main challenging issue is generation of a test oracle. Most existing approaches fall into two main categories when dealing with this issue: reference-based approaches and assertion-based approaches. All these approaches have their weakness when new programming languages are involved or test automation is required. To overcome the weakness in the existing approaches, we propose a new automatic approach for testing compiler. Our approach is based on the technique of metamorphic testing, which validates software systems via so-called "metamorphic relations". We select the equivalence-preservation relation as the metamorphic relation and propose an automatic metamorphic testing framework for compiler. We also propose three different techniques for automatically generating equivalent source programs as test inputs. Based on our approach, we developed a tool called Mettoc. Our mutation experiments show that Mettoc is effective to reveal compilers' errors in terms of the semantic-soundness property. Moreover, the empirical results also reveal that simple approaches for constructing test inputs are not weaker than complicated ones in terms of fault-detection capability. We also applied Mettoc in testing a number of open source compilers, and two real errors in GCC-4.4.3 and UCC-1.6 respectively have been detected by Mettoc.
基于变形测试技术的编译器自动测试方法
编译器在软件开发中起着重要的作用,为了保证编译器的正确性,进行大量的测试是十分必要的。编译器测试的一项关键任务是验证语义健全性,这要求源程序的语义与目标可执行程序的行为保持一致。为了验证这个属性,一个主要的挑战问题是生成一个测试oracle。在处理此问题时,大多数现有方法分为两大类:基于引用的方法和基于断言的方法。当涉及到新的编程语言或需要测试自动化时,所有这些方法都有它们的弱点。为了克服现有方法的不足,提出了一种新的编译器自动测试方法。我们的方法是基于变形测试技术,它通过所谓的“变形关系”来验证软件系统。我们选择等价-保持关系作为变形关系,提出了一个编译器自动变形测试框架。我们还提出了三种不同的技术来自动生成等效的源程序作为测试输入。基于我们的方法,我们开发了一个叫做Mettoc的工具。我们的变异实验表明,Mettoc在语义健全性方面能够有效地揭示编译器的错误。此外,经验结果还表明,构造测试输入的简单方法在故障检测能力方面并不弱于复杂方法。我们还应用Mettoc测试了一些开源编译器,Mettoc分别检测到GCC-4.4.3和UCC-1.6中的两个真实错误。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信