EUVIMEDEUVIMED entdecken
Crossref

Fusing LLMs and Genetic Algorithm for High-Quality Unit Test Generation

Yiwen Fu, Xiang Gao, Binhang Qi, Yuan Yuan, Hailong Sun

ACM Transactions on Software Engineering and Methodology · 18.06.2026

DOI: 10.1145/3819237 ↗

Kurz gefasst

Fachartikel in der Zeitschrift ACM Transactions on Software Engineering and Methodology, online erschienen am 18.06.2026. Verfasst von Yiwen Fu und 4 weiteren Autor:innen. Die Arbeit nennt 83 Literaturangaben.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

Unit testing is essential for early defect detection and software reliability. Existing automated test generation tools, including both search-based and Large Language Model (LLM)-centric approaches, still face significant challenges, including difficulties in producing compilable and executable tests for complex projects, limited coverage with insufficient exploration of control flows and edge cases, and a lack of systematic feedback mechanisms that integrate global search, semantic reasoning, and adaptive refinement. To address these limitations, we present LegaTest , an automated unit test generation framework that synergizes LLM with Genetic Algorithms (GA) through a coordinated Generation–Repair–Optimization process. LegaTest begins with a dual-prompt strategy to generate structurally sound and semantically meaningful test seeds, which are then iteratively refined using execution feedback and coverage guidance. The framework integrates LLM-driven insights with GA operators such as greedy selection, LLM-guided crossover, and semantic-driven mutation. Multi-strategy test repair with hierarchical criteria progressively resolves syntactic and semantic errors, improving both correctness and robustness. On the Defects4J benchmark as well as four Java projects adopted from the experimental setup of ChatUniTest, LegaTest achieves 66.95% line, 54.37% branch, and 74.16% method coverage with 93.3% generation success and 18.7% semantically meaningful assertions, outperforming existing tools by up to 34.7% in coverage, 59.6% in generation success, and 16.5% in assertions, while maintaining concise test suites.

Zitieren

APA

Fu, Y., Gao, X., Qi, B., Yuan, Y., & Sun, H. (2026). Fusing LLMs and Genetic Algorithm for High-Quality Unit Test Generation. ACM Transactions on Software Engineering and Methodology. https://doi.org/10.1145/3819237

Vancouver

Fu Y, Gao X, Qi B, Yuan Y, Sun H. Fusing LLMs and Genetic Algorithm for High-Quality Unit Test Generation. ACM Transactions on Software Engineering and Methodology. 2026. doi:10.1145/3819237

BibTeX
@article{Fu2026,
  author = {Fu, Yiwen and Gao, Xiang and Qi, Binhang and Yuan, Yuan and Sun, Hailong},
  title = {Fusing LLMs and Genetic Algorithm for High-Quality Unit Test Generation},
  journal = {ACM Transactions on Software Engineering and Methodology},
  year = {2026},
  doi = {10.1145/3819237}
}
Kostenlos starten →