Spectrum-based fault localization for context-free grammars

Moeketsi Raselimo, B. Fischer
{"title":"Spectrum-based fault localization for context-free grammars","authors":"Moeketsi Raselimo, B. Fischer","doi":"10.1145/3357766.3359538","DOIUrl":null,"url":null,"abstract":"We describe and evaluate the first spectrum-based fault localization method aimed at finding faulty rules in a context-free grammar. It takes as input a test suite and a modified parser for the grammar that can collect grammar spectra, i.e., the sets of rules used in attempts to parse the individual test cases, and returns as output a ranked list of suspicious rules. We show how grammar spectra can be collected for both LL and LR parsers, and how the ANTLR and CUP parser generators can be modified and used to automate the collection of the grammar spectra. We evaluate our method over grammars with seeded faults as well as real world grammars and student grammars submitted in compiler engineering courses that contain real faults. The results show that our method ranks the seeded faults within the top five rules in more than half of the cases and can pinpoint them in 10%–40% of the cases. On average, it ranks the faults at around 25% of all rules, and better than 15% for a very large test suite. It also allowed us to identify deviations and faults in the real world and student grammars.","PeriodicalId":354325,"journal":{"name":"Proceedings of the 12th ACM SIGPLAN International Conference on Software Language Engineering","volume":"78 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-10-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"9","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 12th ACM SIGPLAN International Conference on Software Language Engineering","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3357766.3359538","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 9

Abstract

We describe and evaluate the first spectrum-based fault localization method aimed at finding faulty rules in a context-free grammar. It takes as input a test suite and a modified parser for the grammar that can collect grammar spectra, i.e., the sets of rules used in attempts to parse the individual test cases, and returns as output a ranked list of suspicious rules. We show how grammar spectra can be collected for both LL and LR parsers, and how the ANTLR and CUP parser generators can be modified and used to automate the collection of the grammar spectra. We evaluate our method over grammars with seeded faults as well as real world grammars and student grammars submitted in compiler engineering courses that contain real faults. The results show that our method ranks the seeded faults within the top five rules in more than half of the cases and can pinpoint them in 10%–40% of the cases. On average, it ranks the faults at around 25% of all rules, and better than 15% for a very large test suite. It also allowed us to identify deviations and faults in the real world and student grammars.
上下文无关语法的基于谱的故障定位
我们描述并评估了第一种基于频谱的故障定位方法,该方法旨在发现上下文无关语法中的错误规则。它将一个测试套件和一个修改过的语法解析器作为输入,该语法解析器可以收集语法谱,即,在尝试解析单个测试用例时使用的规则集,并将可疑规则的排序列表作为输出返回。我们展示了如何为LL和LR解析器收集语法谱,以及如何修改ANTLR和CUP解析器生成器,并使用它们来自动收集语法谱。我们对带有种子错误的语法、真实世界的语法以及编译工程课程中包含真实错误的学生提交的语法进行了评估。结果表明,在半数以上的案例中,我们的方法能将种子故障排在前5条规则之内,在10% ~ 40%的案例中,我们的方法能准确定位种子故障。平均而言,它将所有规则中的错误排在25%左右,对于一个非常大的测试套件来说,这一比例要高于15%。它还允许我们识别现实世界和学生语法中的偏差和错误。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术官方微信