Source-linked AI summary

A Survey of Learning-based Automated Program Repair

Quanjun Zhang, Chunrong Fang, Yuxiang Ma, Weisong Sun, Zhenyu Chen

arXiv:2301.03270v3cs.SE

TL;DR

Learning-based automated program repair is rapidly expanding, but its techniques, datasets, metrics, and challenges require systematic synthesis. This paper surveys the field, analyzes 112 studies and 53 datasets, and outlines its workflow, empirical evidence, and future directions. It provides a comprehensive overview of current progress and limitations to support further research.

  • Problem

    Learning-based automated program repair lacks a comprehensive synthesis of its techniques, datasets, metrics, empirical studies, and challenges despite the high cost of manual debugging.

    Source: §1 · pp. 2–3
  • Method

    The paper systematically analyzes 112 studies, reviews learning-based repair workflows and components, and examines 53 datasets, evaluation metrics, and empirical studies.

    Source: §1 · p. 3, §2 · p. 5, §9 · p. 57
  • Results

    The survey synthesizes the current progress, advantages, limitations, and challenges of learning-based automated program repair and identifies directions for future study.

    Source: §1 · p. 3, §9 · p. 57
  • Takeaways & Limitations

    The review gives researchers an overview of learning-based repair practices and highlights challenges and possible directions for advancing the field.

    Source: §1 · p. 3, §9 · p. 57

    Learning-based repair models can struggle with long-term dependencies because broad code context introduces noise and large vocabularies.

    Source: §4.3.1 · p. 11

Abstract

from arXiv · show

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

1 INTRODUCTION

Learning-based APR addresses costly, growing software-bug repair demands by using deep learning to learn bug-fixing patterns, but its diverse datasets, representations, architectures, and metrics complicate progress. This survey organizes the field’s techniques, evidence, challenges, applications, and future directions through an analysis of 112 studies.

Motivation

  • Software bugs are increasingly costly and numerous, while manual debugging is time-consuming, error-prone, and accounts for over 50% of development costs.Source: §1 · p. 2

Traditional APR

  • Traditional pattern-based APR relies on manually crafted, bug-specific templates, limiting its applicability to unseen bugs despite substantial progress [208].Source: §1 · p. 2

Learning-based APR

  • Learning-based APR treats repair as neural machine translation, translating buggy into correct code with encoder-decoder models that learn patterns from large code corpora.Source: §1 · p. 2

Challenges

  • The survey addresses fragmented design choices across datasets, code representations, architectures, preprocessing, and evaluation metrics that hinder reproducibility and follow-up research.These choices include sequence, tree, and graph representations; RNN, LSTM, and transformer architectures; and execution- or match-based metrics.Source: §1 · pp. 2–3

Survey scope

  • The paper analyzes 112 studies and surveys learning-based APR workflows, datasets, metrics, empirical findings, applications, industrial deployments, pre-trained models, open science, and research challenges.Its coverage includes fault localization, preprocessing, patch generation, ranking, validation, and correctness, alongside 53 datasets and two metric categories.Source: §1 · p. 3

Positioning

  • Unlike earlier surveys focused mainly on traditional APR, this work centers on deep-learning integration, repair domains, challenges, and studies published through November 2022.Source: §1 · p. 3

2 SURVEY METHODOLOGY

The survey follows a systematic literature-review methodology, combining structured database searches with filtering, manual screening, and snowballing. The resulting corpus contains 112 learning-based APR papers and reveals rapid growth since 2020 alongside broad programming-language coverage led by Java.

Search Process

  • The search combined APR- and DL-related keywords across Google Scholar, ACM Digital Library, IEEE Explorer, a community-driven website, and Monperrus’s living APR review.The strategy used title-derived frequent terms to improve relevance and efficiency over purely manual searching.Source: §2 · p. 4

Study selection

  • After excluding pre-2016, short, duplicate, and irrelevant studies, screening reduced 283 papers to 87 and produced 112 after snowballing.The authors manually examined references to recover missed studies, including SampleFix, and present the collection workflow in Figure 1.Source: §2 · pp. 4–5

Trend Observation

  • Collected learning-based APR papers increased rapidly after 2020, reflecting growing interest in deep learning as traditional APR reached a plateau.The authors also relate this growth to deep learning’s success in tasks such as natural-language translation.Source: §2 · p. 5, Figure 2 · p. 5
  • Java dominates the surveyed repair targets, while the corpus also spans JavaScript, Python, C, and C++, including multilingual repair studies.The authors associate Java’s prominence with its widespread adoption and representation in mature datasets such as Defects4J.Source: §2 · p. 5, Figure 3 · p. 5

