LLMs for Automated Unit Test Generation and Assessment in Java: The AgoneTest Framework

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Lops, Andrea, Narducci, Fedelucio, Ragone, Azzurra, Trizio, Michelantonio, Bartolini, Claudio
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866912730373423104
author Lops, Andrea
Narducci, Fedelucio
Ragone, Azzurra
Trizio, Michelantonio
Bartolini, Claudio
author_facet Lops, Andrea
Narducci, Fedelucio
Ragone, Azzurra
Trizio, Michelantonio
Bartolini, Claudio
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2511_20403
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle LLMs for Automated Unit Test Generation and Assessment in Java: The AgoneTest Framework
Lops, Andrea
Narducci, Fedelucio
Ragone, Azzurra
Trizio, Michelantonio
Bartolini, Claudio
Software Engineering
Artificial Intelligence
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.
title LLMs for Automated Unit Test Generation and Assessment in Java: The AgoneTest Framework
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2511.20403