Search papers, labs, and topics across Lattice.
This paper explores the transformation of historical real-bug mechanisms into executable feedback for enhancing LLM-based unit test generation. By constructing structural and semantic representations of real-bug records, the authors retrieve applicable mechanisms to create synthetic bugs that guide iterative test improvements. The evaluation on Defects4J shows that this mechanism-guided approach significantly outperforms traditional methods in real-bug detection, highlighting the effectiveness of using organized real-bug mechanisms as feedback targets.
Mechanism-guided synthetic bugs can dramatically enhance LLM-based unit test generation, leading to superior real-bug detection.
Large language models (LLMs) have opened new opportunities for unit test generation, but executable tests do not necessarily reveal real defects. This paper studies how historical real-bug mechanisms can be transformed into executable feedback targets for LLM-based unit test generation. The proposed framework constructs structural and semantic representations of real-bug records, retrieves mechanisms applicable to a focal method, and instantiates them as synthetic bugs that guide iterative test enhancement. We evaluate the approach on method-level real-bug detection tasks from Defects4J and show that mechanism-guided synthetic-bug feedback improves real-bug detection over execution-, coverage-, mutation-, knowledge-, and search-based baselines. The results suggest that organizing real-bug mechanisms as retrievable and executable feedback targets is an effective way to guide generated tests toward bug-triggering inputs and behavioral oracles.