Fix the Tests: Augmenting LLMs to Repair Test Cases with Static Collector and Neural Reranker
Not on the map. Why?
Abstract (arXiv)
During software evolution, it is advocated that test code should co-evolve with production code. In real development scenarios, test updating may lag behind production code changing, which may cause compilation failure or bring other troubles. Existing techniques based on pre-trained language models can be directly adopted to repair obsolete tests caused by such unsynchronized code changes, especially syntactic-related ones. However, the lack of task-oriented contextual information affects the repair accuracy on large-scale projects. Starting from an obsolete test, the key challenging task is precisely identifying and constructing Test-Repair-Oriented Contexts (TROCtxs) from the whole repository within a limited token size. In this paper, we propose SYNTER (SYNtactic-breaking-changes-induced TEst Repair), a novel approach based on LLMs to automatically repair obsolete test cases via precise and concise TROCtxs construction. Inspired by developers' programming practices, we design three types of TROCtx: class context, usage context, and environment context. Given an obsolete test case to repair, SYNTER firstly collects the related code information for each type of TROCtx through static analysis techniques automatically. Then, it generates reranking queries to identify the most relevant TROCtxs, which will be taken as the repair-required key contexts and be input to the large language model for the final test repair. To evaluate the effectiveness of SYNTER, we construct a benchmark dataset that contains a set of obsolete tests caused by syntactic breaking changes. The experimental results show that SYNTER outperforms baseline approaches both on textual- and intent-matching metrics. With the augmentation of constructed TROCtxs, hallucinations are reduced by 57.1%.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). First posted on arXiv 4 Jul 2024.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 1; 2026: 3.
4 papers.
- 2025Large Language Models for Software Testing: A Research Roadmapcited by 2
- 2026Breaking, Stale, or Missing? Benchmarking Coding Agents on Project-Level Test Evolutioncited by 1
- 2026TestEvo-Bench: An Executable and Live Benchmark for Test and Code Co-Evolutioncited by 1
- 2026MuMuTestUp: Mutation-based Multi-Agent Test Case Updatecited by 0
- 2026TestEvo-Bench: An Executable and Live Benchmark for Test and Code Co-Evolution2 Jul 2026
- 2026MuMuTestUp: Mutation-based Multi-Agent Test Case Update19 May 2026
- 2026Breaking, Stale, or Missing? Benchmarking Coding Agents on Project-Level Test Evolution7 May 2026
- 2025Large Language Models for Software Testing: A Research Roadmap29 Sep 2025