TestWeaver: Execution-aware, Feedback-driven Regression Testing Generation with Large Language Models

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Le, Cuong Chi, Van, Cuong Duc, Vu, Tung Duy, Vu, Thai Minh Pham, Phan, Hoang Nhat, Phan, Huy Nhat, Nguyen, Tien N.
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866914282394877952
author Le, Cuong Chi
Van, Cuong Duc
Vu, Tung Duy
Vu, Thai Minh Pham
Phan, Hoang Nhat
Phan, Huy Nhat
Nguyen, Tien N.
author_facet Le, Cuong Chi
Van, Cuong Duc
Vu, Tung Duy
Vu, Thai Minh Pham
Phan, Hoang Nhat
Phan, Huy Nhat
Nguyen, Tien N.
contents While recent advances in large language models (LLMs) have shown promise in automating test generation for regression testing, they often suffer from limited reasoning about program execution, resulting in stagnated coverage growth - a phenomenon known as the coverage plateau. This paper presents TestWeaver, a novel LLM-based approach that integrates lightweight program analysis to create a focused execution context that assists LLMs in better test generation. TestWeaver strategically chooses the following components to overcome LLMs' limited reasoning on complex execution: (1) it reduces hallucinations and improves focus by supplying the LLM with the backward slice from the target line instead of a full program context; (2) it identifies and incorporates close test cases - those that share control-flow similarities with the path to the target line - to provide focused execution context within the LLM's context window; and (3) it enhances LLM's reasoning with execution in-line annotations that encode variable states as comments along the executed path. By equipping LLMs with these targeted and contextualized inputs, it improves coverage-guided test generation and mitigates redundant explorations. Empirical results show that TestWeaver accelerates code coverage growth and generates more effective test cases than the state-of-the-art approaches.
format Preprint
id arxiv_https___arxiv_org_abs_2508_01255
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle TestWeaver: Execution-aware, Feedback-driven Regression Testing Generation with Large Language Models
Le, Cuong Chi
Van, Cuong Duc
Vu, Tung Duy
Vu, Thai Minh Pham
Phan, Hoang Nhat
Phan, Huy Nhat
Nguyen, Tien N.
Software Engineering
While recent advances in large language models (LLMs) have shown promise in automating test generation for regression testing, they often suffer from limited reasoning about program execution, resulting in stagnated coverage growth - a phenomenon known as the coverage plateau. This paper presents TestWeaver, a novel LLM-based approach that integrates lightweight program analysis to create a focused execution context that assists LLMs in better test generation. TestWeaver strategically chooses the following components to overcome LLMs' limited reasoning on complex execution: (1) it reduces hallucinations and improves focus by supplying the LLM with the backward slice from the target line instead of a full program context; (2) it identifies and incorporates close test cases - those that share control-flow similarities with the path to the target line - to provide focused execution context within the LLM's context window; and (3) it enhances LLM's reasoning with execution in-line annotations that encode variable states as comments along the executed path. By equipping LLMs with these targeted and contextualized inputs, it improves coverage-guided test generation and mitigates redundant explorations. Empirical results show that TestWeaver accelerates code coverage growth and generates more effective test cases than the state-of-the-art approaches.
title TestWeaver: Execution-aware, Feedback-driven Regression Testing Generation with Large Language Models
topic Software Engineering
url https://arxiv.org/abs/2508.01255