Large-scale, Independent and Comprehensive study of the power of LLMs for test case generation

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Ouédraogo, Wendkûuni C., Kaboré, Kader, Li, Yinghua, Tian, Haoye, Koyuncu, Anil, Klein, Jacques, Lo, David, Bissyandé, Tegawendé F.
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866911483169865728
author Ouédraogo, Wendkûuni C.
Kaboré, Kader
Li, Yinghua
Tian, Haoye
Koyuncu, Anil
Klein, Jacques
Lo, David
Bissyandé, Tegawendé F.
author_facet Ouédraogo, Wendkûuni C.
Kaboré, Kader
Li, Yinghua
Tian, Haoye
Koyuncu, Anil
Klein, Jacques
Lo, David
Bissyandé, Tegawendé F.
contents Unit testing is essential for software reliability, yet manual test creation is time-consuming and often neglected. Search-based software testing improves efficiency but produces tests with poor readability and maintainability, while LLMs show promise but lack comprehensive evaluation across reasoning-based prompting and real-world scenarios. This study presents the first large-scale empirical evaluation of LLM-generated unit tests at the full class level, analyzing four models (GPT-3.5, GPT-4, Mistral 7B, and Mixtral 8x7B) against EvoSuite across 216,300 test cases targeting Defects4J, SF110, and CMD. We evaluate five prompting techniques, ZSL, FSL, CoT, ToT, and GToT, assessing compilability, hallucination-driven failures, readability, coverage, and test smells. Reasoning-based prompting, particularly GToT, significantly enhances reliability and compilability, yet hallucination-driven failures remain persistent, with compilation failure rates reaching 86%. While LLM-generated tests are generally more readable than SBST outputs, recurring issues such as Magic Number Tests and Assertion Roulette hinder maintainability. These findings suggest that hybrid approaches combining LLM-based generation with automated validation and search-based refinement are necessary for production-ready results.
format Preprint
id arxiv_https___arxiv_org_abs_2407_00225
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Large-scale, Independent and Comprehensive study of the power of LLMs for test case generation
Ouédraogo, Wendkûuni C.
Kaboré, Kader
Li, Yinghua
Tian, Haoye
Koyuncu, Anil
Klein, Jacques
Lo, David
Bissyandé, Tegawendé F.
Software Engineering
Unit testing is essential for software reliability, yet manual test creation is time-consuming and often neglected. Search-based software testing improves efficiency but produces tests with poor readability and maintainability, while LLMs show promise but lack comprehensive evaluation across reasoning-based prompting and real-world scenarios. This study presents the first large-scale empirical evaluation of LLM-generated unit tests at the full class level, analyzing four models (GPT-3.5, GPT-4, Mistral 7B, and Mixtral 8x7B) against EvoSuite across 216,300 test cases targeting Defects4J, SF110, and CMD. We evaluate five prompting techniques, ZSL, FSL, CoT, ToT, and GToT, assessing compilability, hallucination-driven failures, readability, coverage, and test smells. Reasoning-based prompting, particularly GToT, significantly enhances reliability and compilability, yet hallucination-driven failures remain persistent, with compilation failure rates reaching 86%. While LLM-generated tests are generally more readable than SBST outputs, recurring issues such as Magic Number Tests and Assertion Roulette hinder maintainability. These findings suggest that hybrid approaches combining LLM-based generation with automated validation and search-based refinement are necessary for production-ready results.
title Large-scale, Independent and Comprehensive study of the power of LLMs for test case generation
topic Software Engineering
url https://arxiv.org/abs/2407.00225