Reproduce “HITS: High-coverage LLM-based Unit Test Generation via Method Slicing” on OpenResearch
Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Zejun Wang, Kaibo Liu, Ge Li, Zhi Jin
The HITS framework enhances LLM-based unit test generation by decomposing complex methods into smaller, manageable slices. This approach allows LLMs to generate tests with 58.1% line coverage and 87.7% execution pass rate for complex Java methods, addressing a limitation of prior LLM-based methods.
Key insights
- Decomposing complex methods into smaller, manageable slices allows LLMs to generate more focused and comprehensive unit tests.
- Carefully engineered prompts guide the LLM to identify scenarios, inputs, and environments for individual code slices.
- A robust post-processing stage, including self-correction mechanisms, is crucial for improving the executability and effectiveness of LLM-generated tests.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.