FlakyGuard: Automatically Fixing Flaky Tests at Industry Scale

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Li, Chengpeng, Behrang, Farnaz, Shi, August, Liu, Peng
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866911271711932416
author Li, Chengpeng
Behrang, Farnaz
Shi, August
Liu, Peng
author_facet Li, Chengpeng
Behrang, Farnaz
Shi, August
Liu, Peng
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2511_14002
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle FlakyGuard: Automatically Fixing Flaky Tests at Industry Scale
Li, Chengpeng
Behrang, Farnaz
Shi, August
Liu, Peng
Software Engineering
Artificial Intelligence
Machine Learning
Programming Languages
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.
title FlakyGuard: Automatically Fixing Flaky Tests at Industry Scale
topic Software Engineering
Artificial Intelligence
Machine Learning
Programming Languages
url https://arxiv.org/abs/2511.14002