3 BACKGROUND AND CONCEPTS

This section defines automated program repair as finding minimal specification-satisfying program changes, describes conventional patch-generation approaches and workflow limitations, and formulates learning-based repair as neural machine translation.

3.1 Automated Program Repair

  • The typical APR workflow localizes suspicious code, generates candidate patches through transformations, and validates them with the original tests, distinguishing plausible from semantically correct patches.A plausible patch passes the tests, while correctness additionally requires semantic equivalence to the developer patch.Source: Figure 4 · p. 6, §3.1 · p. 6
  • APR finds a program variant satisfying its specification while remaining within a maximum edit distance from the buggy program.Test suites commonly serve as specifications, and the edit-distance limit reflects the competent programmer hypothesis; distance 0 yields validation, whereas infinite distance yields synthesis.Source: §3.1 · p. 6
  • Incomplete test-suite specifications make plausible-patch correctness difficult, creating an overfitting problem that complicates both traditional and learning-based APR.Manually identifying overfitting patches is time-consuming and can harm developers’ debugging performance.Source: §3.1 · pp. 6–7

3.1.1 Patch Generation Techniques.

  • Traditional patch generation comprises heuristic-based search, constraint-based synthesis, and pattern-based templates, while deep learning increasingly leverages large open-source repositories for repair.Examples include SimFix, Nopol and Cardumen, and TBar, respectively.Source: §3.1.1 · p. 7

3.2 Neural Machine Translation

  • Learning-based APR formulates repair as Seq2Seq neural machine translation from buggy code X to fixed code Y, optimizing the conditional probability P(Y|X).Existing approaches use RNNs and LSTMs, while Transformers are considered state-of-the-art because of self-attention.Source: §3.2 · pp. 7–8

4 LEARNING-BASED APR

This section presents the workflow of learning-based APR tools and introduces popular techniques through examples.

  • It explains the workflow used by learning-based APR tools.Source: §4 · p. 8
  • It introduces several popular learning-based APR techniques.Source: §4 · p. 8
  • Examples are provided to illustrate the discussed techniques.Source: §4 · p. 8

4.1 Overall Workflow

Learning-based APR follows a workflow from fault localization and code preprocessing through neural patch generation, ranking, validation, and correctness assessment. Each phase transforms, prioritizes, verifies, or evaluates candidate patches for potential deployment.

Fault Localization and Preprocessing

  • Fault localization identifies suspicious code elements in the buggy program, while preprocessing converts buggy snippets into processed tokens using context, abstraction, or tokenization.Context preserves correlated non-buggy lines, abstraction reduces vocabulary by renaming literals, and tokenization splits code into words or subwords mapped to IDs.Source: §4.1 · p. 8

Patch Generation

  • Patch generation embeds processed tokens, encodes their hidden representations, and decodes them into vocabulary probability distributions while learning bug-fixing patterns through unsupervised or self-supervised training.The encoder captures token semantics and positions, and the decoder uses encoder states plus previously generated tokens.Source: §4.1 · pp. 8–9

Patch Ranking

  • Patch ranking uses strategies such as beam search to prioritize candidate patches by iteratively selecting high-scoring tokens according to estimated likelihoods.Beam search commonly retains several top-scoring candidate patches during decoding.Source: §4.1 · p. 9

Patch Validation

  • Patch validation verifies generated candidates against available program specifications, including functional test suites and static analysis tools.This phase filters candidates according to whether they satisfy the available specification.Source: §4.1 · p. 9

Patch Correctness Assessment

  • Patch correctness assessment predicts whether specification-passing plausible patches overfit, after which developers manually check them before software-pipeline deployment.Passing the existing specification establishes plausibility but does not necessarily establish correctness.Source: §4.1 · p. 9

4.2 Fault Localization

Fault localization is the starting point of learning-based APR and substantially influences patch-generation performance. Existing approaches commonly use spectrum-based localization, while perfect or coarse-grained localization can reduce localization noise and support repair at different program-element granularities.

4.2.1 Localization Techniques.

  • Spectrum-based fault localization ranks program elements using passing and failing test coverage, and remains the most widely used mechanism in learning-based APR.Common techniques include spectrum-, mutation-, slicing-, and learning-based localization; SBFL uses runtime information to identify elements executed by more failing and fewer passing tests.Source: §4.2 · p. 9, §4.2.1 · pp. 9–10
  • Perfect-based localization assumes the genuine buggy element is known, providing an assessment independent of localization techniques but potentially introducing evaluation bias.CoCoNut, CIRCLE, CURE [73], SelfAPR, and AlphaRepair use manually identified changed statements or similar perfect-localization processing.Source: §4.2.1 · p. 10

