ASTER: Natural and Multi-language Unit Test Generation with LLMs
Rangeet Pan, Myeongsoo Kim, Rahul Krishna, Raju Pavuluri, Saurabh, Sinha

TL;DR
This paper explores how large language models, guided by static analysis, can generate high-quality, natural, and multi-language unit tests, demonstrating competitive coverage and developer-friendly readability.
Contribution
It introduces a generic pipeline leveraging LLMs and static analysis for multi-language unit test generation, improving coverage and naturalness over existing methods.
Findings
LLM-guided test generation achieves high code coverage.
Generated tests are more natural and understandable to developers.
The approach is effective across Java and Python, including complex scenarios.
Abstract
Implementing automated unit tests is an important but time-consuming activity in software development. To assist developers in this task, many techniques for automating unit test generation have been developed. However, despite this effort, usable tools exist for very few programming languages. Moreover, studies have found that automatically generated tests suffer poor readability and do not resemble developer-written tests. In this work, we present a rigorous investigation of how large language models (LLMs) can help bridge the gap. We describe a generic pipeline that incorporates static analysis to guide LLMs in generating compilable and high-coverage test cases. We illustrate how the pipeline can be applied to different programming languages, specifically Java and Python, and to complex software requiring environment mocking. We conducted an empirical study to assess the quality of…
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.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsEducational Technology and Assessment · Natural Language Processing Techniques
