[Paper Review] A Survey of Learning-based Automated Program Repair
This survey provides a comprehensive overview of learning-based automated program repair (APR) techniques that leverage deep learning to automatically generate code patches by treating APR as a neural machine translation task. It systematically analyzes key components—fault localization, patch generation, ranking, validation, and correctness—while highlighting datasets, evaluation metrics, and practical challenges, offering actionable guidelines for future research in explainable and feature-enhanced APR systems.
Automated program repair (APR) aims to fix software bugs automatically and plays a crucial role in software development and maintenance. With the recent advances in deep learning (DL), an increasing number of APR techniques have been proposed to leverage neural networks to learn bug-fixing patterns from massive open-source code repositories. Such learning-based techniques usually treat APR as a neural machine translation (NMT) task, where buggy code snippets (i.e., source language) are translated into fixed code snippets (i.e., target language) automatically. Benefiting from the powerful capability of DL to learn hidden relationships from previous bug-fixing datasets, learning-based APR techniques have achieved remarkable performance. In this paper, we provide a systematic survey to summarize the current state-of-the-art research in the learning-based APR community. We illustrate the general workflow of learning-based APR techniques and detail the crucial components, including fault localization, patch generation, patch ranking, patch validation, and patch correctness phases. We then discuss the widely-adopted datasets and evaluation metrics and outline existing empirical studies. We discuss several critical aspects of learning-based APR techniques, such as repair domains, industrial deployment, and the open science issue. We highlight several practical guidelines on applying DL techniques for future APR studies, such as exploring explainable patch generation and utilizing code features. Overall, our paper can help researchers gain a comprehensive understanding about the achievements of the existing learning-based APR techniques and promote the practical application of these techniques. Our artifacts are publicly available at \url{https://github.com/QuanjunZhang/AwesomeLearningAPR}.
Motivation & Objective
- To provide a systematic and up-to-date survey of learning-based automated program repair (APR) techniques driven by deep learning.
- To analyze the core components of learning-based APR pipelines: fault localization, patch generation, ranking, validation, and correctness checking.
- To evaluate and compare widely used datasets and benchmarking metrics in the APR community.
- To discuss critical challenges such as repair domain generalization, industrial applicability, and open science practices.
- To offer practical research guidelines for future APR work, including explainable patch generation and effective code feature utilization.
Proposed method
- Models APR as a neural machine translation (NMT) task, where buggy code is the source sequence and fixed code is the target sequence.
- Utilizes pre-trained models such as CodeBERT, GraphCodeBERT, and T5 to encode and generate code patches using transformer-based architectures.
- Employs sequence-to-sequence (Seq2Seq) models with attention mechanisms to learn mapping from buggy to correct code snippets.
- Integrates fault localization techniques (e.g., spectrum-based or deep learning-based) to identify likely faulty code regions before patch generation.
- Applies post-generation validation and ranking modules using static analysis, dynamic testing, or LLM-based verification to filter incorrect patches.
- Leverages large-scale open-source code repositories (e.g., defects4j, CodeForces, Java-100k) for pre-training and fine-tuning of models.
Experimental results
Research questions
- RQ1What are the key architectural and methodological components in state-of-the-art learning-based APR systems?
- RQ2How do different deep learning models perform across various bug types and programming languages?
- RQ3What are the most widely used datasets and evaluation metrics in learning-based APR research?
- RQ4What are the main challenges in deploying learning-based APR in industrial settings?
- RQ5How can explainability and code-specific features improve the reliability and interpretability of learned patches?
Key findings
- Learning-based APR techniques achieve significant improvements over traditional pattern-based methods, especially in handling diverse and unseen bug patterns.
- Models fine-tuned on large-scale code repositories like defects4j and Java-100k show higher patch generation accuracy and broader language support.
- The use of pre-trained code models (e.g., CodeBERT, GraphCodeBERT) significantly enhances performance in both fault localization and patch generation.
- Patch validation and ranking modules are critical for reducing false positives, with dynamic testing and LLM-based verification improving correctness rates.
- Despite progress, generalization to unseen bug types and industrial-scale systems remains a major challenge.
- The survey identifies a gap in explainable patch generation and calls for greater integration of code-specific features to improve model transparency and reliability.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.