Leveraging Large Language Models for Enhancing the Understandability of Generated Unit Tests
Amirhossein Deljouyi, Roham Koohestani, Maliheh Izadi, Andy Zaidman

TL;DR
This paper presents UTGen, a tool that uses large language models to improve the understandability of automatically generated unit tests, leading to better bug-fixing performance in real-world scenarios.
Contribution
We introduce UTGen, combining search-based testing and large language models to enhance test understandability through contextual data, naming, and comments.
Findings
Participants fixed 33% more bugs with UTGen tests.
Participants used 20% less time on bug-fixing tasks.
Enhanced test cases improved user perception of understandability.
Abstract
Automated unit test generators, particularly search-based software testing tools like EvoSuite, are capable of generating tests with high coverage. Although these generators alleviate the burden of writing unit tests, they often pose challenges for software engineers in terms of understanding the generated tests. To address this, we introduce UTGen, which combines search-based software testing and large language models to enhance the understandability of automatically generated test cases. We achieve this enhancement through contextualizing test data, improving identifier naming, and adding descriptive comments. Through a controlled experiment with 32 participants from both academia and industry, we investigate how the understandability of unit tests affects a software engineer's ability to perform bug-fixing tasks. We selected bug-fixing to simulate a real-world scenario that…
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
TopicsNatural Language Processing Techniques · Topic Modeling
