arXiv:2610.11835cs.SEOct 2026

Manuscript Offprint

arXiv:2610.11835

On the Risks of using LLM-Generated Tests for Regression Testing

Mohammadali Charoosaei, Cedric Richter, Mike Papadakis

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

MOHAMMADALI CHAROOSAEI, SnT, University of Luxembourg, Luxembourg

CEDRIC RICHTER, SnT, University of Luxembourg, Luxembourg

MIKE PAPADAKIS, SnT, University of Luxembourg, Luxembourg

Software is under constant evolution. Developers continuously add features, fix bugs, and refactor code, and any of these changes may inadvertently break existing functionality. Regression testing guards against such unintended effects by capturing expected behavior in test cases: when a test fails after a change, it signals that previously established behavior has been altered. LLM-based test generation aims to automate this process by generating regression tests directly from the code under test. While this approach can be beneficial when the implementation is correct, it becomes particularly problematic when the code contains faults. In such cases, generated tests may encode and preserve incorrect behavior, allowing faults to persist and potentially influence subsequent stages of software evolution. To investigate this risk, we apply LLM-based regression test generation to pull requests merged into the main branch of software projects and study the impact of the generated tests on subsequent project evolution. We distinguish between fault-revealing, which assert correctly implemented behavior, and fault-enforcing tests, which assert faulty behavior. We then empirically quantify the extent to which fault-enforcing tests can preserve bugs and hinder their correction during software evolution. Across 145 pull requests from SciPy, Qiskit, and pandas, 8%-17% of the generated tests are fault-enforcing, while only 2.4%-4.8% reveal faults. Most of the remaining tests do not provide any relevant signal, i.e., they pass on both versions or fail on both. Fault-enforcing tests persist over time: after several subsequent commits, 83%-91% of them are still relevant and pass. We also find that fault-enforcing tests may also accumulate over time: when the faults of all pull requests are combined in one codebase, 83%-92% remain enforced at the end of the commit history, and the developer-written test suite detects only 14%-30% of them. Taken together, our results reveal a fundamental risk of LLM-generated regression tests: without manual validation, they may encode faulty behavior as expected behavior, allowing bugs to persist across software revisions and largely evade detection by developer-maintained test suites. As a result, LLM-based regression testing can give rise to a new form of technical debt, in which accumulated fault-enforcing tests perpetuate defects and constrain software evolution.

CCS Concepts: • Software and its engineering → Software testing and debugging; Software verification and validation; Maintaining software.

Additional Key Words and Phrases: Regression Testing, Mutation Testing, Software Evolution, Test Generation

1 Introduction

Modern software systems evolve continuously, with developers frequently submitting pull requests (PRs) that add features or fix bugs. Each change risks introducing a regression: functionality that worked before breaks after the change. Regression testing [40] detects such regressions, so that developers can react and fix the broken behavior if necessary. However, writing high-quality regression tests is among the most expensive activities in software maintenance [20, 40] and requires substantial effort and domain knowledge. As a result, newly introduced behavior is often under-tested, leaving the project vulnerable to future regressions.

Recent advances in LLMs promise to reduce this effort. By exploiting code context, commit messages, and code diffs, LLM-based approaches can automatically generate executable regression tests for software changes. ChaCo [41] augments tests at the pull-request level by targeting previously uncovered lines; Liu et al. [21] evaluate LLM-generated regression tests for commits;

Authors' Contact Information: Mohammadali Charoosaei, mohammadali.charoosaei@uni.lu, SnT, University of Luxembourg, Luxembourg; Cedric Richter, cedric.richter@uni.lu, SnT, University of Luxembourg, Luxembourg; Mike Papadakis, michail.papadakis@uni.lu, SnT, University of Luxembourg, Luxembourg.

Mohammadali Charoosaei, Cedric Richter, and Mike Papadakis

Figure

Fig. 1. LLM-based regression testings works under the assumption that a PR reflects the intended change. In a realistic setting where a PR might be faulty, LLM-based regression testing risks to enforce the faulty behavior of the PR. We study how frequent LLMs enforce faulty behavior and how fault-enforcing tests propagate through the history of the codebase.