4.2.2 Localization Granularity.

  • Learning-based APR generally localizes at the repair granularity, most often lines, while some methods use end-to-end or deep-learning localization and others provide only the buggy method.Examples include DeepFix, Prophet, Tufano et al., and the approach of Meng et al..Source: §4.2.1 · p. 10, §4.2.2 · p. 10

4.2 Fault Localization

  • Fault localization directly affects repair performance because a wrong suspicious code element prevents generation of a correct patch.As the preceding APR step, localization supplies the repair model with information about where the bug is.Source: §4.2 · p. 9, §4.2.2 · p. 10

4.3 Data Pre-processing

Data preprocessing converts identified buggy snippets into tokenized inputs for neural repair models through code context, abstraction, and tokenization. These configuration choices affect available information, vocabulary size, model efficiency, and evaluation comparability.

4.3 Data Pre-processing

  • Data preprocessing analyzes buggy snippets and returns processed code tokens for neural-network training and inference through context, abstraction, and tokenization [28].The phase transforms a buggy code snippet, such as a buggy function, into a format consumed by repair models.Source: §4.3 · p. 10

4.3.1 Code Context.

  • Context balances information and noise: broad context supplies fix ingredients but worsens long-term dependencies, whereas narrow context may lack vocabulary; four granularities are used.These granularities are context-free, statement-level, method-level, and class-level; method-level is most common because it often contains sufficient repair information.Source: §4.3.1 · p. 11

4.3.2 Code Abstraction.

  • Code abstraction renames identifiers and literals to reduce vocabulary and irrelevant information while preserving semantics, but raw code and copy mechanisms can retain valuable naming information [28].Approaches include lexer-parser abstraction, literal abstraction, variable alpha-renaming, placeholders, and copy-based generation for rare tokens.Source: §4.3.2 · pp. 12–13

4.3.3 Code Tokenization.

  • Tokenization converts code into token IDs; word-level methods face out-of-vocabulary risks, while subword methods such as BPE, BBPE, and SentencePiece reduce vocabulary size.BPE is widely adopted and mitigates OOV problems by iteratively merging frequent pairs; BBPE uses bytes, while SentencePiece processes raw input streams.Source: §4.3.3 · pp. 13–14
  • Different preprocessing configurations may bias evaluations, and their optimal combination and interactions with model architectures and bug types remain open questions.The configurations vary across raw or abstracted code, context granularity, and tokenizer choice.Source: §4.3.3 · p. 14

4.4 Patch Generation

Learning-based APR patch generation centers on code representation and encoder-decoder architecture: techniques represent code as sequences, trees, or graphs and learn transformations from buggy to fixed code. The literature has not established a universally best representation or architecture.

4.4.1 Sequence-based Generation.

  • Sequence-based techniques translate token sequences with Seq2Seq models, using raw, context, prompt, or mask representations and architectures such as LSTM, convolutional, transformer, and pretrained models.Raw representations may confuse buggy code with context, context representations require merging separate encodings, prompts bridge pretrained tasks to APR, and masks enable cloze-style repair without additional bug-fixing training.Source: §4.4.1 · pp. 15–16

4.4.2 Tree-based Generation.

  • Tree-based techniques parse code into ASTs or traversal sequences and use tree-aware models to capture syntax and structural changes during patch generation.Approaches include AST context and subtrees, grammar-rule sequences, and tree-based encoders such as tree RNNs and sequential bidirectional LSTMs.Source: §4.4.2 · pp. 16–17

4.4.3 Graph-based Generation.

  • Graph-based techniques model AST, data-dependence, and control-dependence relationships as graph transformations using graph neural networks such as GGNNs.Recoder captures AST child and sibling relations, while other methods fuse data- and control-dependence graphs to generate graph edits corresponding to corrected code.Source: §4.4.3 · p. 17

4.4 Patch Generation

  • Patch generation primarily depends on choosing a code representation and model architecture that learn transformations from buggy code to correct code.Representations include sequences, trees, and graphs, paired with corresponding neural architectures.Source: §4.4 · pp. 14–15, §4.4.3 · p. 17

4.4.3 Graph-based Generation.

  • Although sequence, tree, and graph methods use increasingly structure-aware representations, existing literature does not show which representation or architecture performs best.The survey identifies controlled comparison across representations and corresponding architectures as an open research need.Source: §4.4.2 · p. 16, §4.4.3 · p. 17

4.5 Patch Ranking

