🤖 AI Summary
This paper addresses the lack of automated, standardized evaluation methods for LLM-generated Java unit tests. To this end, we propose AgoneTest—the first end-to-end LLM-based test generation evaluation framework tailored for Java. Its core contributions include: (1) the construction of Classes2Test, a benchmark dataset specifically designed for evaluating test generation; (2) a multidimensional evaluation pipeline integrating compilation success rate, line/branch coverage, mutation score (MS), and test smells; and (3) empirical identification of significant impacts of prompting strategies on test quality. Experimental results demonstrate that, among compilable generated tests, the best-performing LLM achieves a mutation detection capability surpassing manually written tests, with 92.3% line coverage—validating the practical potential of LLMs for industrial-grade Java unit test generation.
📝 Abstract
Unit testing is an essential but resource-intensive step in software development, ensuring individual code units function correctly. This paper introduces AgoneTest, an automated evaluation framework for Large Language Model-generated (LLM) unit tests in Java. AgoneTest does not aim to propose a novel test generation algorithm; rather, it supports researchers and developers in comparing different LLMs and prompting strategies through a standardized end-to-end evaluation pipeline under realistic conditions. We introduce the Classes2Test dataset, which maps Java classes under test to their corresponding test classes, and a framework that integrates advanced evaluation metrics, such as mutation score and test smells, for a comprehensive assessment. Experimental results show that, for the subset of tests that compile, LLM-generated tests can match or exceed human-written tests in terms of coverage and defect detection. Our findings also demonstrate that enhanced prompting strategies contribute to test quality. AgoneTest clarifies the potential of LLMs in software testing and offers insights for future improvements in model design, prompt engineering, and testing practices.