SymPrompt [35] uses code-aware prompting for coverage-guided generation; and CoverUp [33] iteratively extends test suites using coverage feedback. These approaches report substantial coverage improvements with little manual intervention, which suggests that LLMs could considerably reduce the effort of maintaining evolving test suites.

Despite these efforts, LLM-generated regression tests differ fundamentally from a developer's testing process. When a developer writes a regression test for a new PR and the test fails, they investigate whether the fault lies in the code or in the test [23, 37]. LLM-based test generators instead treat the code as correct: they repair or discard failing tests [9, 33], so a bug in the PR is not surfaced. This difference relates to the oracle problem [1]. When the implementation is the main available description of behavior, LLMs may infer assertions from what the current code does, rather than what it is intended to do [18]. When the code is defective, a generated test can thus encode the defect as expected behavior: the buggy implementation passes it, while a corrected version fails. We call such tests fault-enforcing (Figure 1).

Fault-enforcing tests become particularly risky in evolving projects: They appear harmless at creation because all tests passes, so the developer gets no signal that anything is wrong, and the test enters the suite as if it were a validated expectation. Its cost appears later. When the fault is eventually found and fixed, the test fails on the correct code, and the developer has to decide whether the failure is a regression or a wrong test, which can require examining recent changes to both the production and the test code [37]. Until then, the test makes the faulty behavior look specified: it adds coverage and test count without verifying intended behavior. In an evolving project that merges generated tests across many PRs, such tests can accumulate, each making an existing fault harder to fix and the suite less trustworthy over time.

This raises a fundamental question:

Do LLM-generated regression tests enforce faults that persist and accumulate as the project evolves?

We study this question on three open-source GitHub projects, SciPy, Qiskit, and pandas. We inject faults into historical PRs and generate regression tests for each of them, simulating a developer who accepts the generated tests without validating them. Such behavior is common in a vibe-coding setting [7] where developers trust whatever the LLM produces. We then track whether the enforced faults persist through later project changes, accumulate across PRs, and escape detection by the project's test suite.

Across 145 PRs (and 60,780 injected faults; Figure 2), we find that LLM-generated regression tests enforce faults consistently more often than they reveal them. Depending on the project, 8%-17% of

Figure

fault-enforcing / still accepts its fault

fault-revealing / test now detects its fault

Figure

fault rewritten away (excluded)

caught by a developer test

Fig. 2. When generating LLM-based regression tests for faulty PRs, 8.4%–16.9% of faults are enforced by the generated test suite, i.e. they pass on the faulty post-PR code and fail on the intended (left). Faults that are enforced often survive until the end of the studied project history (in 82.8% – 90.9% of cases; middle). Faults accumulate (right; SciPy as an example): of 23 faults injected into a single codebase on average, 20 remain enforced at the end of our simulation.

the generated tests enforce the injected fault, while only 2.4%–4.8% reveal it. Enforced faults are also durable: after several later commits, 83%–91% of fault-enforcing tests still pass only on the faulty code, so fixing the fault would still break them. They accumulate as well: when the faults of all PRs are combined in one codebase, 83%–92% remain enforced by a generated test at the end of the commit history, and the project's test suite detects only 14%–30% of them. Without manual validation, generated regression tests can therefore lock faults into the test suite.

Overall, our results show that LLM-based regression testing can give rise to a new form of technical debt, in which accumulated fault-enforcing tests perpetuate defects and inhibit software evolution.

Contributions. This paper makes the following contributions:

  • A behavioral taxonomy of LLM-generated regression tests with four categories (fault-revealing, fault-enforcing, weak, invalid), which classifies each test by its behavior on the faulty and the fixed code and thus measures test quality beyond coverage, together with a mutation-based methodology that measures it by injecting faults into historical PRs and tracking the generated tests through the commit history.

  • Two longitudinal analyses of fault-enforcing tests: persistence of individual tests across later commits, and accumulation of enforced faults when the faults of many PRs are combined in one codebase, including whether the project’s test suite detects them.

• An empirical study on 145 PRs from SciPy, Qiskit, and pandas. Fault-enforcing tests are 8%–17% of the generated tests, versus 2.4%–4.8% fault-revealing; 83%–91% of them persist; and when faults accumulate, 83%–92% remain enforced while the project’s test suite detects only 14%–30% of them.

References (33)