Patch ranking prioritizes likely-correct candidates to reduce validation effort and improve inference efficiency. Beam search dominates learning-based APR, while code-aware and learned alternatives incorporate program information to improve candidate quality.

Motivation

  • Patch ranking reduces the impractical burden of validating up to V^l generated candidates by prioritizing high-probability patches for inspection.Inspecting only a small set, such as Top-1 or Top-5 candidates, reduces manual assessment effort.Source: §4.5 · pp. 17–18

Beam Search

  • Beam search is the most common ranking strategy in learning-based APR, selecting k likely tokens at each iteration and trading repair accuracy against inference cost through beam size.It ranks candidates using likelihood estimates over a search depth d and outputs the top k patches for validation.Source: §4.5 · p. 18

Advanced Ranking Strategies

  • Code-aware and filtering-based methods address vanilla beam search’s tendency to generate high-scoring but uncompilable patches by using valid identifiers, length control, program analysis, or semantic filters.CURE [73], DLFix, and DEAR [99] improve candidate filtering or ranking with code-related information.Source: §4.5 · p. 18

Alternative Ranking Methods

  • Prophet and AlphaRepair use learned ranking alternatives, respectively based on designed features and masked-language-model token probabilities.AlphaRepair computes a joint priority score by averaging conditional probabilities obtained after masking generated tokens.Source: §4.5 · p. 18

Future Directions

  • Future patch-ranking methods should jointly ensure effectiveness through sufficient search coverage, efficiency through fast retrieval, and priority through code syntactic and semantic information.The survey notes that most existing techniques still use vanilla beam search and that systematic research on ranking’s effect on repair performance remains limited.Source: §4.5 · pp. 18–19

4.6 Patch Validation

Patch validation filters ranked candidate patches by recompiling programs and executing available tests, identifying plausible patches for deployment. Because validating thousands of patches is costly, recent work uses candidate limits, time bounds, execution optimizations, and patch-priority strategies.

Test-based validation

  • Most learning-based APR techniques use test-based validation to reject uncompilable patches and retain patches passing all available tests, as in CIRCLE, Recoder, CoCoNut, and CURE [73].Validation checks that previously passing tests remain passing and fault-triggering tests pass after patching, stopping when a plausible patch is found.Source: §4.6 · p. 19

Validation cost control

  • Validating hundreds or thousands of candidate patches is time-consuming, so systems constrain candidate counts or impose validation time limits.CURE [73] validates the top 5,000 of 10,000 generated patches per bug, while RewardRepair, SelfAPR, and Recoder use beam sizes or outputs of 200, 50, and 100 patches, respectively; DEAR [99] and DLFix impose five-hour limits.Source: §4.6 · p. 19

Execution optimization

  • UniAPR [25], used by AlphaRepair, accelerates JVM patch validation through HotSwap, Java Agents, and JVM resetting after each execution.The framework supports on-the-fly validation at source and byte-code levels while addressing imprecision caused by persistent JVM state.Source: §4.6 · p. 19

Patch-priority and validation studies

  • SeAPR updates patch-priority scores from execution similarity to earlier high- or low-quality patches and substantially speeds up studied APR techniques with stable performance across scoring formulae.Earlier validation optimizations include weak recompilation in WAutoRepair and fault-informed test prioritization in TrpAutoRepair, with potential extension to learning-based repair.Source: §4.6 · pp. 19–20

Research outlook

  • Patch validation remains largely shared with traditional APR because executing test cases can assess patches independently of their generation method, motivating learning-based-specific validation research.Dynamic execution is standard for checking compilability and functional correctness, but its cost is especially high when APR processes thousands of patches and many tests.Source: §4.6 · p. 20

4.7 Patch Correctness

Patch correctness assessment addresses APR’s persistent overfitting problem because test suites incompletely specify program behavior. Learning-based APCA methods increasingly combine code-feature extraction with classifiers or similarity models, achieving encouraging results across languages and benchmarks while remaining important for practical deployment.

Motivation and challenges

  • Patch correctness is necessary because test suites incompletely specify program behavior, allowing plausible patches to overfit; this problem is especially severe for black-box learning-based APR and burdens developers with manual filtering.Qi et al. found that many overfitting patches for 105 C bugs simply deleted buggy functionality rather than fixing the defects.Source: §4.7 · p. 20

Summary and outlook

  • Existing learning-based APCA studies summarized in Table 1 generally use a feature extractor and classifier, but overfitting still limits practical deployment and motivates patch-aware features and stronger pretrained models.Features include hand-crafted, static-representation, and dynamic-execution information, while classifiers perform binary prediction.Source: Table 1 · p. 21, §4.7 · pp. 21, 23, 24

