代码注释的变异操作符

Pedro Pinheiro, J. C. Viana, Leo Fernandes, Márcio Ribeiro, F. Ferrari, B. Neto, Rohit Gheyi
{"title":"代码注释的变异操作符","authors":"Pedro Pinheiro, J. C. Viana, Leo Fernandes, Márcio Ribeiro, F. Ferrari, B. Neto, Rohit Gheyi","doi":"10.1145/3266003.3266006","DOIUrl":null,"url":null,"abstract":"Mutation testing is a technique that injects artificial faults to check whether the existing test suite can detect them. To inject the faults, mutation testing tools rely on mutation operators, such as Arithmetic Operator Replacement, Relational Operator Replacement, Statement Deletion, and Overriding Method Rename. Most of the proposed mutation operators have focused on imperative language constructs and object-oriented constructs. However, many projects make use of meta-programming through code annotations, and mutation operators to simulate annotation-related faults are missing. To minimize this problem, in this paper we propose a set of mutation operators capable of simulating annotation-related faults. In particular, we define nine operators. To evaluate our operators, we mined Java projects that make heavy use of annotations to identify annotation-related faults. We analyzed 100 faults and categorized them as \"misuse\", when the developer does not know how to use the annotations in a proper way; and \"wrong annotation parsing\", when the developer wrongly parses annotation code (by using refection, for example). Our operators are able to simulate 95 out of the 100 mined faults. In particular, three operators are able to simulate up to 82% of the analyzed faults. As implications for practice, our operators can help developers to improve their test suite and the code responsible for parsing annotated code. Also, they can help developers to avoid annotation-related faults.","PeriodicalId":208536,"journal":{"name":"Brazilian Symposium on Systematic and Automated Software Testing","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2018-09-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"4","resultStr":"{\"title\":\"Mutation Operators for Code Annotations\",\"authors\":\"Pedro Pinheiro, J. C. Viana, Leo Fernandes, Márcio Ribeiro, F. Ferrari, B. Neto, Rohit Gheyi\",\"doi\":\"10.1145/3266003.3266006\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Mutation testing is a technique that injects artificial faults to check whether the existing test suite can detect them. To inject the faults, mutation testing tools rely on mutation operators, such as Arithmetic Operator Replacement, Relational Operator Replacement, Statement Deletion, and Overriding Method Rename. Most of the proposed mutation operators have focused on imperative language constructs and object-oriented constructs. However, many projects make use of meta-programming through code annotations, and mutation operators to simulate annotation-related faults are missing. To minimize this problem, in this paper we propose a set of mutation operators capable of simulating annotation-related faults. In particular, we define nine operators. To evaluate our operators, we mined Java projects that make heavy use of annotations to identify annotation-related faults. We analyzed 100 faults and categorized them as \\\"misuse\\\", when the developer does not know how to use the annotations in a proper way; and \\\"wrong annotation parsing\\\", when the developer wrongly parses annotation code (by using refection, for example). Our operators are able to simulate 95 out of the 100 mined faults. In particular, three operators are able to simulate up to 82% of the analyzed faults. As implications for practice, our operators can help developers to improve their test suite and the code responsible for parsing annotated code. Also, they can help developers to avoid annotation-related faults.\",\"PeriodicalId\":208536,\"journal\":{\"name\":\"Brazilian Symposium on Systematic and Automated Software Testing\",\"volume\":\"1 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2018-09-17\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"4\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Brazilian Symposium on Systematic and Automated Software Testing\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/3266003.3266006\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Brazilian Symposium on Systematic and Automated Software Testing","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3266003.3266006","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 4

摘要

突变测试是一种注入人工故障来检查现有测试套件是否可以检测到它们的技术。为了注入故障,突变测试工具依赖于突变操作符,例如算术操作符替换、关系操作符替换、语句删除和重写方法重命名。大多数提出的突变操作符都集中在命令式语言结构和面向对象结构上。然而,许多项目通过代码注释使用元编程,并且缺少突变操作符来模拟与注释相关的错误。为了最小化这个问题,本文提出了一组能够模拟注释相关故障的突变算子。特别地,我们定义了9个操作符。为了评估我们的操作符,我们挖掘了大量使用注释的Java项目,以识别与注释相关的错误。我们分析了100个错误,并将它们归类为“误用”,即开发人员不知道如何以正确的方式使用注释;以及“错误的注释解析”,当开发人员错误地解析注释代码时(例如通过使用反射)。我们的操作员能够模拟100个已开采断层中的95个。特别是,三个操作员能够模拟高达82%的分析故障。作为实践的暗示,我们的操作符可以帮助开发人员改进他们的测试套件和负责解析注释代码的代码。此外,它们还可以帮助开发人员避免与注释相关的错误。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Mutation Operators for Code Annotations
Mutation testing is a technique that injects artificial faults to check whether the existing test suite can detect them. To inject the faults, mutation testing tools rely on mutation operators, such as Arithmetic Operator Replacement, Relational Operator Replacement, Statement Deletion, and Overriding Method Rename. Most of the proposed mutation operators have focused on imperative language constructs and object-oriented constructs. However, many projects make use of meta-programming through code annotations, and mutation operators to simulate annotation-related faults are missing. To minimize this problem, in this paper we propose a set of mutation operators capable of simulating annotation-related faults. In particular, we define nine operators. To evaluate our operators, we mined Java projects that make heavy use of annotations to identify annotation-related faults. We analyzed 100 faults and categorized them as "misuse", when the developer does not know how to use the annotations in a proper way; and "wrong annotation parsing", when the developer wrongly parses annotation code (by using refection, for example). Our operators are able to simulate 95 out of the 100 mined faults. In particular, three operators are able to simulate up to 82% of the analyzed faults. As implications for practice, our operators can help developers to improve their test suite and the code responsible for parsing annotated code. Also, they can help developers to avoid annotation-related faults.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
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学术官方微信