Sirius: Static Program Repair with Dependence Graph-Based Systematic Edit Patterns

Kunihiro Noda, Haruki Yokoyama, S. Kikuchi
{"title":"Sirius: Static Program Repair with Dependence Graph-Based Systematic Edit Patterns","authors":"Kunihiro Noda, Haruki Yokoyama, S. Kikuchi","doi":"10.1109/ICSME52107.2021.00045","DOIUrl":null,"url":null,"abstract":"Software development often involves systematic edits, similar but nonidentical changes to many code locations, that are error-prone and laborious for developers. Mining and learning such systematic edit patterns (SEPs) from past code changes enable us to detect and repair overlooked buggy code that requires systematic edits. A recent study presented a promising SEP mining technique that is based on program dependence graphs (PDGs), while traditional approaches leverage syntax-based representations. PDG-based SEPs are highly expressive and can capture more meaningful changes than syntax-based ones. The next challenge to tackle is to apply the same code changes as in PDG-based SEPs to other code locations; detection and repair of overlooked locations that require systematic edits. Existing program transformation techniques cannot well address this challenge because (1) they expect many structural code similarities that are not guaranteed in PDG-based SEPs or (2) they work on the basis of PDGs but are limited to specific domains (e.g., API migrations). We present in this paper a general-purpose program transformation algorithm for applying PDG-based SEPs. Our algorithm identifies a small transplantable structural subtree for each PDG node, thereby adapting code changes from PDG-based SEPs to other locations. We construct a program repair pipeline Sirius that incorporates the algorithm and automates the processes of mining SEPs, detecting overlooked code locations (bugs) that require systematic edits, and repairing them by applying SEPs. We evaluated the repair performance of Sirius with a corpus of open source software consisting of over 80 repositories. The results indicate that Sirius greatly outperformed the state-of-the-art technique for syntax-based SEPs. Sirius achieved a precision of 0.710, recall of 0.565, and F1-score of 0.630, while those of the state-of-the-art technique were 0.470, 0.141, and 0.216, respectively.","PeriodicalId":205629,"journal":{"name":"2021 IEEE International Conference on Software Maintenance and Evolution (ICSME)","volume":"273 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-07-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2021 IEEE International Conference on Software Maintenance and Evolution (ICSME)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICSME52107.2021.00045","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 1

Abstract

Software development often involves systematic edits, similar but nonidentical changes to many code locations, that are error-prone and laborious for developers. Mining and learning such systematic edit patterns (SEPs) from past code changes enable us to detect and repair overlooked buggy code that requires systematic edits. A recent study presented a promising SEP mining technique that is based on program dependence graphs (PDGs), while traditional approaches leverage syntax-based representations. PDG-based SEPs are highly expressive and can capture more meaningful changes than syntax-based ones. The next challenge to tackle is to apply the same code changes as in PDG-based SEPs to other code locations; detection and repair of overlooked locations that require systematic edits. Existing program transformation techniques cannot well address this challenge because (1) they expect many structural code similarities that are not guaranteed in PDG-based SEPs or (2) they work on the basis of PDGs but are limited to specific domains (e.g., API migrations). We present in this paper a general-purpose program transformation algorithm for applying PDG-based SEPs. Our algorithm identifies a small transplantable structural subtree for each PDG node, thereby adapting code changes from PDG-based SEPs to other locations. We construct a program repair pipeline Sirius that incorporates the algorithm and automates the processes of mining SEPs, detecting overlooked code locations (bugs) that require systematic edits, and repairing them by applying SEPs. We evaluated the repair performance of Sirius with a corpus of open source software consisting of over 80 repositories. The results indicate that Sirius greatly outperformed the state-of-the-art technique for syntax-based SEPs. Sirius achieved a precision of 0.710, recall of 0.565, and F1-score of 0.630, while those of the state-of-the-art technique were 0.470, 0.141, and 0.216, respectively.
天狼星:基于依赖图的系统编辑模式的静态程序修复
软件开发通常涉及系统编辑,对许多代码位置进行类似但不相同的更改,这对开发人员来说是容易出错且费力的。从过去的代码更改中挖掘和学习这样的系统编辑模式(sep)使我们能够检测和修复需要系统编辑的被忽视的错误代码。最近的一项研究提出了一种基于程序依赖图(PDGs)的有前途的SEP挖掘技术,而传统方法利用基于语法的表示。基于pdg的sep具有很强的表达能力,可以捕获比基于语法的更有意义的更改。下一个需要解决的挑战是将基于pdg的sep中的相同代码更改应用于其他代码位置;检测和修复需要系统编辑的被忽略的位置。现有的程序转换技术不能很好地应对这一挑战,因为(1)它们期望许多结构代码的相似性在基于pdg的sep中得不到保证,或者(2)它们在pdg的基础上工作,但仅限于特定的领域(例如,API迁移)。本文提出了一种通用的程序转换算法,用于应用基于pdg的sep。我们的算法为每个PDG节点识别一个小的可移植结构子树,从而将基于PDG的sep的代码更改适应到其他位置。我们构建了一个程序修复管道Sirius,它结合了算法并自动化了挖掘sep的过程,检测需要系统编辑的被忽略的代码位置(bug),并通过应用sep修复它们。我们使用由80多个存储库组成的开源软件语料库评估了Sirius的修复性能。结果表明,Sirius大大优于基于语法的最先进的sep技术。天狼星的准确率为0.710,召回率为0.565,f1得分为0.630,而最先进的技术的准确率分别为0.470,0.141和0.216。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术官方微信