Learning-based APCA approaches

  • APCA methods evolved from static or dynamic similarity strategies toward deep learning classifiers, while Csuvik et al. filtered 45% (16/35) of incorrect QuixBugs patches using embedding similarity.PATCH-SIM compares execution traces, whereas static approaches compare transformation patterns or syntactic representations.Source: §4.7 · pp. 21–22
  • Leopard and Panther show the promise of representation learning, with BERT plus XGBoost reaching about 0.803 AUC on 2,147 labeled patches and Panther improving over Leopard by combining embeddings with engineered features.ODS uses 202 AST-based static features and achieves 71.9% accuracy across 26 projects, outperforming PATCH-SIM.Source: §4.7 · p. 22
  • CACHE, BATS, QUATRAIN, and Crex improve patch-correctness assessment through context-aware embeddings, failing-test similarity, bug-report semantics, and C-program execution semantics.CACHE outperforms earlier representation-learning and traditional APCA methods; BATS outperforms existing techniques; QUATRAIN is comparable or better than PATCH-SIM and BATS; Crex achieves high precision and recall.Source: §4.7 · pp. 22–23
  • Shibboleth outperforms existing patch-ranking and classification techniques by combining static, dynamic, and test-coverage measures in ranking and classification modes.It uses token similarity, execution-trace similarity, and passing-test branch coverage to assess patch correctness.Source: §4.7 · p. 23

4.8 State-of-the-Arts

This section surveys representative learning-based APR techniques for semantic bugs, syntax bugs, and security vulnerabilities, covering sequence-, tree-, graph-, reinforcement-, self-, and unsupervised-learning approaches. It highlights end-to-end neural machine translation, security-property-aware vulnerability repair, and systems for repairing student programming errors.

4.8 State-of-the-Arts

  • The surveyed approaches primarily target semantic errors, where functional tests detect unexpected behavior, while syntax-error repair addresses compiler failures and vulnerability repair addresses exploitable security flaws.Representative techniques and their bug types, languages, localization methods, preprocessing, representations, models, and ranking strategies are summarized in Table 2.Source: §4.8.1 · p. 24, §4.8 · p. 24, §4.8.3 · p. 31

4.8.1 Semantic error repair.

  • Sequence-based semantic repair evolves from Tufano et al.’s NMT learning of meaningful code changes, which reproduces patches for 36% of pull requests, to CURE fixing 57 Defects4J and 26 QuixBugs bugs.SequenceR uses fault localization, context abstraction, and copying, outperforming Tufano et al.’s approach on Defects4J; CURE combines pretraining, code-aware beam search, and sub-word tokenization.Source: §4.8.1 · pp. 24, 26
  • RewardRepair fixes 207 bugs across four benchmarks, including 121 not repaired by DLFix, CoCoNut, or CURE, and raises Top-30 compilability to 45.3% versus CURE’s 39%.Its discriminator uses compilation and test-execution feedback to reward higher-quality patches during training.Source: §4.8.1 · pp. 26–27
  • Semantic-error repair advances from sequence models to tree and graph representations, with CODIT, DLFix, DEAR, HOPPITY, DrRepair, GRAPHIX, and Recoder exploiting structural or dependency information.CODIT outperforms sequence-based models; DLFix treats repair as AST transformation; DEAR fixes 164 more bugs than DLFix, including 61 multi-hunk or multi-statement bugs; graph-based methods also outperform cited baselines.Source: §4.8.1 · pp. 27–28
  • Recoder correctly repairs 53 Defects4J v1.2 bugs, 11 more than TBar and 19 more than SimFix, and is the first learning-based technique to outperform traditional techniques across four Java benchmarks.Recoder uses syntax-guided graph-based edit decoding and correctly repairs 19 Defects4J v2.0, 35 IntroClassJava, and 17 QuixBugs bugs.Source: §4.8.1 · p. 28

4.8.2 Syntax error repair.

  • DeepFix established end-to-end Seq2Seq syntax-error repair on 6,971 C student programs, while later methods improved generalization, supervision requirements, and structural handling.RLAssist outperforms DeepFix without labeled training data; GGF fixes 50.12% of erroneous code and outperforms DeepFix; BIFI also outperforms DeepFix on Python and C benchmarks.Source: §4.8.2 · pp. 29–30
  • Syntax-repair studies also show gains from language modeling, neuro-symbolic constraints, real-world compilation-error data, and diverse patch generation over n-gram, DeepFix, and RLAssist baselines.DeepDelta generates over half of the correct patches for unseen Java compilation errors, while SampleFix generates diverse fixes for 65% of repaired programs.Source: §4.8.2 · pp. 29–31

