LLM Test Generation via Iterative Hybrid Program Analysis

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Gu, Sijia, Nashid, Noor, Mesbah, Ali
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866909759046680576
author Gu, Sijia
Nashid, Noor
Mesbah, Ali
author_facet Gu, Sijia
Nashid, Noor
Mesbah, Ali
contents Automating unit test generation remains a significant challenge, particularly for complex methods in real-world projects. While Large Language Models (LLMs) have made strides in code generation, they struggle to achieve high branch coverage due to their limited ability to reason about intricate control flow structures. To address this limitation, we introduce Panta, a technique that emulates the iterative process human developers follow when analyzing code and constructing test cases. Panta integrates static control flow analysis and dynamic code coverage analysis to systematically guide LLMs in identifying uncovered execution paths and generating better test cases. By incorporating an iterative feedback-driven mechanism, our technique continuously refines test generation based on static and dynamic path coverage insights, ensuring more comprehensive and effective testing. Our empirical evaluation, conducted on classes with high cyclomatic complexity from open-source projects, demonstrates that Panta achieves 26% higher line coverage and 23% higher branch coverage compared to the state-of-the-art.
format Preprint
id arxiv_https___arxiv_org_abs_2503_13580
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle LLM Test Generation via Iterative Hybrid Program Analysis
Gu, Sijia
Nashid, Noor
Mesbah, Ali
Software Engineering
Artificial Intelligence
Automating unit test generation remains a significant challenge, particularly for complex methods in real-world projects. While Large Language Models (LLMs) have made strides in code generation, they struggle to achieve high branch coverage due to their limited ability to reason about intricate control flow structures. To address this limitation, we introduce Panta, a technique that emulates the iterative process human developers follow when analyzing code and constructing test cases. Panta integrates static control flow analysis and dynamic code coverage analysis to systematically guide LLMs in identifying uncovered execution paths and generating better test cases. By incorporating an iterative feedback-driven mechanism, our technique continuously refines test generation based on static and dynamic path coverage insights, ensuring more comprehensive and effective testing. Our empirical evaluation, conducted on classes with high cyclomatic complexity from open-source projects, demonstrates that Panta achieves 26% higher line coverage and 23% higher branch coverage compared to the state-of-the-art.
title LLM Test Generation via Iterative Hybrid Program Analysis
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2503.13580