FlakyGuard:在工业规模上自动修复不稳定测试
FlakyGuard: Automatically Fixing Flaky Tests at Industry Scale
AI总结:
针对现有基于大型语言模型(LLMs)的不稳定测试修复方法因上下文问题在工业场景失效的问题,提出FlakyGuard,通过代码图结构与选择性图探索获取相关上下文,在工业真实测试中修复率达47.6%且开发者接受度高。
摘要:
非确定性通过或失败的不稳定测试会浪费开发者时间并拖慢发布周期。尽管大型语言模型(LLMs)在自动修复不稳定测试方面展现出潜力,但像FlakyDoctor这样的现有方法因上下文问题在工业环境中失效:要么提供的上下文过少(缺失关键生产代码),要么过多(无关信息使LLM不堪重负)。我们提出FlakyGuard,将代码视为图结构,通过选择性图探索仅查找最相关的上下文来解决该问题。对工业代码库中真实不稳定测试的评估显示,FlakyGuard修复了47.6%的可复现不稳定测试,其中51.8%的修复被开发者接受;其修复成功率比最先进方法至少高出22%。开发者调查证实,100%的受访者认为FlakyGuard的根本原因解释有用。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。