4.8.3 Security vulnerability repair.

  • Security-vulnerability repair applies templates, adversarial learning, transfer learning, and domain adaptation to reduce manual effort and labeled-data requirements.VuRLE repairs 101 real-world vulnerabilities with 55.19% accuracy; Harer et al.’s [62] GAN-based method works without paired bug-fixing data; VRepair [28] transfers bug-repair knowledge; SeqTrans adapts from bug-fixing to vulnerability-fixing data and performs well for CWE-287.Source: §4.8.3 · pp. 31–32
  • SPVF combines AST representations with vulnerability security properties extracted from natural-language descriptions and outperforms SeqTrans on two C/C++ and Python datasets.Its pointer generator network explicitly incorporates properties such as CWE categories.Source: §4.8.3 · p. 32

4.8.4 Programming error repair.

  • Bhatia et al. [18] use an RNN to predict suffix tokens after a syntax-error prefix, outperforming configured RNN and LSTM baselines on MOOC student programs.The method trains on syntactically correct programs and provides automated syntax-error feedback.Source: §4.8.4 · p. 32
  • Dynamic program embeddings learn from runtime execution traces to predict error patterns in students’ online programming submissions.Source: §4.8.4 · p. 32
  • TRACER localizes and abstracts buggy C programs before generating repairs, reaching up to 68% accuracy and outperforming DeepFix on IIT-K data.It targets single-line and multi-line bugs to provide more informative feedback for novice programmers.Source: §4.8.4 · p. 33
  • MMAPR [231] uses Codex with multimodal prompts, iterative querying, test-case-based few-shot selection, and program chunking to repair Python semantic and syntax bugs, outperforming BIFI and Refactory.Experiments cover 18 programming assignments.Source: §4.8.4 · p. 33

Overall scope

  • Learning-based APR generally handles semantic, syntax, and security bugs by learning code transformations from bug-fixing pairs without requiring bug-specific models.The approach scales through end-to-end black-box NMT, but remains concentrated on these typical repair domains.Source: §4.8.4 · p. 33

5 PRE-TRAINED MODEL-BASED REPAIR

Pre-trained model-based APR techniques are organized into universal models adapted to repair and specific repair systems, spanning fine-tuning, zero-shot generation, and multilingual or vulnerability-focused repair. These approaches use encoder, decoder, or encoder-decoder architectures and show improved repair performance across several benchmarks and settings.

5.1 Universal Pre-trained Model-based APR Techniques

  • Universal APR commonly uses encoder-decoder models, which generate fixes from buggy code, while encoder-only models require decoders and decoder-only models favor autoregressive prediction.Encoder-only, decoder-only, and encoder-decoder architectures trade off code understanding, autoregressive prediction, and generation capabilities.Source: §5.1 · p. 34
  • CodeT5 supports code understanding and generation through multi-task learning and identifier-aware pre-training that incorporates developers’ identifier semantics.CodeT5 is a T5-based encoder-decoder model designed to support program repair and other code-related tasks.Source: §5.1 · p. 34
  • SPT outperforms CodeBERT, GraphCodeBERT, and Tufano et al. on BFP-small and BFP-medium, while CoditT5 outperforms CodeT5 and PLBART across three downstream tasks.Other universal approaches include T5 fine-tuning, which outperforms Tufano et al. on the same benchmarks, although multi-task fine-tuning does not improve code-related tasks.Source: §5.1 · pp. 34–35

5.2 Specific Pre-trained Model-based APR Techniques

  • TFix generates 67% correct JavaScript patches, significantly outperforming SequenceR and CoCoNut for syntax-error repair.TFix fine-tunes multiple T5 models using line context and error types extracted from GitHub datasets.Source: §5.2 · p. 35
  • Specific systems extend pre-trained repair through compiler-guided syntax repair, continual multilingual learning, zero-shot cloze generation, and vulnerability repair.SynShine outperforms DeepFix and SequenceR and integrates with VSCode; CIRCLE repairs four languages with one model; AlphaRepair works without fine-tuning; and VulRepair repairs the Top-10 most dangerous CWEs.Source: §5.2 · p. 36
  • MODIT generates 29.99% correct BFP-small patches and 23.02% correct BFP-medium patches, outperforming CodeBERT, GraphCodeBERT, and CodeGPT.MODIT combines edit location, code context, and commit messages with PLBART; its improvements are 15.12%, 16.82%, and 5.49% on BFP-small, and 34.38%, 25.72%, and 30.50% on BFP-medium, respectively.Source: §5.2 · p. 36

