Beep: Fine-grained Fix Localization by Learning to Predict Buggy Code Elements

11/15/2021
by   Shangwen Wang, et al.
0

Software Fault Localization refers to the activity of finding code elements (e.g., statements) that are related to a software failure. The state-of-the-art fault localization techniques, however, produce coarse-grained results that can deter manual debugging or mislead automated repair tools. In this work, we focus specifically on the fine-grained identification of code elements (i.e., tokens) that must be changed to fix a buggy program: we refer to it as fix localization. This paper introduces a neural network architecture (named Beep) that builds on AST paths to predict the buggy code element as well as the change action that must be applied to repair a program. Leveraging massive data of bugs and patches within the CoCoNut dataset, we trained a model that was (1) effective in localizing the buggy tokens with the Mean First Rank significantly higher than a statistics based baseline and a machine learning-based baseline, and (2) effective in predicting the repair operators (with the associated buggy code elements) with a Recall@1= 30-45 by CoCoNut, ManySStuBs4J, and Defects4J datasets). To showcase how fine-grained fix localization can help program repair, we employ it in two repair pipelines where we use either a code completion engine to predict the correct token or a set of heuristics to search for the suitable donor code. A key strength of accurate fix localization for program repair is that it reduces the chance of patch overfitting, a challenge in generate-and-validate automated program repair: both two repair pipelines achieve a correctness ratio of 100 all generated patches are found to be correct. Moreover, accurate fix localization helps enhance the efficiency of program repair.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/03/2019

Can Automated Program Repair Refine Fault Localization?

Software bugs are prevalent in modern software systems and notoriously h...
research
09/01/2023

Copiloting the Copilots: Fusing Large Language Models with Completion Engines for Automated Program Repair

During Automated Program Repair (APR), it can be challenging to synthesi...
research
08/03/2020

On the Efficiency of Test Suite based Program Repair: A Systematic Assessment of 16 Automated Repair Systems for Java Programs

Test-based automated program repair has been a prolific field of researc...
research
04/24/2023

ITER: Iterative Neural Repair for Multi-Location Patches

Automated program repair (APR) has achieved promising results, especiall...
research
07/20/2021

A Hybrid Approach to Fine-grained Automated Fault Localization

Fault localization is to identify faulty source code. It could be done o...
research
06/10/2023

Automated Code Editing with Search-Generate-Modify

Code editing is essential in evolving software development. Many automat...
research
02/11/2022

A Quick Repair Facility for Debugging

Modern development environments provide a widely used auto-correction fa...

Please sign up or login with your details

Forgot password? Click here to reset