Keywords :
automatic test generation; empirical evaluation; large language models; prompt engineering; unit tests; Automatic test generation; Empirical evaluations; Language model; Large language model; Large-scales; Prompt engineering; Time constraints; Unit test generations; Unit testing; Unit tests; Artificial Intelligence; Software; Safety, Risk, Reliability and Quality
Abstract :
[en] Unit testing, essential for identifying bugs, is often neglected due to time constraints. Automated test generation tools exist but typically lack readability and require developer intervention. Large Language Models (LLMs) like GPT and Mistral show potential in test generation, but their effectiveness remains unclear.This study evaluates four LLMs and five prompt engineering techniques, analyzing 216 300 tests for 690 Java classes from diverse datasets. We assess correctness, readability, coverage, and bug detection, comparing LLM-generated tests to EvoSuite. While LLMs show promise, improvements in correctness are needed. The study highlights both the strengths and limitations of LLMs, offering insights for future research.
Scopus citations®
without self-citations
6