paperbot · PL 论文追踪

全部论文 待读 收藏

P1 LLM Test Generation via Iterative Hybrid Program Analysis

基于迭代混合程序分析的 LLM 测试生成
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 5/10 · 论文处于 LLM 与程序分析的交叉点,用静态控制流与动态覆盖率分析迭代引导 LLM 生成测试,与用户关注的“AI→PL / PL→AI”交叉方向沾边;但其研究目标是测试生成而非改进静态分析或形式化验证本身,也未涉及浮点或贝叶斯程序分析,属于相邻而非核心方向。引用 32 inbox
Sijia Gu, Noor Nashid, Ali Mesbah
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:Panta 通过静态控制流与动态覆盖率的迭代反馈引导 LLM 生成测试,显著提升覆盖率。

自动化单元测试生成对真实项目中的复杂方法仍具挑战。LLM 虽在代码生成上取得进展,但因难以推理复杂控制流结构,分支覆盖率往往不高。本文提出 Panta,模拟人类开发者分析代码、构造测试用例的迭代过程:结合静态控制流分析与动态代码覆盖率分析,系统性地引导 LLM 识别未被覆盖的执行路径,并生成更优测试。该技术采用迭代反馈驱动机制,依据静态与动态路径覆盖信息持续精化测试生成,从而提升测试的全面性与有效性。作者在开源项目的高圈复杂度类上进行实证评估,结果显示 Panta 相比当前最优方法线覆盖率提高 26%、分支覆盖率提高 23%。

问题
LLM 在生成单元测试时难以推理复杂控制流,导致真实项目复杂方法的分支覆盖率不足。
方法
Panta 将静态控制流分析与动态覆盖率分析结合,以迭代反馈机制引导 LLM 定位未覆盖路径并精化测试生成。
评估
在开源项目高圈复杂度类上与当前最优方法对比,线覆盖率提升 26%、分支覆盖率提升 23%。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2503-13580,
  title = {LLM Test Generation via Iterative Hybrid Program Analysis},
  author = {Sijia Gu and Noor Nashid and Ali Mesbah},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3764553}
}