arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2107.04234cs.SE
收藏

Sirius:基于依赖图的系统化编辑模式的静态程序修复

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

Kunihiro Noda, Haruki Yokoyama, Shinji Kikuchi

摘要:

软件开发通常涉及系统编辑,对许多代码位置进行类似但不相同的更改,这对开发人员来说是容易出错和费力的。从过去的代码更改中挖掘和学习这种系统编辑模式(SEP)使我们能够检测和修复被忽视的需要系统编辑的错误代码。最近的一项研究提出了一种有前途的SEP挖掘技术,该技术基于程序依赖图(PDG),而传统的方法利用基于语法的表示。基于PDG的SEP具有高度的表达性,并且可以捕获比基于语法的SEP更有意义的变化。下一个要解决的挑战是将与基于PDG的SEP中相同的代码更改应用于其他代码位置;检测和修复需要系统编辑的被忽略的位置。现有的程序转换技术不能很好地解决这一挑战,因为(1)它们期望在基于PDG的SEP中不能保证的许多结构代码相似性,或者(2)它们基于PDG工作但限于特定域(例如,API迁移)。我们在本文中提出了一个通用的程序转换算法,应用PDG为基础的SEP。我们的算法确定了一个小的可移植的结构子树为每个PDG节点,从而适应代码的变化,从基于PDG的SEP到其他位置。我们构建了一个程序修复管道Sirius,它结合了该算法并自动化了挖掘SEP的过程,检测需要系统编辑的被忽视的代码位置(错误),并通过应用SEP修复它们。我们评估了Sirius的修复性能与超过80个存储库组成的开源软件语料库。Sirius的精确度为0.710,召回率为0.565,F1得分为0.630,而最先进的技术分别为0.470,0.141和0.216。

英文摘要:

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. 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