Daily Arxiv

This page organizes papers related to artificial intelligence published around the world.
This page is summarized using Google Gemini and is operated on a non-profit basis.
The copyright of the paper belongs to the author and the relevant institution. When sharing, simply cite the source.

Navigating the Labyrinth: Path-Sensitive Unit Test Generation with Large Language Models

Created by
  • Haebom

Author

Dianshu Liao, Xin Yin, Shidong Pan, Chao Ni, Zhenchang Xing, Xiaoyu Sun

Outline

JUnitGenie is a framework for automating unit testing for software quality assurance. To overcome the limitations of existing methods that rely on fixed heuristics or limited contextual information, JUnitGenie combines code knowledge with the semantic power of LLM to generate path-sensitive unit tests. JUnitGenie extracts code knowledge from Java projects, generates structured prompts, and then generates high-coverage unit tests. In evaluations on 2,258 complex methods across 10 real-world Java projects, JUnitGenie improved branch and line coverage by an average of 29.60% and 31.00%, respectively, compared to existing methods, and identified real-world bugs that were subsequently fixed by developers.

Takeaways, Limitations

Overcome limitations of existing methods and achieve high coverage by generating path-sensitive unit tests.
Contribute to improving software quality by finding real bugs
Combining LLM and code knowledge presents new possibilities for unit test automation.
Evaluation target is limited to Java projects
Results may vary depending on LLM performance
May have limited effectiveness for code with complex control-flow structures.
👍