paperbot · PL 论文追踪

全部论文 待读 收藏

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

TestWeaver:执行感知、反馈驱动的大语言模型回归测试生成
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 6/10 · 论文处于 PL 与 LLM 的交叉点,用轻量程序分析(后向切片、执行内联标注、相似测试用例)来引导 LLM 生成回归测试,属于用户“PL 技术×LLM”的大方向;但其目标任务是测试生成/回归测试,而非用户画像核心的“静态分析应用于 ML/Agent 程序”或“LLM 改进静态分析与形式化验证”,因此是相关但非正中核心。引用 4 inbox
Cuong Chi Le, Cuong Duc Van, Tung Duy Vu, Minh Vu Thai Pham, Nhat Hoang Phan, Huy Phan, Tien N. Nguyen
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:结合轻量程序分析与 LLM,通过后向切片、相似测试用例和执行内联标注生成回归测试,缓解覆盖率停滞。

针对基于大语言模型的回归测试生成中因缺乏对程序执行的推理而出现的覆盖率停滞(coverage plateau)问题,本文提出 TestWeaver。该方法将轻量级程序分析融入 LLM 的输入构造:(1) 用目标行的后向切片替代完整程序上下文,减少幻觉并提升聚焦度;(2) 识别与目标行路径具有控制流相似性的邻近测试用例,在有限上下文窗口内提供执行相关的上下文;(3) 沿执行路径以注释形式内联标注变量状态,增强模型对执行的推理。通过这些有针对性的上下文化输入,TestWeaver 改善了覆盖率引导的测试生成并抑制冗余探索。实证结果表明,与当前最优方法相比,TestWeaver 加快了代码覆盖率的增长,并生成更有效的测试用例。

问题
LLM 在回归测试生成中难以推理程序执行,导致覆盖率增长停滞(coverage plateau),如何为其提供有效的执行上下文?
方法
TestWeaver 结合轻量程序分析:以目标行后向切片替代完整程序上下文、引入与目标路径控制流相似的近邻测试用例、并在执行路径上以内联注释编码变量状态。
评估
在回归测试生成任务上与当前最优方法进行实证对比,考察代码覆盖率的增长速度以及所生成测试用例的有效性。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2508-01255,
  title = {TestWeaver: Execution-aware, Feedback-driven Regression Testing Generation with Large Language Models},
  author = {Cuong Chi Le and Cuong Duc Van and Tung Duy Vu and Minh Vu Thai Pham and Nhat Hoang Phan and Huy Phan and Tien N. Nguyen},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3787805}
}