Call-Chain-Aware LLM-Based Test Generation for Java Projects
Guancheng Wang, Qinghua Xu, Lionel C. Briand, Zhaoqiang Guo, Kui Liu

TL;DR
This paper introduces CAT, a call-chain-aware LLM-based test generation method for Java that improves coverage by incorporating static analysis of call chains and dependencies.
Contribution
The paper presents a novel approach that explicitly models call chains and dependencies in prompts, enhancing test generation for complex Java projects.
Findings
CAT improves line coverage by 18.04% over PANTA.
CAT increases branch coverage by 21.74% over PANTA.
It outperforms state-of-the-art methods on real-world projects.
Abstract
Large language models (LLMs) have recently shown strong potential for generating project-level unit tests. However, existing state-of-the-art approaches primarily rely on execution-path information to guide prompt construction, which is often insufficient for complex software systems with rich inter-class dependencies, deep call chains, and intricate object initialization requirements. In this paper, we present CAT, a novel call-chain-aware LLM-based test generation approach that explicitly incorporates call-chain and dependency contexts into prompts through dedicated static analysis. To construct executable, semantically valid test contexts, CAT systematically models caller--callee relationships, object constructors, and third-party dependencies, and supports iterative test fixing when generation failures occur. We evaluate CAT on the widely used Defects4J benchmark and on four…
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.
