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

07/09/2021
by   Kunihiro Noda, et al.
0

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.

READ FULL TEXT
research
05/22/2020

DevReplay: Automatic Repair with Editable Fix Pattern

Static analysis tools, or linters, detect violation of source code conve...
research
10/03/2018

FixMiner: Mining Relevant Fix Patterns for Automated Program Repair

Code comprehension is critical in software maintenance. Towards providin...
research
06/21/2019

Harnessing Evolution for Multi-Hunk Program Repair

Despite significant advances in automatic program repair (APR)techniques...
research
07/14/2020

Longitudinal Analysis of the Applicability of Program Repair on Past Commits

The applicability of program repair in the real world is a little resear...
research
10/20/2022

Forest: Structural Code Editing with Multiple Cursors

Software developers frequently refactor code. Often, a single logical re...
research
08/24/2022

Repair Is Nearly Generation: Multilingual Program Repair with LLMs

Most programmers make mistakes when writing code. Some of these mistakes...
research
12/12/2018

Differentially Testing Soundness and Precision of Program Analyzers

In the last decades, numerous program analyzers have been developed both...

Please sign up or login with your details

Forgot password? Click here to reset