5 PRE-TRAINED MODEL-BASED REPAIR

  • Pre-trained APR techniques comprise universal models fine-tuned for repair, specific repair systems, and empirical studies spanning models, bug types, and programming languages.The survey identifies CodeT5, T5Learning, and SPT as typical universal models, and CIRCLE and AlphaRepair as fine-tuning and zero-shot examples, respectively.Source: §5 · p. 34, §5.2 · p. 37

6 EMPIRICAL EVALUATION

Learning-based APR relies on large supervised training datasets and smaller evaluation datasets, with metrics spanning execution-based patch validation and token-matching alternatives. Empirical studies show promise from NMT, edit-based models, pretrained models, code representations, and industrial transfer, while exposing dataset-overfitting and evaluation limitations.

6.1 Dataset

  • Learning-based APR separates supervised training on large bug-fixing datasets from evaluation on smaller datasets, with Java dominant but growing multilingual coverage.Evaluation datasets may include test suites, whereas training datasets usually provide bug-fixing pairs; CoCoNut and QuixBugs exemplify multilingual resources.Source: §6.1 · pp. 37, 39, 40

6.2.1 Execution-based Metrics.

  • Execution-based metrics distinguish compilable, plausible, and correct patches, but dynamic validation is time-consuming and unavailable for some large-scale datasets.A plausible patch passes available tests, while a correct patch is equivalent to the developer patch and generalizes beyond the test suite.Source: §6.2.1 · p. 40, §6.2.2 · p. 40

6.2.2 Match-based Metrics.

  • CodeBLEU [161] addresses limitations of accuracy and BLEU by incorporating weighted n-gram, AST, and data-flow matching without dynamic execution.Accuracy@K counts whether any of k beam-search outputs exactly matches the ground truth, whereas BLEU measures n-gram similarity and may miss code semantics.Source: §6.2.2 · pp. 40–41

6.3 Empirical Study

  • NMT models fixed buggy methods in 9%–50% of cases, while edit-based modeling addressed translation-model limitations and produced promising improvement [40].Tufano et al. established an empirical foundation by mining GitHub commits, abstracting code, and training on BFP-small and BFP-medium.Source: §6.3 · pp. 41–42
  • Pretrained models generated patches efficiently, larger models produced more predictable patches, and mixed code representation with Golve embedding outperformed alternatives while bug type affected accuracy.CodeBERT outperformed simple Seq2Seq models on ManySStuBs4J, and larger models including CodeX 12B were evaluated on QuixBugs.Source: §6.3 · pp. 42–43
  • Empirical evaluations found promising PLM repair performance, dataset overfitting in learning-based APCA, industrial gains from TFix transfer, and stronger vulnerability repair from data-flow-aware GraphCodeBERT.TFix fixed 94 of 1,961 defects originally and 289 more after fine-tuning; GraphCodeBERT outperformed CodeBERT and learning-based APR baselines on C/C++ vulnerabilities.Source: §6.3 · p. 43

7 APPLICATION AND DISCUSSION

Section 7 discusses industrial adoption, deep learning enhancements to traditional APR, reproducibility challenges, and post-2022 developments. It highlights growing integration of learning-based methods with production repair systems and established APR workflows, alongside the need for stronger open-science practices.

7.1 Industrial Deployment

  • Industrial APR adoption includes Meta, Fujitsu, Bloomberg, Alibaba, GitHub, and Microsoft, while Getafix [10], R-HERO, BUGLAB [7], DeepDebug [42], and NSEdit [66] emphasize speed, collaboration, self-supervised learning, and advanced machine-learning architectures.Getafix [10] ranks human-like fixes from recurring patterns; BUGLAB [7] uses self-supervised learning; DeepDebug [42] and NSEdit [66] improve neural patch generation.Source: §7.1 · pp. 44–45

7.2 DL for Traditional APR

  • Learning-based APR improves repair through predicate learning, transform inference, ingredient selection, search-based generation, and bug-type localization, with several systems outperforming established approaches in evaluated settings.ACS [213] achieves over 70% precision on Defects4J, versus below 40% for previous approaches; Genesis, ARJANMT, and SituRepair outperform comparison approaches in their evaluations.Source: §7.2 · pp. 47–48

7.3 Open Science

  • Learning-based APR is harder to reproduce because training requires substantial computing resources and neural randomness, while many studies omit code, datasets, models, hyperparameters, or environment documentation.The survey finds that only a few papers provide source code, and some available artifacts remain unreproducible because of missing defaults, complex environments, and insufficient documentation.Source: §7.3 · pp. 48, 50

