paperbot · PL 论文追踪

全部论文 待读 收藏

P1 FlakyGuard: Automatically Fixing Flaky Tests at Industry Scale

FlakyGuard:在工业规模上自动修复不稳定测试
ASE 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE)2025匹配度 5/10 · 论文将 LLM 用于 flaky test 自动修复,并通过代码图结构选择性探索来提供上下文,属于 LLM 与程序分析/程序修复的交叉,且具有工业规模落地和开发者调研。但它并非用户核心关注的「静态分析应用于 ML/Agentic 程序」或「LLM/Agent 改进静态分析/形式化验证」,也未涉及浮点或贝叶斯程序分析,因此匹配度中等。引用 1 inbox
Chengpeng Li, Farnaz Behrang, August Shi, Peng Liu
crossref: 2026-09-12

AI 速览

一句话:将代码视为图结构并选择性探索,为 LLM 精准提供修复 flaky test 所需的上下文,实现工业规模自动修复。

不稳定测试(flaky test)非确定性地通过或失败,浪费开发者时间并拖慢发布周期。尽管大语言模型(LLM)在自动修复不稳定测试上展现出潜力,现有方法(如 FlakyDoctor)在工业场景中因“上下文问题”而失效:提供的上下文过少会缺失关键生产代码,过多则用无关信息淹没 LLM。本文提出 FlakyGuard,将代码视为图结构,通过选择性图探索只找出最相关的上下文,从而在工业环境中有效驱动 LLM 完成修复并解释根因。作者在来自工业仓库的真实不稳定测试上进行评估:FlakyGuard 修复了 47.6% 的可复现不稳定测试,其中 51.8% 的修复被开发者接受,修复成功率比现有最先进方法至少高出 22%。开发者调查还显示,100% 的受访者认为 FlakyGuard 给出的根因解释有用。

问题
现有基于 LLM 的不稳定测试自动修复方法在工业环境中受困于上下文问题:上下文过少会遗漏关键生产代码,过多则引入大量无关信息,导致修复失败。
方法
FlakyGuard 将代码表示为图结构,通过选择性图探索定位与不稳定测试最相关的上下文,再交由 LLM 生成修复及根因解释。
评估
在工业仓库的真实不稳定测试上评估,修复 47.6% 的可复现不稳定测试,51.8% 的修复被开发者接受,成功率较最先进方法至少提升 22%,并通过开发者调查验证根因解释的实用性。
原文摘要(Abstract)

Flaky tests that non-deterministically pass or fail waste developer time and slow release cycles. While large language models (LLMs) show promise for automatically repairing flaky tests, existing approaches like FlakyDoctor fail in industrial settings due to the context problem: providing either too little context (missing critical production code) or too much context (overwhelming the LLM with irrelevant information). We present FlakyGuard, which addresses this problem by treating code as a graph structure and using selective graph exploration to find only the most relevant context. Evaluation on real-world flaky tests from industrial repositories shows that FlakyGuard repairs 47.6% of reproducible flaky tests with 51.8% of the fixes accepted by developers. Besides it outperforms state-of-the-art approaches by at least 22% in repair success rate. Developer surveys confirm that 100% find FlakyGuard’s root cause explanations useful.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot9210,
  title = {FlakyGuard: Automatically Fixing Flaky Tests at Industry Scale},
  author = {Chengpeng Li and Farnaz Behrang and August Shi and Peng Liu},
  booktitle = {ASE},
  year = {2025},
  doi = {10.1109/ase63991.2025.00179}
}