Static Program Analysis Guided LLM Based Unit Test Generation
Not on the map. Why?
Abstract (arXiv)
We describe a novel approach to automating unit test generation for Java methods using large language models (LLMs). Existing LLM-based approaches rely on sample usage(s) of the method to test (focal method) and/or provide the entire class of the focal method as input prompt and context. The former approach is often not viable due to the lack of sample usages, especially for newly written focal methods. The latter approach does not scale well enough; the bigger the complexity of the focal method and larger associated class, the harder it is to produce adequate test code (due to factors such as exceeding the prompt and context lengths of the underlying LLM). We show that augmenting prompts with concise and precise context information obtained by program analysis %of the focal method increases the effectiveness of generating unit test code through LLMs. We validate our approach on a large commercial Java project and a popular open-source Java project.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 7 of its 13 references that are in the map. First posted on arXiv 7 Mar 2025.
Builds on
7 of 13 references.
References · 7
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 194
- 2020Unit Test Case Generation with Transformers and Focal Contextcited by 118
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
- 2021TOGA: A Neural Method for Test Oracle Generationcited by 57
- 2020Generating Accurate Assert Statements for Unit Test Cases using Pretrained Transformerscited by 30
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026Call-Chain-Aware LLM-Based Test Generation for Java Projects23 Apr 2026