7.4 The Latest Advancements

  • Recent findings show increasing use of pre-trained models alongside code-context analysis, accelerated patch validation, domain-specific repair, knowledge transfer, and combinations with traditional APR, including Katana, ExpressAPR, SmartFix, RAP-Gen, FitRepair, and Repilot.Katana analyzes control and data dependencies; ExpressAPR significantly reduces patch-validation time; SmartFix repairs vulnerable smart contracts; RAP-Gen, FitRepair, and Repilot support pretrained patch generation.Source: §7.4 · pp. 51–52

8 IMPLICATION AND GUIDELINES

The survey proposes practical guidelines for improving learning-based APR across representations, validation, datasets, evaluation, repair workflows, domains, explainability, and pre-trained models. These recommendations emphasize systematic studies, better integration of static and dynamic information, standardized evaluation, and practical deployment.

I&G❶: Multifarious Code Representation

  • Future APR should systematically compare code representations across configurations, tailor them to languages, bug types, and benchmarks, and combine static features with dynamic feedback and prompts.Existing results show both sequence-based CIRCLE and syntax-guided Recoder can repair many Defects4J bugs, so no single representation is established as universally superior.Source: §8 · pp. 52–53

I&G❷: Patch Validation Acceleration

  • Patch validation should exploit patch-type differences, predictive models, and equivalence-class execution to reduce the cost of dynamically testing every candidate patch.Predictive validation could infer whether patches pass failing tests without execution, while mutation-testing techniques can execute one representative per equivalence class.Source: §8 · p. 53

I&G❸: Training Dataset Construction

  • APR research needs standardized training datasets to reduce noise and sampling bias and enable uniform comparisons across representations, architectures, and hyperparameters.Existing datasets vary from 2,000 samples in DLFix to 3,241,966 in CoCoNut, and may contain duplicated samples.Source: §8 · p. 53

I&G❹: Practical Evaluation Metrics

  • Evaluation should combine dynamic execution and static matching while empirically testing whether Accuracy and BLUE reflect repair capability despite functionally equivalent implementations.Dynamic metrics are costly, require fault-triggering tests, and can overestimate correctness through overfitting; static metrics may miss alternative algorithms, data structures, and data flows.Source: §8 · pp. 53–54

I&G❺: Exploring Patch Overfitting Issue

  • Future work should address severe learning-based APR overfitting through code-aware generation, stronger patch-correctness assessment, contrastive learning, and combinations of DL with fix patterns.Available test suites are incomplete specifications, so plausible patches may violate unseen expected behavior; code embeddings already offer a promising direction.Source: §8 · p. 54

I&G❻–❼: Unified Workflow and Traditional APR

  • APR should unify fault localization and patch generation through feedback, while combining DL with traditional repair can select tools or improve template-based systems such as TBar.Localization can guide generation and generation can refine localization; pre-trained models can supply donor code when traditional tools select inappropriate donors.Source: §8 · pp. 54–55

I&G❽–❾: Domain Repair and Explainability

  • Research should expand to domain-specific repairs, study transfer across related bug types, and make black-box patch generation explainable through attention and input perturbation.Suggested domains include test, concurrency, API-misuse, and vulnerability repair; explanations can identify influential inputs and make predictions more actionable.Source: §8 · pp. 55–56

I&G❿: Pre-trained Model-based APR Research

  • Pre-trained APR research should improve patch-correctness assessment, develop repair-oriented objectives, balance effectiveness against model size, enable practical deployment, and support conversational repair with developer feedback.Repair-oriented models should learn code-change patterns from bug-fixing pairs, while pruning or distillation can reduce resource demands; chatbots can incorporate reports, tool feedback, and dynamic execution information.Source: §8 · pp. 56–57

9 CONCLUSION

Learning-based APR shows substantial potential for automatically fixing software bugs, while this survey synthesizes existing techniques, their repair framework, evaluation practices, challenges, and future directions.

Conclusion

  • Learning-based APR techniques have achieved promising results, demonstrating substantial potential for applying deep learning to automated software repair.APR can alleviate manual debugging effort and promote software testing, validation, and debugging practices.Source: §9 · p. 57
  • This survey covers the learning-based repair framework, component strategies, datasets, metrics, empirical studies, challenges such as overfitting, and future research directions.The framework includes fault localization, data preprocessing, patch generation, patch ranking, validation, and correctness components.Source: §9 · p. 57
Loading 2301.03270v3…