Toward Just-in-Time and Language-Agnostic Mutation Testing

Stefan Reschke, Toni Mattis, Fabio Niephaus, R. Hirschfeld
{"title":"Toward Just-in-Time and Language-Agnostic Mutation Testing","authors":"Stefan Reschke, Toni Mattis, Fabio Niephaus, R. Hirschfeld","doi":"10.1145/3532512.3532514","DOIUrl":null,"url":null,"abstract":"Mutation Testing is a popular approach to determine the quality of a suite of unit tests. It is based on the idea that introducing faults into a system under test (SUT) should cause tests to fail, otherwise, the test suite might be of insufficient quality. In the language of mutation testing, such a fault is referred to as “mutation”, and an instance of the SUT’s code that contains the mutation is referred to as “mutant”. Mutation testing is computationally expensive and time-consuming. Reasons for this include, for example, a high number of mutations to consider, interrelations between these mutations, and mutant-associated costs such as the cost of mutant creation or the cost of checking whether any tests fail in response. Furthermore, implementing a reliable tool for automatic mutation testing is a significant effort for any language. As a result, mutation testing is only available for some languages. Present mutation tools often rely on modifying code or binary executables. We refer to this as “ahead-of-time” mutation testing. Oftentimes, they neither take dynamic information that is only available at run-time into account nor alter program behavior at run-time. However, mutating via the latter could save costs on mutant creation: If the corresponding module of code is compiled, only the mutated section of code needs to be recompiled. Run-time information (like previous execution results selected by an initial test run) could help to determine the utility of a mutant. Skipping mutants of low utility could have an impact on mutation testing efficiency. We refer to this approach as just-in-time mutation testing. In this paper, we provide a proof of concept for just-in-time and language-agnostic mutation testing. We present preliminary results of a feasibility study that explores the implementation of just-in-time mutation testing based on Truffle’s instrumentation API. Based on these results, future research can evaluate the implications of just-in-time and language-agnostic mutation testing.","PeriodicalId":245819,"journal":{"name":"Companion Proceedings of the 6th International Conference on the Art, Science, and Engineering of Programming","volume":"9 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-03-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Companion Proceedings of the 6th International Conference on the Art, Science, and Engineering of Programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3532512.3532514","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Mutation Testing is a popular approach to determine the quality of a suite of unit tests. It is based on the idea that introducing faults into a system under test (SUT) should cause tests to fail, otherwise, the test suite might be of insufficient quality. In the language of mutation testing, such a fault is referred to as “mutation”, and an instance of the SUT’s code that contains the mutation is referred to as “mutant”. Mutation testing is computationally expensive and time-consuming. Reasons for this include, for example, a high number of mutations to consider, interrelations between these mutations, and mutant-associated costs such as the cost of mutant creation or the cost of checking whether any tests fail in response. Furthermore, implementing a reliable tool for automatic mutation testing is a significant effort for any language. As a result, mutation testing is only available for some languages. Present mutation tools often rely on modifying code or binary executables. We refer to this as “ahead-of-time” mutation testing. Oftentimes, they neither take dynamic information that is only available at run-time into account nor alter program behavior at run-time. However, mutating via the latter could save costs on mutant creation: If the corresponding module of code is compiled, only the mutated section of code needs to be recompiled. Run-time information (like previous execution results selected by an initial test run) could help to determine the utility of a mutant. Skipping mutants of low utility could have an impact on mutation testing efficiency. We refer to this approach as just-in-time mutation testing. In this paper, we provide a proof of concept for just-in-time and language-agnostic mutation testing. We present preliminary results of a feasibility study that explores the implementation of just-in-time mutation testing based on Truffle’s instrumentation API. Based on these results, future research can evaluate the implications of just-in-time and language-agnostic mutation testing.
走向及时和语言不可知的突变测试
突变测试是确定一组单元测试质量的流行方法。它基于将错误引入被测系统(SUT)应该导致测试失败的思想,否则,测试套件可能质量不足。在突变测试的语言中,这样的故障被称为“突变”,而SUT代码中包含该突变的实例被称为“突变”。突变测试在计算上是昂贵且耗时的。其原因包括,例如,需要考虑大量的突变,这些突变之间的相互关系,以及与突变相关的成本,例如创建突变的成本或检查是否有任何测试在响应中失败的成本。此外,实现用于自动突变测试的可靠工具对于任何语言都是一项重要的工作。因此,突变测试只适用于某些语言。目前的变异工具通常依赖于修改代码或二进制可执行文件。我们将此称为“提前”突变测试。通常,它们既不考虑仅在运行时可用的动态信息,也不改变运行时的程序行为。但是,通过后者进行突变可以节省创建突变体的成本:如果编译相应的代码模块,则只需重新编译突变的代码部分。运行时信息(如由初始测试运行选择的先前执行结果)可以帮助确定突变的效用。跳过效用低的突变体会影响突变检测的效率。我们将这种方法称为即时突变测试。在本文中,我们提供了一个即时和语言不可知论突变检测的概念证明。我们提出了一项可行性研究的初步结果,该研究探索了基于松露仪器API的即时突变测试的实现。基于这些结果,未来的研究可以评估即时和语言不可知论突变测试的意义。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术文献互助群
群 号:604180095
Book学术官方微信