A Metamorphic Testing Approach to Diagnosing Memorization in LLM-Based Program Repair Milan De Koning1 , Ali Asgari2,∗ , Pouria Derakhshanfar,1 , Annibale Panichella2,∗ 1 JetBrains Research, Amsterdam, The Netherlands
arXiv:2604.21579v1 [cs.SE] 23 Apr 2026
2 Delft University of Technology, Delft, The Netherlands
[email protected], [email protected], [email protected], [email protected] *corresponding author
Abstract
LLM-based automated program repair (APR) techniques have shown promising results in reducing debugging costs. However, prior results can be affected by data leakage: large language models (LLMs) may memorize bug fixes when evaluation benchmarks overlap with their pretraining data, leading to inflated performance estimates. In this paper, we investigate whether we can better reveal data leakage by combining metamorphic testing (MT) with negative log-likelihood (NLL), which has been used in prior work as a proxy for memorization. We construct variant benchmarks by applying semantics-preserving transformations to two widely used datasets, Defects4J and GitBug-Java. Using these benchmarks, we evaluate the repair success rates of seven LLMs on both original and transformed versions, and analyze the relationship between performance degradation and NLL. Our results show that all evaluated state-of-the-art LLMs exhibit substantial drops in patch generation success rates on transformed benchmarks, ranging from −4.1% for GPT-4o to −15.98% for Llama-3.1. Furthermore, we find that this degradation strongly correlates with NLL on the original benchmarks, suggesting that models perform better on instances they are more likely to have memorized. These findings show that combining MT with NLL provides stronger and more reliable evidence of data leakage, while metamorphic testing alone can help mitigate its effects in LLM-based APR evaluations.
Keywords—Automated Program Repair, Metamorphic Testing, Large Language Models, Data Leakage, AI for SE
1. Introduction Debugging is a time-consuming activity in software development. Developers report spending 20— 60% of their time on debugging tasks [1], and software failures were estimated to cost $1.56 trillion in the US alone in 2020 [2]. Automating even a portion of this effort could lead to substantial economic and productivity gains. Thus, a growing body of research has focused on Automated Program Repair (APR) [3], with recent advancements using Large Language Models (LLMs) demonstrating remarkable effectiveness across many coding tasks, including program repair [4, 5, 6]. Recent progress in LLM-based program repair has focused on improving patch generation success rates on established benchmarks [6, 5, 7], such as Defects4J [8]. However, emerging evidence suggests that these results may be inflated due to data leakage[9, 10, 11], where evaluation data overlaps with pretraining corpora, allowing LLMs to memorize bug-fix pairs rather than generalize. For example, Ramos et al.[11] show that widely used APR benchmarks likely overlap with the training data of many open-source LLMs. To mitigate data leakage, several studies propose benchmarks built from code committed after model pretraining cutoffs [12, 13, 14]. However, the rapid release cycle of LLMs and the heterogeneity of their training data make leakage difficult to eliminate. Even with time-filtered datasets, overlap may persist, as bug-fixing commits and test cases are often duplicated across blogs, academic papers, and public repositories that are commonly included in pretraining corpora, especially for general-purpose models such as ChatGPT. Consequently, leakage remains hard to detect and prevent, even with carefully curated benchmarks. Moreover, maintaining such datasets requires substantial manual effort and they may still become outdated as models evolve.
In this paper, we present a systematic empirical study of whether metamorphic testing (MT) can be used to analyze and potentially address data leakage in LLMbased APR. In our setting, metamorphic transformations modify the syntactic form of faulty code while preserving its semantics and behavior [15]. Examples include renaming identifiers, reordering statements, or rewriting loops [15, 16]. We then examine whether performance degradation on transformed code is associated with memorization rather than semantic generalization. To guide our study, we formulated and investigated the following research questions:
with NLL-based memorization can provide stronger evidence of data leakage. Our contributions are as follows:
• RQ1: What is the impact of metamorphic transformations on the performance of LLM-based program repair?
• We evaluate two APR benchmarks and seven stateof-the-art LLMs, showing consistent performance degradation under metamorphic transformations and complementary evidence of data leakage when considered alongside memorization signals.
• RQ2: How is the observed LLMs’ performance drop under metamorphic transformations related to potential data leakage in the benchmark code? • RQ3: Which types of code patterns and metamorphic transformations are most indicative of memorization effects in LLM-based program repair? Together, these questions position MT not only as a robustness testing technique but also as a diagnostic tool for identifying performance inflation due to benchmark contamination. To answer them, we study two benchmarks, Defects4J [8] and GitBug-Java [17]. Defects4J is a widely used benchmark for LLM-based APR, but its bugs and fixes predate the cutoff dates of the evaluated LLMs and are therefore more likely to be affected by data leakage. In contrast, GitBug-Java contains more recent defects that are post cutoff dates, making it less likely to overlap with training data [17]. We apply a set of semantics-preserving transformations to both datasets that reflect natural coding variations [18], such as identifier renaming with synonyms [19], as well as control-flow and formatting modifications [20]. We evaluate seven state-of-the-art LLMs on both original and transformed benchmarks: ChatGPT-4o1 , ChatGPT-4o-mini1 , Claude-3.7-Sonnet2 , Llama 3.1 8B [21], Gemma 2 27B [22], Mistral 7B v0.3 [23], and StarCoder 2 7B [24]. All models show reduced success rates on transformed code, with average drops between 4.1% and 15.98% on Defects4J. GitBug-Java exhibits smaller effects, but still shows substantial drops on individual bugs. We find that these declines correlate with models’ negative log-likelihood (NLL) on the original benchmarks [11], supporting its use as a potential indicator of bug/fix memorization. Thus, combining MT 1 OpenAI, https://openai.com 2 https://www.anthropic.com
• We present a large-scale empirical study examining how metamorphic testing outcomes relate to potential data leakage in LLM-based program repair. • We introduce CodeCocoon , a transformation framework for constructing realistic, semanticspreserving benchmark variants, which can be extended to other benchmarks and code-related tasks.
• We argue that selectively evaluating metamorphically transformed variants as part of APR evaluation pipelines can help, together with NLL, diagnose performance inflation caused by benchmark contamination.
2. Background and Related Work Automated Program Repair. Automated Program Repair (APR) aims to automatically generate patches for software bugs [25] and it is typically structured in three steps: (1) fault localization, (2) patch generation, and (3) patch validation. 1) Fault Localization. This step identifies potentially faulty code locations that should be modified. APR tools often rely on existing fault localization (FL) techniques [26]. Although accurate localization is critical for effective repair, many APR studies assume perfect fault localization and focus instead on patch generation and validation [3]. 2) Patch Generation. Given a localized defect, APR tools generate candidate patches using a variety of techniques. These can be broadly categorized as follows [3]: search-based approaches use metaheuristics to explore large repair spaces [27, 28]; constraintbased techniques encode repair as a satisfiability problem [29, 30]; template-based methods apply predefined fix patterns [31, 32, 33]; and learning-based approaches train neural models to learn repair transformations [34, 35]. Among learning-based methods, those based on large language models (LLMs) have recently achieved state-of-the-art results [4, 6, 5]. LLM-based APR can be realized through different strategies [4]: fine-tuning task-specific models such as CodeT5 [36] and CodeBERT [37]; few-shot learning with in-context exam-
ples, typically applied to medium-sized models like CodeX [38]; and zero-shot prompting, where generalpurpose models such as ChatGPT generate patches without fine-tuning [4]. 3) Patch Validation. Once candidate patches are generated, they must be assessed for correctness. Stateof-the-art tools often generate hundreds of candidates per bug; for instance, SRepair [5] produces up to 500 patches per defect. The most widely adopted validation approach is test-suite-based repair, where a patch is considered valid if it compiles and passes all test cases [25, 5, 6]. However, passing the test suite (or test-adequate) does not necessarily imply correctness. Many patches exploit deficiencies in the test suite, such as by deleting buggy code or hard-coding values, resulting in overfitting. These patches may appear correct but fail to generalize. To distinguish between different outcomes, Durieux et al. [25] proposed a taxonomy of patch validity: uncompilable patches fail to compile; failing patches compile but do not pass all tests; plausible patches pass the test suite but may be incorrect; and correct patches are semantically equivalent to the developer fix. Correctness, in this context, is typically verified via manual inspection or oracle comparison, as test suites alone are not sufficient. Large Language Models and Data Leakage. Large Language Models (LLMs) have demonstrated strong performance across a wide range of coding tasks, including code generation [39], code summarization [40], vulnerability detection [41], and automated program repair (APR) [4]. Many of these models are fine-tuned to optimize specific objectives [42], enabling them to generalize across diverse tasks with minimal task-specific data. While LLMs often perform well on standard benchmarks, recent studies show that their robustness to simple, semantics-preserving code transformations remains limited [15, 43, 44, 45, 46, 47]. These findings raise concerns about whether high benchmark scores reflect genuine semantic understanding or surface-level pattern matching. A related and more insidious issue is data leakage, which occurs when evaluation benchmarks overlap with an LLM’s pretraining data, leading to inflated performance metrics and poor generalization [48, 9]. This is particularly concerning in APR, where widely used benchmarks such as Defects4J [8] are likely to be present in pretraining corpora. As a result, models may generate correct patches by recalling memorized bugfix patterns rather than reasoning over novel bugs. Prior work has shown that LLMs can memorize and reproduce both natural language and source code,
with larger models exhibiting stronger memorization effects [49]. As a result, several studies in the machine learning and software engineering communities have investigated indirect signals for detecting such memorization in evaluation benchmarks. A widely used approach relies on perplexity and negative log-likelihood (NLL), which measure how surprising a token sequence is to a model [50, 51]. NLL is defined as: NLL(xi ) = − log pθ (xi | x<i ),
(1)
where pθ denotes the model’s next-token probability distribution. Lower NLL (and equivalently lower perplexity) indicates that a sequence appears highly familiar to the model, which is consistent with prior exposure during training. Consequently, NLL has become a standard proxy for model familiarity and memorization in large-scale LLM evaluations [50, 51]. Ramos et al. [11] applied NLL-based analysis to Java benchmarks such as Defects4J and GitBugJava [17], comparing them against post-cutoff repositories. They found that several models exhibit substantially lower NLL on Defects4J, suggesting memorization of benchmark content and highlighting the risks associated with older benchmarks. Importantly, while NLL is a well-established and widely accepted indicator of memorization [50, 51], it does not, by itself, constitute definitive proof of data leakage. In this work, we therefore interpret NLL as a supporting signal and analyze it in conjunction with metamorphic testing outcomes, using converging evidence rather than relying on single metrics in isolation. Data leakage mitigation. Several studies propose mitigating data leakage by creating new benchmarks [12, 13, 14], as also recommended by Zhang et al. [52]. However, benchmarks can quickly become obsolete as LLMs are continually retrained on newly scraped data. Bradbury and More [53] proposed to dynamically instantiate benchmark variants from handcrafted templates, showing consistent performance drops on HumanEval [38], albeit at substantial manual cost. An alternative strategy is to apply metamorphic transformations to existing benchmarks in order to reduce sensitivity to memorized instances while preserving their utility. Prior work has primarily applied metamorphic testing to study robustness and consistency of code models, without explicitly examining its relationship to benchmark contamination and memorization [20]. In this study, we explore metamorphic testing from a leakage-aware perspective, looking at how performance degradation under transformations relates to signals of model familiarity, such as NLL. By combining these signals with metamorphic transformations,
we offer complementary evidence for identifying data leakage in LLM-based APR. Metamorphic testing. Metamorphic testing evaluates the robustness of models for code-related tasks by transforming the syntax or abstract syntax tree (AST) of input code without altering its semantics [15, 43]. By comparing model outputs on original and transformed inputs, one can assess robustness. This principle also applies to APR: if a model can fix a bug in the original snippet, it should also fix it in a semantically equivalent, transformed version. Prior work shows that many models are sensitive to irrelevant transformations, such as identifier renaming or structural changes, leading to inconsistent outputs [15, 43, 44, 45, 46, 47]. Natural transformations are crucial to avoid false alarms, as unnatural code may confuse models even though it would not occur in practice [54, 55, 44]. Accordingly, in this study we apply several natural transformations, including identifier renaming with synonyms [19], as detailed in Section 3. Several studies have applied metamorphic testing to deep code models, particularly in the context of APR [20]. Ge et al. [56] evaluated four neural APR models (Recoder, CoCoNut, SequenceR, and Tufano) and showed that even the most robust model failed on a substantial fraction (20% ) of transformed cases. LeCong et al. [55] studied neural APR models with an emphasis on transformation naturalness, finding that a significant portion of prediction changes were caused by unnatural transformations. They argued that such cases should be excluded and explored automated naturalness assessment using early LLMs based on cross-entropy. More recently, Li et al. [57] evaluated LLM-based repair on transformed Defects4J bugs and attributed observed performance drops to robustness issues, without considering data leakage. Xue et al. [58] evaluated open-source LLMs under metamorphic testing and proposed reverting transformations prior to repair, although the generalizability of this approach remains unclear. Overall, prior work has established that code models are fragile under metamorphic transformations, but has largely focused on robustness analysis of neural APR systems or open-source LLMs. In contrast, our work evaluates state-of-the-art proprietary LLMs (e.g., ChatGPT-4o and Claude-3.7) and explicitly examines whether performance degradation under metamorphic transformations is associated with data leakage. We further provide a correlation analysis between metamorphic robustness and negative log-likelihood (NLL), offering a complementary, model-agnostic lens into LLM behavior beyond internal metrics alone [50, 51].
Figure 1: Experimental pipeline
3. Methodology This section describes the methodology we applied to answer our three research questions: • RQ1: What is the impact of metamorphic transformations on the performance of LLM-based program repair? • RQ2: How is the observed LLMs’ performance drop under metamorphic transformations related to potential data leakage in the benchmark code? • RQ3: Which types of code patterns and metamorphic transformations are most indicative of memorization effects in LLM-based program repair? To address these questions, we designed an experimental pipeline that is illustrated in Figure 1. The pipeline consists of three main stages. First, in the Transform stage, we apply a suite of semantics-preserving code transformations—such as identifier renaming and control-flow rewriting—to introduce structural diversity while maintaining program behavior. Second, in the Generate Patch stage, we use large language models (LLMs) to generate bug-fixing patches for both the original and transformed buggy code snippets. Each model is prompted in a Chain-of-Thought setting with the buggy function and its associated test cases. Finally, in the Evaluate Patch stage, we validate generated patches by executing the project’s test suite. A patch is considered successful if it compiles and passes all tests. We compare success rates between original and transformed benchmarks to quantify robustness effects (RQ1), analyze how performance degradation correlates with memorization indicators such as negative log-likelihood (RQ2), and examine which transformation types most strongly expose memorization effects (RQ3). All code and experimental artifacts are available at https://zenodo.org/ records/15837296. Datasets. We use the Defects4J [8] and GitBugJava [17] datasets. Defects4J contains 854 real-world
bugs collected from mature Java projects spanning multiple years, with most bugs written in Java 1.6 to Java 1.8. GitBug-Java, by contrast, is a more recent benchmark containing 199 bugs collected between January 2023 and October 2023. It was explicitly designed to reduce the risk of data leakage by targeting newer defects that are less likely to appear in LLM pretraining corpora. Note that we excluded 44 bugs from GitBugJava, as they do not involve single-function defects. For consistency across both benchmarks, our study focuses exclusively on function-level bugs, where the fix is applied to a single method. Transformations. We developed CodeCocoon to support metamorphic transformations of code models. The framework applies a range of transformations to Java code snippets, including structural changes and identifier renaming, while ensuring the transformed code remains natural and human-readable. Although several alternative tools exist, CodeCocoon is, to the best of our knowledge, the only tool that systematically applies natural transformations and has been extensively validated to preserve program behavior. While our study focuses on APR, CodeCocoon is broadly applicable to other code-related tasks. We implement a set of structural and renaming transformations, deliberately excluding unnatural ones, as they may introduce unrealistic inputs that reduce the validity of model evaluations [55, 54]. Our transformations are selected from the set proposed in [55], where naturalness was assessed via human evaluation. We chose only those transformations rated highly for naturalness and applicable to typical Java code, ensuring realism without sacrificing diversity. Table 1 lists the selected transformations. For variable and parameter renaming, we use ChatGPT-4o-mini1 to generate context-aware synonyms and acronyms, following best practices suggested in prior work [19]. Models. We evaluate seven state-of-the-art models for automated code repair. This includes three closedsource models: ChatGPT-4o1 , ChatGPT-4o-mini1 , and Claude-3.7-Sonnet2 . In addition, we consider four open-source models: Llama 3.1 8B [21], StarCoder2 7B [24], Gemma 2 27B [22], and Mistral 7B v0.3 [23]. Because our evaluation relies on instruction-following capabilities, we use instruction-tuned variants of the open-source models from Hugging Face3 , and run them locally using vLLM [59]. We exclude CodeGen 6B [60] due to the absence of an instruction-tuned version on Hugging Face and lack of support in vLLM. We also omit Llama 70B [21] due to computational resource constraints. APR settings. In our experiments, we apply 3 https://huggingface.co
APR by prompting the model under test similar to the SRepair method proposed by Xiang et al. [5]. We use Chain-of-Thought [61] techniques to prompt our APR model to analyze the root cause of the bug, suggest solutions, and implement these solutions. In our prompt, we provide the buggy function, Javadoc, a random trigger test case, and the stack trace of this trigger test. We extract the patches from the response and replace the buggy function with the generated patches in the project before executing the tests. The key difference from SRepair [5] is that we let the LLM reason about the root cause and implement the solution simultaneously, reducing inference time and cost. This setup is sufficient to demonstrate robustness and data leakage issues in LLMs. Finally, we assume function-level fault localization, meaning the model is given the entire buggy function but not the exact faulty line. This contrasts with prior studies [56, 55], which assume perfect line-level fault localization. Function-level localization offers a more realistic and practical setting: in practice, identifying the faulty function requires significantly less manual effort or tooling precision than pinpointing the exact faulty line. Despite being coarser, this still provides enough context for LLMs to reason about and fix bugs, while better reflecting real-world usage scenarios. Evaluating Robustness to Code Transformations. To answer RQ1, we measure how robust LLMs are to semantics-preserving code transformations by comparing their success rates on original versus transformed buggy functions. We prompted each model 10 times per original bug and 10 times per transformed bug, following the recommendations [62], with each sample run in a separate and independent chat session [10]. Closed-source models were asked to generate 5 patches per prompt; open-source models generated 1 patch per prompt due to context and output limitations. We consider a prompt successful if at least one of the suggested patches passes all tests. This reflects a realistic scenario where unique solutions are generated, even if only one solution exists. We define the performance of the model on a given bug in terms of the Success Rate (SR): SR =
#prompts that produce ≥ 1 correct patch #prompts
(2)
This is the percentage of prompts that result in at least one plausible patch. This suggests that a prompt is considered successful if at least one of the proposed fixes satisfies all the tests. We can consider this to be a measure that is meaningful in practical situations. So, taking a large number of samples and considering the bug to be solved when at least one patch is correct, like in [5], may be acceptable to measure research progress, but it is not feasible in real-world scenarios. We define
Table 1: The metamorphic transformations we apply in this study. Transformation
Explanation
Example
Replace the name of a function with a context synonym. Rename Parameter (RPar) Replace the name of a parameter with a context synonym. Rename Variable (RVar) Replace the name of a local variable with a context synonym. For to While (F2W) Replace for loop with while loop Reverse If (RevIf) Negate condition and swap if and else blocks Nest Else If (NestEI) Replace else-if with nested if inside else Swap Equals operands (SEO) Swap operands of equals expression Swap Relational operands (SRO) Swap operands of relational operator Expand Unary increment (EUI) Expand unary increment/decrement
int add(int a, int b) → int sum(int a, int b) void remove(int element) → void remove(int value) int total; → int result;
the success rates on the original and transformed functions as SRorig and SRtrans . We define the difference in the success rate as SRdi f f = SRtrans − SRorig . To assess statistical significance between paired results, we use the Wilcoxon signed-rank test. Effect sizes are reported using the Vargha–Delaney Â12 statistic [63], which estimates the probability that a randomly selected transformed result outperforms an original one. A value of Â12 = 0.5 indicates no difference; values above 0.5 suggest the transformed version tends to perform better, while values below 0.5 favor the original version. Following standard guidelines [63], Â12 values are interpreted as negligible (0.44 ≤ Â12 ≤ 0.56), small (0.36−0.44 or 0.56−0.64), medium (0.29−0.36 or 0.64−0.71), or large (Â12 ≤ 0.29 or Â12 ≥ 0.71). Results are considered statistically significant for pvalues<0.05. All metrics are based on test-adequate patches, i.e., patches that compile and pass all test cases. While test adequacy is not a guarantee of semantic correctness, manual validation is infeasible at the scale of our study, which includes over 1,000 original and 1,000 transformed bugs evaluated across seven models with multiple repetitions. Test outcomes nevertheless provide a practical and consistent basis for comparing robustness under metamorphic transformations. Correlation analysis. To answer RQ2, we investigate whether the performance drop under metamorphic transformation is related to model familiarity, as estimated by the negative log-likelihood (NLL) reported by Ramos et al. [11]. These NLL values capture the average uncertainty of each model on the original Java file
containing the bug and serve as a proxy for potential data leakage. Since Ramos et al. only evaluated a subset of Defects4J, we extend their analysis to the full benchmark using their replication package. It is worth noting that we focus on NLL in this analysis, as Ramos et al. found it more sensitive to memorization than 5-gram accuracy, making it a stronger proxy for data leakage. Because NLL values differ in scale across models, we normalize them using percentile ranks within each model, allowing meaningful comparisons of relative familiarity. We then assess the relationship between the normalized NLL values and the observed performance drop (SRdi f f ) using the Spearman rank correlation coefficient, a non-parametric measure that is appropriate given that, as previously determined via the Shapiro–Wilk test, our data do not follow a normal distribution. All correlations are computed using the standard Python implementation of the Spearman test. Analysis of transformation impact. To address RQ3, we analyze which transformation types and combinations most strongly contribute to success rate differences (SRdi f f ), serving as indicators of code patterns that are more likely to be memorized by LLMs. To this aim, we employ a permutation test4 . This test determines whether the variance in the dependent variable (SRdiff ) can be attributed to the independent variables, which encode the frequency of each transformation type (e.g., the number of times variable names were changed). The permutation test is a non-parametric alternative to two-way Analysis of Variance (ANOVA),
Rename Function (RFun)
for (int i = 0; i < n; i++) → int i = 0; while (i < n) { i++; } if(a){doA();} else {doB();} → if(!a){doB();} else {doA();} if(a){} else if(b){doB();} → if(a){} else { if(b){doB();}} a == b → b == a a > b→b < a i++ → i += 1
4 We use the lmPerm package from the CRAN repository.
Table 2: Success rate statistics (mean ± σ ) for bug repairs using original versus semantically transformed code snippets on Defects4J and GitBug-Java. Analysis limited to solvable bugs (original SR > 0%). Statistical significance assessed via Wilcoxon signed-rank test and Vargha-Delaney (Â12 ) statistics. Dataset
Defects4J
Model Claude-3.7 GPT-4o GPT-4o-mini Gemma-2-27B Llama-3.1 Ministral-7B StarCoder2
Claude-3.7 GitBug-Java GPT-4o GPT-4o-mini
Original SR
Transformed SR
Mean
σ
Mean
409 349 279 201 179 110 36
77.31% 65.93% 57.17% 44.38% 35.08% 25.64% 13.89%
31.87% 34.09% 35.10% 31.36% 26.10% 22.20% 6.45%
72.42% 61.92% 51.36% 36.07% 19.11% 18.73% 6.11%
37 17 15
68.11% 33.82% 68.38% 39.05% 50.59% 37.50% 52.35% 41.76% 55.33% 35.23% 46.67% 34.57%
Solvable Bugs
and does not rely on assumptions about data distribution. To justify its use, we conducted a Shapiro–Wilk test for normality, which yielded statistically significant p-values<0.01, indicating that the data deviate from a normal distribution. This violation of the normality assumption further supports our choice of a nonparametric test. We set the number of iterations for the test to 1,000,000 to ensure both stability and reproducibility. A statistically significant result (p-value<0.05) suggests that one or more transformations, or their interactions, have a significant effect on the LLM’s success rate in generating test-adequate patches. To complement the significance test, we report effect sizes using the Vargha–Delaney Â12 statistic [63], which quantifies both the magnitude and direction of the observed effect. We restrict our analysis to interaction terms involving at most three transformation types at a time. This decision is driven by practical concerns. First, higher-order interactions reduce interpretability. Second, the number of transformation combinations grows exponentially, increasing model complexity and the risk of multiple testing errors. Third, estimating higher-order effects requires substantially more data. Combinations involving more than three transformations frequently lead to sparse or empty design cells, which compromises statistical validity and could lead to overfitting.
4. Results 4.1. RQ1: LLM-based APR Performance Changes Results for Defects4J. Table 2 reports the mean and standard deviation of success rates for state-ofthe-art APR models on both the original and trans-
σ
Difference Mean
36.06% -4.89% 36.74% -4.01% 37.77% -5.81% 33.87% -8.31% 20.12% -15.98% 23.97% -6.91% 9.03% -7.78% 0.27% 1.76% -8.67%
Statistical Tests
Worst Case p-value -100.00% -80.00% -70.00% -80.00% -60.00% -50.00% -30.00% -30.00% -40.00% -70.00%
<0.001 <0.001 <0.001 <0.001 <0.001 <0.001 <0.001
Â12 0.414 (Small) 0.404 (Small) 0.351 (Medium) 0.313 (Medium) 0.109 (Large) 0.282 (Large) 0.208 (Large)
0.819 0.473 (Negligible) 0.667 0.471 (Negligible) 0.074 0.333 (Medium)
formed versions of the bugs in Defects4J and GitBugJava datasets, averaged over 10 independent runs or prompts. For this analysis, we focus exclusively on bugs that the model was able to solve in the original version (i.e., success rate >0%), which we refer to as solvable bugs. This filtering allows us to isolate the impact of semantic transformations on cases where the model has demonstrated bug-fixing capability, allowing us to assess whether such transformations impair or improve performance. As shown in Table 2, all seven models exhibit a statistically significant drop in the success rate when evaluated on the transformed version of Defects4J (all p-values are smaller than 0.001). The largest average drop is observed for Llama-3.1 (–15.98%), with a large effect size based on the Vargha-Delaney Â12 statistic. Even the smallest observed drop for GPT-4o (–4.01%) is statistically significant and accompanied by a small effect size. A closer examination of individual bug performance reveals notable worst-case scenarios in which LLMs fail entirely on transformed versions of bugs they previously solved. For example, Claude-3.7 was able to generate a correct patch for Jsoup-15 in all 10 runs on the original version, but failed in every run after transformation. GPT-4o exhibited a similar pattern on Math-32, with performance dropping from 80% to 0%, as did Gemma-2-27B on Lang-52. Llama3.1 and Ministral-7B also showed complete failure on Cli-11 and JacksonDatabind-93, respectively, despite partial success in the original setting. StarCoder2, although generally less effective, also failed to repair Codec-17 after transformation (30% to 0%). GPT-4o-mini showed a less extreme but still substantial drop on Compress-26, decreasing from 100% to 30%. These results confirm a key robustness vulnerability: even semantically preserving (and natural) code transformations can significantly impair model perfor-
GPT-4o-mini GPT-4o
Model Claude-3.7 Gemma-2-27B
Lama-3.1 Ministral-7B
GPT-4o-mini
StarCoder2
Success Rate Difference (Transformed - Original)
75.0%
Success Rate Difference (Transformed - Original)
Model GPT-4o
Claude-3.7
60.0%
50.0% 25.0% 0.0% -25.0% -50.0% -75.0%
40.0% 20.0% 0.0% -20.0% -40.0% -60.0%
-100.0% Hard
Medium
Bug Difficulty (Based on Original Success Rate)
Easy
Hard
Medium
Bug Difficulty (Based on Original Success Rate)
Easy
Figure 2: Distribution of success rate differences (SRdi f f ) for each model after metamorphic transformations, grouped by bug difficulty levels on the Defects4J benchmark.
Figure 3: Distribution of success rate differences (SRdi f f ) for each model after metamorphic transformations, grouped by bug difficulty levels on the GitBugJava benchmark.
mance on previously solvable bugs. To further analyze the results on Defects4J, we examine how performance differences vary with bug difficulty. We categorize bugs into three levels based on the model’s original success rate: Hard (0–30%), Medium (30–70%), and Easy (70–100%), which reflect the empirical difficulty encountered by each model. Hard bugs are rarely solved even in the original form, indicating fundamental challenges; medium bugs are solved inconsistently; and easy bugs are reliably repaired, suggesting they fall well within the model’s capabilities. Metamorphic transformations thus affect bugs differently depending on their empirical difficulty. Figure 2 depicts the change in success rates for each model across the three difficulty levels. Negative values (below the zero line) indicate a performance drop after transformation, while positive values (above the line) indicate an improvement. Across all models, we observe a consistent drop in performance for each difficulty level, with the most pronounced declines occurring on easy bugs. For hard bugs, where models already struggle to produce correct patches, the median performance remains close to zero both before and after transformation. In these cases, metamorphic transformations have limited additional impact, unsurprisingly, as the model fails even without transformation. Nonetheless, we observe a few positive outliers, suggesting that in rare instances, transformations may make certain hard bugs more tractable, potentially by simplifying the syntax or nudging the model toward a more effective solution. This observation opens an interesting avenue for future work: systematically identifying metamorphic transformations that can assist LLMs in overcoming failure cases, rather than merely serving as robustness checks. For medium bugs, all models exhibit a clear median drop of approximately –10%, indicating that transformations disrupt model behavior in cases where success is already inconsistent. For easy bugs, the effect is most severe: all models show a decline in median,
25th, and 75th percentile performance, with Llama3.1 and Mistral-7B showing median drops exceeding –20%. These results indicate that even for seemingly trivial repair tasks, metamorphic transformations can substantially hinder model performance —especially for weaker models— highlighting the fragility of LLMbased APR. Results for GitBug-Java. We focus on Claude3.7-Sonnet, GPT-4o, and GPT-4o-mini. These models have (pre)training cutoffs in October 20235 (GPT-4o and GPT-4o-mini) and approximately November 20236 (Claude-3.7), which closely match the commit window of GitBug-Java that spans from January to October 2023 [17]. This temporal alignment enables the investigation of potential memorization effects, as any leakage would likely stem from pretraining exposure. The results for this benchmark are shown in Table 2. Unlike Defects4J, we do not observe consistent performance degradation across models. For Claude-3.7-Sonnet and GPT-4o, success rates on transformed bugs are slightly higher than on the original versions, with negligible effect sizes and no statistical significance (p = 0.819 and p = 0.667, respectively). GPT-4o-mini shows a small performance drop of 8.67%, which is marginally significant (p = 0.074) with a medium effect size (Â12 = 0.333). Despite the absence of broad performance drops, all three models experience notable worst-case degradations. For example, GPT-4o-mini drops from 100% to 30% on nikoo28-java-solutions-8d81307ea165, GPT-4o drops from 90% to 50% on traccar-traccar-6f59f756a7d3, and Claude-3.7 drops from 100% to 70% on traccar-traccar-5c26f25b3b0a. These cases show that even when average performance remains stable, certain transformed bugs become 5 https://learn.microsoft.com/en-us/azure/ ai-foundry/openai/concepts/models 6 https://docs.anthropic.com/en/docs/ about-claude/models/overview
substantially more difficult for models that previously succeeded. We note that GitBug-Java is a more challenging benchmark overall. Most bugs in the dataset cannot be fixed by any model in our study, and the number of solvable bugs (i.e., those with a non-zero success rate) is substantially smaller than in Defects4J. As shown in Figure 3, this limits the statistical power of per-difficulty analysis and may partially explain the absence of clear trends. Nonetheless, the observed variation and worst-case drops suggest that metamorphic transformations can still affect performance, although less uniformly than in older benchmarks such as Defects4J. Answer to RQ1: State-of-the-art LLMs perform significantly worse on the metamorphically transformed Defects4J benchmark. They do not suffer as much on the GitBug-Java Benchmark. Certain bugs reveal model vulnerabilities to metamorphic transformations.
4.2. RQ2: Performance drop and data leakage Figure 4 shows the mean success rate drop (SRdi f f ) across NLL-based confidence categories. Bugs are grouped into five bins according to their NLL percentile, where category 0 includes the most familiar (lowest NLL) and category 4 the least familiar (highest NLL) instances. Notice that for this analysis, we focus on the four open-source models: Gemma, Llama, Mistral, and StarCoder. NLL values are not available for proprietary models because computing NLL requires access to token-level probabilities from the model’s forward pass, which in turn requires access to the model’s internal weights and tokenizer. Since this is restricted for closed-source models like GPT-4 or Claude-3.7, correlation analysis involving NLL is not feasible for these models. From Figure 4, we see a clear trend: for all models, the average performance drop is highest in the lowest NLL bin. This suggests that metamorphic transformations disproportionately impact bugs the model is more familiar with, as shown by low NLL values. The consistent link between performance degradation and NLL offers further evidence that combining metamorphic transformations with model familiarity signals is effective for revealing data leakage. Interestingly, we also observe that performance drop increases again in the highest NLL bins for Gemma-2, Mistral-7B, and StarCoder2, forming an inverted U-shape. This suggests a second source of vulnerability: for unfamiliar
Figure 4: Mean performance drop (SRdi f f ) across NLL confidence categories. Bugs are grouped into five categories based on their NLL percentile ranks (from lowest to highest NLL). Lower categories indicate higher model confidence (and likely familiarity), while higher categories indicate lower confidence. code, the models are highly uncertain and sensitive to perturbations, leading to prediction instability. Metamorphic testing serves two complementary purposes: (1) diagnose data leakage (together with low NLL) by disrupting memorized inputs, and (2) reveal brittleness in model predictions under uncertainty. To statistically assess the relationship between model familiarity and robustness, we compute the Spearman rank correlation between NLL and SRdi f f for the lower half of the NLL distribution. For Gemma-2, we observe a correlation of r=0.303 (p-value=0.0011), indicating a medium effect size. Llama-3.1 and Mistral7B also show positive correlations of r = 0.165 (pvalue=0.0472) and r=0.218 (p-value= 0.0491), respectively, both with small effect sizes. StarCoder2 shows a stronger correlation of r=0.401 (p-value=0.0798), which falls just outside the conventional significance threshold due to limited data, but still indicates a medium effect size. These findings confirm that performance degradation is associated with model familiarity, reinforcing metamorphic transformations as a diagnostic and decontamination LLM-based APR. Further inspection of Gemma-2, the model with the strongest correlation between NLL and performance drop, reveals that many low-NLL bugs originate from the Lang and Math projects. As shown in Figure 5, these projects exhibit both low median NLL and large success rate drops. Similar patterns are observed for Codec. These trends suggest that Gemma-2 is familiar with these codebases and that its APR performance may be inflated by data leakage. Furthermore, Figure 5 shows that projects from Defects4J version 1.2 tend to have lower NLL and higher performance drops, reinforcing the idea that the benchmark age and prior exposure during pretraining contribute to memorization effects.
Figure 5: Defects4J projects by average success rate drop, median NLL, and Defects4J version. Only bugs solvable by Gemma 2 27B with sub-median NLL are shown. Bug counts per project are noted in parentheses. Answer to RQ2: We find a significant correlation between model familiarity (low NLL) and success rate drops under metamorphic transformations for all models (only marginal for StarCoder2 due to limited data). Metamorphic transformations and model familiarity signals offer complementary evidence of data leakage.
4.3. RQ3: Transformations indicative of memorization Table 3 summarizes statistically significant associations between individual or combined transformations and success rate differences, identified using a two-way permutation test (p-value<0.05). Effect sizes are reported using the Vargha–Delaney Â12 statistic, where Â12 < 0.5 indicates that the transformation(s) are associated with lower repair success. A negative SRdi f f indicates that models repair fewer bugs with transformed code than vs. the original version. Across models, the transformation most consistently associated with performance degradation is NestElseIf, which is significant for both Claude-3.7 and GPT-4o, both in isolation and in combination with other transformations. This transformation replaces an else-if chain with nested if statements (see Table 1), increasing structural complexity while preserving semantics. Such sensitivity suggests that models may rely on familiar syntactic patterns. For Claude-3.7, NestElseIf exhibits stronger effects when combined with other transformations, including ExpandUnaryIncrement, ForToWhile, RenameFunction, and RenameParameters. This pattern indicates increased difficulty when structural changes are compounded with lexical variation, consistent with re-
liance on memorized code forms. GPT-4o and GPT-4o-mini show fewer significant associations overall. For GPT-4o, NestElseIf alone yields a small but significant effect, while both models exhibit performance drops when parameter renaming is combined with other transformations such as ExpandUnaryIncrement or NestElseIf. This suggests that renaming acts as an amplifying factor when paired with structural perturbations. Renaming transformations (RenameVariables and RenameParameters) generally have a significant adverse effect only when combined with structural changes, indicating that renaming alone rarely impairs performance but can exacerbate degradation when paired with other transformations. Gemma-2-27B is a notable exception: it is negatively affected by renaming in isolation and also shows medium-sized effects for SwapEqualsOperands, with effects becoming large when equality and relational operand swaps are combined. This behavior indicates a stronger reliance on surface-level variable names and expression structure, making the model particularly sensitive to deviations from familiar code patterns. Mistral-7B also exhibits a significant drop in performance when the ForToWhile transformation is applied, indicating that it performs better when loops are expressed using for rather than while. The model also shows a performance drop when RenameParameters is combined with SwapRelationOperands. Finally, no specific transformation is identified as disproportionately harmful for Llama-3.1 or StarCoder2. Llama-3.1 exhibits broadly degraded performance across nearly all transformations, limiting the ability of the permutation test to isolate individual effects. In contrast, StarCoder2 repairs very few bugs overall (36 in total). This low number of bug fixes results in very few data points for each transformation, limiting the statistical power of the permutation test. In other words, the sample size was too small to detect significant interactions between transformations and performance drops reliably. Answer to RQ3: Certain metamorphic transformations are consistently associated with larger performance drops, indicating models sensitivity to these code patterns. NestElseIf is the most indicative transformation across models, particularly for Claude-3.7 and GPT-4o. Renaming lead to performance degradation when combined with structural changes, while Gemma-227B is uniquely sensitive to renaming in isolation.
Table 3: Statistical interactions between individual or combined transformations and the drop in success rate based on the two-way permutation test (p-value<0.05). The effect size of Â12 <0.5 indicate a harmful impact on the APR success rate. Model
Transformations
p-value
Â12
Claude-3.7
NestElseIf ExpandUnaryIncrement + NestElseIf ForToWhile + NestElseIf NestElseIf + RenameFunc. NestElseIf + RenameParam. NestElseIf + SwapRelationOper.
<0.01 <0.01 <0.01 <0.01 <0.01 <0.01
0.41 (small)) 0.41 (small) 0.41 (small) 0.41 (small) 0.41 (small) 0.37 (small)
GPT-4o
NestElseIf NestElseIf + RenameParameters
<0.01 <0.01
0.44 (small) 0.44 (small)
GPT-4o-mini
ExpandUnaryIncrement+RenameParameters
<0.02
0.42 (small)
RenameVariables SwapEqualsOperands ExpandUnaryIncrement + ReverseIf SwapEqualsOperands + SwapRelationOperands RenameParameters + RenameVariables ReverseIf + SwapEqualsOperands
0.03 0.01 0.03 0.04 0.04 0.04
0.31 (medium) 0.32 (medium) 0.32 (medium) 0.23 (large) 0.31 (medium) 0.32 (medium)
ForToWhile RenameParameters + SwapRelationOperands
0.04 0.02
0.39 (small) 0.41 (small)
Gemma-2-27B
Mistral-7B
5. Discussion and Implication Scope and Positioning. This work is not a proposal for a new automated program repair technique, nor a replacement for benchmark curation or postcutoff dataset construction. Instead, it addresses a complementary evaluation problem: assessing whether reported APR performance reflects genuine reasoning or is inflated by memorization. We position metamorphic testing as a lightweight, model-agnostic diagnostic that can be applied selectively to stress-test evaluation results. Our goal is not to eliminate data leakage at training time, but to reduce the inflation of reported performance and improve the interpretability and robustness of empirical APR evaluations in the LLM era. Throughout this paper, we use the term mitigation strictly in this evaluation sense, rather than to denote preventing or eliminating data leakage during model training. While prior work has independently studied robustness under MT and benchmark memorization via model-internal metrics, our study provides empirical evidence linking these two perspectives through observable repair behavior in LLM-based program repair. Understanding the Fragility of LLM-Based APR. Our results show that even state-of-the-art LLMbased automated program repair (APR) systems are sensitive to natural, semantics-preserving code transformations. On Defects4J, all evaluated models exhibit statistically significant performance degradation, including on bugs that were previously easy to fix. Thus, strong benchmark performance does not necessarily imply robust reasoning, but may partially rely on familiarity with recurring syntactic patterns. In contrast, performance on the more recent GitBug-Java benchmark remains largely stable on average, though notable worst-case degradations persist. These findings high-
light that average-case metrics can mask brittleness at the instance level, and that robustness failures may still arise even on leakage-aware benchmarks. Metamorphic Testing as a Diagnostic Tool. Performance drops under MT are especially pronounced for instances that models seem most familiar with, as reflected by low NLL values. Although NLL by itself is not proof of data leakage, the consistent link between low NLL and greater performance degradation gives further evidence that memorization may inflate reported APR performance. Importantly, we position metamorphic testing not as a definitive leakage detector, but as a model-agnostic diagnostic probe. Unlike metrics that rely on access to model internals, metamorphic testing exposes code-pattern sensitivity through observable behavior. This makes it applicable to both open-source and proprietary models and suitable for practical evaluation settings. What Transformations Reveal About Memorization. Our RQ3 analysis shows that certain transformations are more indicative of memorization effects than others. Structural rewrites such as NestElseIf consistently expose performance drops across multiple models, particularly when combined with lexical variation. Renaming transformations alone rarely impair performance, but amplify degradation when paired with structural changes. Gemma-2-27B stands out as uniquely sensitive to renaming in isolation, suggesting a stronger reliance on surface-level identifiers and expression structure. These patterns reinforce the view that LLMs may rely on familiar syntactic forms rather than abstract program semantics. Dataset Age and Evaluation Validity. Differences between Defects4J and GitBug-Java highlight the importance of dataset design. Older benchmarks, such as Defects4J, are more likely to overlap with pretraining data and exhibit stronger memorization signals, whereas newer benchmarks reduce but do not eliminate these effects. Our results suggest that even leakageaware datasets can benefit from robustness-oriented evaluation, as memorization traces may still emerge at the instance level. Looking Beyond Averages. Although mean success rates on GitBug-Java show limited change under transformation, individual bugs can become substantially harder or unsolvable. This underscores the limitations of relying solely on aggregate metrics and motivates the use of robustness analyses to complement standard APR evaluations. Implications for Future Evaluations. We do not argue that MT replaces benchmark curation or postcutoff dataset construction. Rather, it offers a complementary, low-overhead mechanism to assess whether
reported performance is robust to natural variation. Transformations can be applied selectively (for example, to likely memorized instances), making the approach practical without imposing prohibitive evaluation costs. Reporting results on both original and transformed benchmarks can therefore help reduce the risk of performance inflation and improve the interpretability of APR evaluations. Our results further suggest that metamorphic testing need not be applied exhaustively: focusing on a small subset of instances with strong memorization signals (e.g., the lowest 20–25% by NLL) already exposes substantial performance inflation, keeping evaluation overhead modest. Comparison with Prior Work. Our findings confirm prior evidence that code models are fragile under metamorphic transformations [15, 43, 54], and extend these observations to state-of-the-art LLM-based APR systems. Unlike earlier studies that focused primarily on robustness, we explicitly link transformation sensitivity to memorization signals, corroborating and extending recent leakage analyses [11]. In doing so, we provide large-scale empirical evidence, previously missing in the literature, that metamorphic transformations, when considered alongside model familiarity signal, can serve as a practical, model-agnostic diagnostic for memorization effects in LLM-based program repair.
6. Threats to Validity Threats to internal validity. First, the Codecocoon implementation may generate incorrect or unnatural variants. We mitigate this risk through extensive unit testing and manual inspection. Second, bugs in the experimental pipeline could affect results; however, such issues would impact original and transformed variants equally (except in the transformation stage), which we manually validated. Third, updating function names in tests and stack traces relies on regular expressions that may miss some references. We manually verified that unmatched occurrences did not refer to the target function (e.g., substrings in variable/test names). Metamorphic transformations may still produce code that appears less natural, potentially disadvantaging APR models trained on human-written code and contributing to observed performance drops. To mitigate this, we restrict our study to natural transformations [54, 55] and use an LLM to generate semantically appropriate identifier synonyms. While NLL is correlated with code naturalness [11], it is computed on the original code and is unaffected by metamorphic transformations, limiting its impact as a confounding factor. Threats to external validity. Since the dataset
provided by Ramos et al. [11] covers only a subset of Defects4J (Closure, Lang, Chart, Math, and Mockito), their benchmark may not fully represent all subject in Defects4J. We reproduced their method in the remaining projects to collect more samples. While the APR community is increasingly exploring newer benchmarks, Defects4J remains the most widely used evaluation dataset in recent APR research [64]. Understanding evaluation bias in such dominant benchmarks is therefore critical, as conclusions drawn from them continue to shape research directions. Our results are limited to APR. While we expect metamorphic transformations to have the same impact on other tasks (e.g., code or test generation) this generalization remains to be confirmed. Threats to construct validity. We have used the frequency of patches that pass all tests as the performance metric to evaluate APR performance. However, a patch may pass the suite but fail to fully fix the bug [52] (test overfitting). Other studies use exactmatch metrics [3, 65, 35] or manual correctness checking [5, 6]. We chose test-suite pass rate since exactmatch metrics penalize bugs with multiple valid solutions [3], and manual check is infeasible. Although imperfect, this metric is applied equally to original and transformed groups, making it unlikely that overfitting biases one group more. We applied each transformation wherever possible in code. So, a transformation might have been applied multiple times in a larger code snippet. Hence, we compute not only the correlation between performance drop and transformations, but also between performance drop and bug size/complexity. For example, if a variable name transformation applies once to bug A but three times to bug B, this reflects that bug B has more local variables. Thus, our tests may reflect the impact of ’transformable’ features.
7. Conclusion and Future Work We explored metamorphic transformations as an evaluation-time diagnostic strategy for understanding the impact of data leakage. To this end, we applied semantic-preserving transformations to the Defects4J and GitBug-Java benchmarks and demonstrated that state-of-the-art LLMs exhibit noticeable performance degradation (w.r.t. their ability to generate bug fixes) on transformed bugs, particularly on Defects4J. We found that metamorphic transformations introducing nested conditionals and those involving identifier renaming were the most harmful overall. Identifier renaming, in particular, significantly degraded the APR performance for Claude-3.7, likely because identifier names act as cues for memorized solutions. We also
observed statistically significant (small and medium) correlations between performance drop and negative log-likelihood for Gemma-2, Llama-3.1, and Mistral7B, supporting the link between model familiarity and degradation in robustness under transformation. Together, metamorphic transformations and model familiarity (low NLL values) provide complementary evidence of data leakage. In future work, we aim to explore adversarial MT, where transformation combinations are selected to maximally reduce model performance on individual bugs. We also intend to expand our analysis to other code intelligence tasks, such as test case generation, bug localization, and code summarization, as well as to additional benchmarks and programming languages, including Python, C++, Kotlin, and JavaScript.
References [1] M. Beller, N. Spruit, D. Spinellis, and A. Zaidman, “On the dichotomy of debugging behavior among programmers,” in ICSE, 2018, pp. 572–583. [2] H. Krasner, “The cost of poor software quality in the us: A 2020 report,” Consortium for Information & Software Quality (CISQ), Tech. Rep., 2021. [3] K. Huang, Z. Xu, S. Yang, H. Sun, X. Li, Z. Yan, and Y. Zhang, “A survey on automated program repair techniques,” 2023. [4] Q. Zhang, C. Fang, Y. Xie, Y. Ma, W. Sun, Y. Yang, and Z. Chen, “A systematic literature review on large language models for automated program repair,” 2024. [5] J. Xiang, X. Xu, F. Kong, M. Wu, Z. Zhang, H. Zhang, and Y. Zhang, “How far can we go with practical function-level program repair?” 2024. [6] C. S. Xia and L. Zhang, “Automated program repair via conversation: Fixing 162 out of 337 bugs for $0.42 each using chatgpt,” in ISSTA, 2024, pp. 819–831. [7] F. Li, J. Jiang, J. Sun, and H. Zhang, “Hybrid automated program repair by combining large language models and program analysis,” 2024. [8] R. Just, D. Jalali, and M. D. Ernst, “Defects4j: A database of existing faults to enable controlled testing studies for java programs,” in ISSTA, 2014, pp. 437–440. [9] K. Zhou, Y. Zhu, Z. Chen, W. Chen, W. X. Zhao, X. Chen, Y. Lin, J.-R. Wen, and J. Han, “Don’t make your llm an evaluation benchmark cheater,” 2023. [10] J. Sallou, T. Durieux, and A. Panichella, “Breaking the silence: The threats of using llms in software engineering,” in ICSE NIER, 2024, pp. 102–106. [11] D. Ramos, C. Mamede, K. Jain, P. Canelas, C. Gamboa, and C. L. Goues, “Are large language models memorizing bug benchmarks?” 2024. [12] Y. Wu, Z. Li, J. M. Zhang, and Y. Liu, “Condefects: A complementary dataset to address data leakage for llm-based fault localization and program repair,” in FSE Companion, 2024, pp. 642–646.
[13] Q. Zhang, T. Zhang, J. Zhai, C. Fang, B. Yu, W. Sun, and Z. Chen, “A critical review of large language models on software engineering: An example from chatgpt and automated program repair,” 2024. [14] X. Zhou, M. Weyssow, R. Widyasari, T. Zhang, J. He, Y. Lyu, J. Chang, B. Zhang, D. Huang, and D. Lo, “Lessleak-bench: A first investigation of data leakage in llms across 83 software engineering benchmarks,” 2025. [15] L. Applis, A. Panichella, and A. van Deursen, “Assessing robustness of ml-based program analysis tools using metamorphic program transformations,” in ASE, 2021, pp. 1377–1381. [16] S. Segura, G. Fraser, A. B. Sanchez, and A. Ruiz-Cortés, “A survey on metamorphic testing,” IEEE Transactions on Software Engineering, vol. 42, no. 9, pp. 805–824, 2016. [17] A. Silva, N. Saavedra, and M. Monperrus, “Gitbug-java: A reproducible benchmark of recent java bugs,” in MSR, 2024, pp. 118–122. [18] S. Kim and D. Kim, “Automatic identifier inconsistency detection using code dictionary,” Empirical Software Engineering, vol. 21, no. 2, pp. 565–604, 2016. [19] A. Panichella, “Metamorphic-based many-objective distillation of llms for code-related tasks,” in ICSE, 2025. [20] A. Asgari, M. de Koning, P. Derakhshanfar, and A. Panichella, “Metamorphic testing of deep code models: A systematic literature review,” ACM Transactions on Software Engineering and Methodology. [21] A. Grattafiori, A. Dubey, A. Jauhri, A. Pandey, A. Kadian, A. Al-Dahle, A. Letman, A. Mathur, A. Schelten, A. Vaughan et al., “The llama 3 herd of models,” arXiv preprint arXiv:2407.21783, 2024. [22] G. Team, M. Riviere, S. Pathak, P. G. Sessa, C. Hardin, S. Bhupatiraju, L. Hussenot, T. Mesnard, B. Shahriari, A. Ramé et al., “Gemma 2: Improving open language models at a practical size,” arXiv preprint arXiv:2408.00118, 2024. [23] A. Q. Jiang, A. Sablayrolles, A. Mensch, and Others, “Mistral 7b,” 2023. [24] A. Lozhkov, R. Li, L. B. Allal, F. Cassano, J. LamyPoirier, N. Tazi, A. Tang, D. Pykhtar, J. Liu, Y. Wei et al., “Starcoder 2 and the stack v2: The next generation,” arXiv preprint arXiv:2402.19173, 2024. [25] T. Durieux, F. Madeiral, M. Martinez, and R. Abreu, “Empirical review of java program repair tools: A largescale experiment,” in ESEC/FSE, 2019, pp. 302–313. [26] W. E. Wong, R. Gao, Y. Li, R. Abreu, and F. Wotawa, “A survey on software fault localization,” IEEE Transactions on Software Engineering, vol. 42, no. 8, pp. 707– 740, 2016. [27] C. Le Goues, T. Nguyen, S. Forrest, and W. Weimer, “Genprog: A generic method for automatic software repair,” IEEE Transactions on Software Engineering, vol. 38, no. 1, pp. 54–72, 2012. [28] S. Sidiroglou-Douskos, E. Lahtinen, F. Long, and M. Rinard, “Automatic error elimination by horizontal code transfer across multiple applications,” in PLDI, 2015, pp. 43–54.
[29] Y. Wei, Y. Pei, C. A. Furia, L. S. Silva, S. Buchholz, B. Meyer, and A. Zeller, “Automated fixing of programs with contracts,” in ISSTA, 2010, pp. 61–72. [30] L. Chen, Y. Pei, and C. A. Furia, “Contract-based program repair without the contracts: An extended study,” IEEE Transactions on Software Engineering, vol. 47, no. 12, pp. 2841–2857, 2020. [31] D. Kim, J. Nam, J. Song, and S. Kim, “Automatic patch generation learned from human-written patches,” in ICSE, 2013, pp. 802–811. [32] X. B. D. Le, D. Lo, and C. Le Goues, “History driven program repair,” in SANER, 2016, pp. 213–224. [33] S. H. Tan and A. Roychoudhury, “Relifix: Automated repair of software regressions,” in ICSE, 2015, pp. 471– 482. [34] M. Tufano, C. Watson, G. Bavota, M. D. Penta, M. White, and D. Poshyvanyk, “An empirical study on learning bug-fixing patches in the wild via neural machine translation,” ACM Transactions on Software Engineering and Methodology, vol. 28, no. 4, 2019. [35] Z. Chen, S. Kommrusch, M. Tufano, L.-N. Pouchet, D. Poshyvanyk, and M. Monperrus, “Sequencer: Sequence-to-sequence learning for end-to-end program repair,” IEEE Transactions on Software Engineering, vol. 47, no. 9, pp. 1943–1959, 2019. [36] Y. Wang, W. Wang, S. Joty, and S. C. H. Hoi, “Codet5: Identifier-aware unified pre-trained encoderdecoder models for code understanding and generation,” 2021. [37] Z. Feng, D. Guo, D. Tang, N. Duan, X. Feng, M. Gong, L. Shou, B. Qin, T. Liu et al., “Codebert: A pre-trained model for programming and natural languages,” arXiv preprint arXiv:2002.08155, 2020. [38] M. Chen, J. Tworek, H. Jun, Q. Yuan, H. P. D. O. Pinto, J. Kaplan, H. Edwards, Y. Burda, N. Joseph, G. Brockman et al., “Evaluating large language models trained on code,” arXiv preprint arXiv:2107.03374, 2021. [39] J. Jiang, F. Wang, J. Shen, S. Kim, and S. Kim, “A survey on large language models for code generation,” arXiv preprint arXiv:2406.00515, 2024. [40] W. Sun, Y. Miao, Y. Li, H. Zhang, C. Fang, Y. Liu, G. Deng, Y. Liu, and Z. Chen, “Source code summarization in the era of large language models,” 2024. [41] X. Zhou, S. Cao, X. Sun, and D. Lo, “Large language model for vulnerability detection and repair: Literature review and the road ahead,” ACM Transactions on Software Engineering and Methodology, 2024. [42] H. Naveed, A. U. Khan, S. Qiu, M. Saqib, S. Anwar, M. Usman, N. Akhtar, N. Barnes, and A. Mian, “A comprehensive overview of large language models,” 2024. [43] L. Applis, A. Panichella, and R. Marang, “Searching for quality: Genetic algorithms and metamorphic testing for software engineering ml,” in GECCO, 2023, pp. 1490– 1498. [44] S. Zhou, M. Huang, Y. Sun, and K. Li, “Evolutionary multi-objective optimization for contextual adversarial example generation,” Proceedings of the ACM on Software Engineering, vol. 1, 2024.
[45] F. Gao, Y. Wang, and K. Wang, “Discrete adversarial attack to models of code,” Proceedings of the ACM on Programming Languages, vol. 7, 2023. [46] Y. Zhou, X. Zhang, J. Shen, T. Han, T. Chen, and H. Gall, “Adversarial robustness of deep code comment generation,” ACM Transactions on Software Engineering and Methodology, vol. 31, no. 4, 2022. [47] J. Jia, S. Srikant, T. Mitrovska, C. Gan, S. Chang, S. Liu, and U.-M. O’Reilly, “Clawsat: Towards both robust and accurate code models,” in SANER, 2023, pp. 212–223. [48] J. A. H. López, B. Chen, M. Saad, T. Sharma, and D. Varró, “On inter-dataset code duplication and data leakage in large language models,” IEEE Transactions on Software Engineering, vol. 51, no. 1, pp. 192–205, 2025. [49] A. Al-Kaswan, M. Izadi, and A. Van Deursen, “Traces of memorisation in large language models for code,” in ICSE, 2024, pp. 1–12. [50] R. Xu, Z. Wang, R.-Z. Fan, and P. Liu, “Benchmarking benchmark leakage in large language models,” 2024. [51] Y. Li, “Estimating contamination via perplexity: Quantifying memorisation in language model evaluation,” 2023. [52] Q. Zhang, C. Fang, Y. Ma, W. Sun, and Z. Chen, “A survey of learning-based automated program repair,” ACM Transactions on Software Engineering and Methodology, vol. 33, no. 2, 2023. [53] J. S. Bradbury and R. More, “Addressing data leakage in humaneval using combinatorial test design,” in ICST, 2025, pp. 587–591. [54] Z. Yang, J. Shi, J. He, and D. Lo, “Natural attack for pretrained models of code,” in ICSE, 2022, pp. 1482–1493. [55] T. Le-Cong, D. Nguyen, B. Le, and T. Murray, “Evaluating program repair with semantic-preserving transformations: A naturalness assessment,” CoRR, 2024. [56] H. Ge, W. Zhong, C. Li, J. Ge, H. Hu, and B. Luo, “Robustnpr: Evaluating the robustness of neural program repair models,” Journal of Software: Evolution and Process, vol. 36, no. 4, p. e2586, 2024. [57] F. Li, J. Jiang, J. Sun, and H. Zhang, “Evaluating the generalizability of llms in automated program repair,” 2025. [58] P. Xue, L. Wu, Z. Yang, X. Li, Z. Yu, Z. Jin, G. Li, Y. Xiao, and J. Wu, “Exploring and lifting the robustness of llm-powered automated program repair with metamorphic testing,” 2024. [59] W. Kwon, Z. Li, S. Zhuang, Y. Sheng, L. Zheng, C. H. Yu, J. E. Gonzalez, H. Zhang, and I. Stoica, “Efficient memory management for large language model serving with pagedattention,” in SOSP, 2023. [60] E. Nijkamp, B. Pang, H. Hayashi, L. Tu, H. Wang, Y. Zhou, S. Savarese, and C. Xiong, “Codegen: An open large language model for code with multi-turn program synthesis,” arXiv preprint arXiv:2203.13474, 2022. [61] J. Wei, X. Wang, D. Schuurmans, M. Bosma, B. Ichter, F. Xia, E. H. Chi, Q. V. Le, and D. Zhou, “Chain-ofthought prompting elicits reasoning in large language models,” in NeurIPS, 2022, pp. 24 824–24 837.
[62] A. Arcuri and L. Briand, “A hitchhiker’s guide to statistical tests for assessing randomized algorithms in software engineering,” Software Testing, Verification and Reliability, vol. 24, no. 3, pp. 219–250, 2014. [63] A. Vargha and H. D. Delaney, “A critique and improvement of the cl common language effect size statistics of mcgraw and wong,” Journal of Educational and Behavioral Statistics, vol. 25, no. 2, pp. 101–132, 2000. [64] B. Yang, Z. Cai, F. Liu, B. Le, L. Zhang, T. F. Bissyandé,
Y. Liu, and H. Tian, “A survey of llm-based automated program repair: Taxonomies, design paradigms, and applications,” 2025. [65] Z. Chen, S. Kommrusch, and M. Monperrus, “Neural transfer learning for repairing security vulnerabilities in c code,” IEEE Transactions on Software Engineering, vol. 49, no. 1, pp. 147–165, 2022.