English

Escaping the Self-Repair Trap: Improving Test Oracle Generation via Dual-Context Awareness

Software Engineering 2026-08-06 v1

Abstract

Large Language Models (LLMs) have shown strong potential for regression-oracle completion, where a test prefix is given and the current program version is treated as expected behavior. Recent approaches increasingly rely on iterative self-repair and execution feedback, but optimizing execution success does not necessarily yield strong fault-revealing oracles. This objective, widely adopted in repair-based methods, serves only as a proxy and may be misaligned with the true goal of oracle generation. Such misalignment biases the repair process, giving rise to a feedback-driven degeneration that we term the Self-Repair Trap, where iterative repair progressively drives models toward assertions that are easier to satisfy but less effective at detecting faults. To address this issue, we propose DCAware, a computationally efficient, non-iterative framework that prioritizes high signal-to-noise contextual grounding over multi-round repair. DCAware integrates structured static context with selectively retrieved dynamic states, enabling precise and robust oracle generation without iterative feedback loops. Extensive experiments based on execution and mutation testing show that DCAware consistently improves fault-revealing effectiveness while maintaining high execution success, outperforming prior methods with substantially lower computational cost. Our results suggest that improving contextual quality is more effective than adding iterative repair complexity in the studied regression-oracle setting.

Keywords

Cite

@article{arxiv.2608.05917,
  title  = {Escaping the Self-Repair Trap: Improving Test Oracle Generation via Dual-Context Awareness},
  author = {Kefan Li and Hongyue Yu and Yuan Yuan},
  journal= {arXiv preprint arXiv:2608.05917},
  year   = {2026}
}

Comments

Accepted to ASE 2026