Neural Program Repair by Jointly Learning to Localize and Repair
By Marko Vasic, Aditya Kanade, Petros Maniatis, David Bieber, Rishabh Singh. 2019
138 citations recorded by the source corpus.
Due to its potential to improve programmer productivity and software quality, automated program repair has been an active topic of research. Newer techniques harness neural networks to learn directly from examples of buggy programs and their fixes. In this work, we consider a recently identified class of bugs called variable-misuse bugs. The state-of-the-art solution for variable misuse enumerates potential fixes for all possible bug locations in a program, before selecting the best prediction. We show that it is beneficial to train a model that jointly and directly localizes and repairs variable-misuse bugs. We present multi-headed pointer networks for this purpose, with one head each for localization and repair. The experimental results show that the joint model significantly outperforms an enumerative solution that uses a pointer based model for repair alone.
Subfields: Artificial Intelligence, Electrical and Electronic Engineering, Information Systems, Program Analysis & Verification
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Artificial Intelligence
- Percy Liang
- Miltiadis Allamanis
- Charles Sutton
- Uri Alon
- Nan Duan
- Graham Neubig
- Jianfeng Gao
- Rishabh Singh
In Electrical and Electronic Engineering
- Petros Maniatis
- Aditya Kanade
- Charles Sutton
- Kensen Shi
- A. Aiken
- Percy Liang
- Daniel Tarlow
- Eran Yahav
In Information Systems
- Miltiadis Allamanis
- Charles Sutton
- Prem Devanbu
- Uri Alon
- Rishabh Singh
- Vincent J. Hellendoorn
- Percy Liang
- Eran Yahav
In Program Analysis & Verification
- Rishabh Singh
- Aditya Kanade
- Petros Maniatis
- Eran Yahav
- Prem Devanbu
- Uri Alon
- Charles Sutton
- Miltiadis Allamanis
Citations in the corpus
- Break-It-Fix-It: Unsupervised Learning for Program Repair (2021, background): “As labeled data is costly to prepare, various works study learning code fixers from unlabeled or synthetic data (Pu et al., 2016; Parihar et al., 2017; Ahmed et al., 2018; Pradel & Sen, 2018; Wang et al., 2018; Vasic et al., 2019; Gupta et al., 2019; Hajipour et al., 2019; Hellendoorn et al., 2020).”
- Graph-based, Self-Supervised Program Repair from Diagnostic Feedback (2020, background): “Finally, several works focus on repairing specific types of bugs, e.g., variable misuse (Vasic et al., 2019), name-based bugs (Pradel & Sen, 2018) and Javascript bugs (Dinella et al., 2020).”
- SPoC: Search-based Pseudocode to Code (2019, background): “Many recent work that uses neural models to localize errors has focused on localizing and correcting syntax errors [12] or a class of well-defined semantic errors such as variable misuse and variable replace [1, 7, 25].”
- CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generation (2021, background): “• code-code (clone detection [65, 84, 46, 80, 9, 89, 86], defect detection [91, 55, 51, 42, 78, 79], cloze test [15], code completion [57, 1, 56, 66, 67, 8, 27, 7], code repair [69, 4, 23, 26, 71, 73], and code-to-code translation [48, 37, 10, 41]) • text-code (natural language code search [32, 20, ”
- WILDS: A Benchmark of in-the-Wild Distribution Shifts (2020, neutral): “…various ways: automatic code completion (Raychev et al., 2014; Svyatkovskiy et al., 2019), program synthesis (Bunel et al., 2018; Kulal et al., 2019), program repair (Vasic et al., 2019; Yasunaga and Liang, 2020), code search (Husain et al., 2019), and code summarization (Allamanis et al., 2015).”
- Learning to Fix Build Errors with Graph2Diff Neural Networks (2019, methodology): “Graph2Tocopo is a single abstraction that unifies ideas from many recent works in modelling source code [3, 4, 8, 22, 35, 44].”
- Learning semantic program embeddings with graph interval neural network (2020, methodology): “Later, the joint model proposed by [Hellendoorn et al. 2020; Vasic et al. 2019] has achieved better results and thus becomes the new state-of-the-art.”
- Global Relational Models of Source Code (2020, methodology): “General: All of our models follow the structure proposed by Vasic et al. (2019), stacking an initial token-embedding layer, a ‘core’ model that computes a distributed representation of the code under inspection (in their case, an LSTM), followed by a projection into two pointers for the localization”
- Typilus: neural type hints (2020, background): “Recent work has focused on detecting specific kinds of bugs, such as variable misuses and argument swappings [5, 20, 50, 53, 58] showing that “soft” patterns contain valuable information that can catch many real-life bugs that would not be otherwise easy to catch with formal program analysis.”
- Neural Attribution for Semantic Bug-Localization in Student Programs (2019, background): “Another recent work [26] proposed a multi-headed LSTM pointer network for joint localization and repair of variable-misuse bugs.”
- Pre-trained Contextual Embedding of Source Code (2019, methodology): “Variable Misuse Localization and Repair As an instance of a non-classification task, we consider the joint classification, localization and repair version of the variable misuse task from Vasic et al. (2019).”
- Hoppity: Learning Graph Transformations to Detect and Fix Bugs in Programs (2020, unknown): “, 2015) and statistical, data-driven techniques (Allamanis et al., 2018; Pradel & Sen, 2018; Vasic et al., 2019).”
- PLUR: A Unifying, Graph-Based View of Program Learning, Understanding, and Repair (2021, background): “Other tasks require the ability to point to the input, e.g., to localize a bug [Vasic et al., 2019, Hellendoorn et al., 2020], or point to where an edit must take place [Dinella et al., 2020].”
- Patching as Translation: the Data and the Metaphor (2020, background): “On the other hand, our results shed light on the feasibility of another competing approach: repairing bugs by synthesizing edits of code conditional on the buggy context [8, 29, 31].”
- Multi-task Learning based Pre-trained Language Model for Code Completion (2020, methodology): “Thus, statistical language models have been used for source code modeling [19, 42, 46], benefiting many software engineering tasks, including code summarization [23, 49], code clone detection [51, 52] program repair [15, 47], especially, in code completion [17, 19, 27, 46].”
- RepairAgent: An Autonomous, LLM-Based Agent for Program Repair (2024, unknown): “Approaches include neural machine translation models that map buggy code into fixed code [11], [12], [13], [14], models that predict tree transformations [15], [16], neural architectures for specific kinds of bugs [54], and repair-specific training regimes [55], [38].”
- Learning and Evaluating Contextual Embedding of Source Code (2019, methodology): “The localization and repair task, defined for variable-misuse bugs (Vasic et al., 2019), is a pointer-prediction task.”
- Neural Edit Completion (2020, methodology): “…representation, essentially learning from the flat token stream [Allamanis et al. 2016; Chen et al. 2019; Iyer et al. 2016; Tufano et al. 2018; Vasic et al. 2019]; although this allows leveraging NLP learning approaches, such models do not leverage the rich syntax of programming languages,…”
- The growing cost of deep learning for source code (2021, background): “19 Lachaux et al.’s work indicates where this trend may be headed next: learning from larger data sources with relatively little supervision.”