Skip to content
aiqbench takeAI Products

aiqbench analysis

This research advances the application of Large Language Models in software engineering by integrating static analysis of call chains and dependencies to generate more robust unit tests for Java projects. The study demonstrates that explicitly modeling caller-callee relationships significantly improves code coverage and mutation scores compared to existing execution-path-based methods, addressing a key limitation in current LLM-driven testing tools.
Source coveringarXiv
What this isA model's reading of the article and related coverage, written for aiqbench. Not the publisher's words.

Call-Chain-Aware LLM-Based Test Generation for Java Projects

arXiv3 min read

arXiv:2604.22046v2 Announce Type: replace-cross 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 real-world GitHub projects released after the LLM's cut-off date, and compare it with the state-of-the-art LLM-based approach PANTA and the search-based tool EvoSuite. The results show that, across projects in Defects4J, CAT improves line coverage, branch coverage, and mutation score by 12.52, 12.97, and 14.39 percentage points (18.02%, 21.52%, and 26.94% relative), respectively, over PANTA, and by 9.67, 4.17, and 15.70 percentage points (13.37%, 6.04%, and 30.13% relative) over EvoSuite. On the post-cutoff projects, CAT also achieves the highest average line coverage, branch coverage, and mutation score among all compared approaches. An ablation study further demonstrates the importance of call-chain and dependency contexts in CAT.

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 real-world GitHub projects released after the LLM's cut-off date, and compare it with the state-of-the-art LLM-based approach PANTA and the search-based tool EvoSuite. The results show that, across projects in Defects4J, CAT improves line coverage, branch coverage, and mutation score by 12.52, 12.97, and 14.39 percentage points (18.02%, 21.52%, and 26.94% relative), respectively, over PANTA, and by 9.67, 4.17, and 15.70 percentage points (13.37%, 6.04%, and 30.13% relative) over EvoSuite. On the post-cutoff projects, CAT also achieves the highest average line coverage, branch coverage, and mutation score among all compared approaches. An ablation study further demonstrates the importance of call-chain and dependency contexts in CAT.

Software Engineering (cs.SE); Artificial Intelligence (cs.AI)

arXiv:2604.22046 [cs.SE]

(or arXiv:2604.22046v2 [cs.SE] for this version)

https://doi.org/10.48550/arXiv.2604.22046 Focus to learn more arXiv-issued DOI via DataCite

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Full text under the publisher's open licence · 311 words

Related coverage