Fix the Tests: Augmenting LLMs to Repair Test Cases with Static Collector and Neural Reranker
Jun Liu, Jiwei Yan, Yuanyuan Xie, Jun Yan, Jian Zhang

TL;DR
This paper introduces SYNTER, a novel LLM-based approach that constructs specific contexts from code repositories to accurately repair obsolete test cases, significantly reducing hallucinations and improving repair precision.
Contribution
SYNTER uniquely combines static analysis and neural reranking to generate precise contexts for test repair, advancing automated test maintenance in large-scale software projects.
Findings
SYNTER outperforms baseline methods on textual and intent-matching metrics.
Hallucinations in test repair are reduced by 57.1%.
Constructed TROCtxs improve repair accuracy.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNon-Destructive Testing Techniques
