Lune

ASE2025Top-tier venue

FlakyGuard: Automatically Fixing Flaky Tests at Industry Scale

Chengpeng Li, Farnaz Behrang, August Shi, Peng Liu

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Domain-Specific Fixes for Flaky Tests with Wrong Assumptions on Underdetermined Specifications cites A study on the lifecycle of flaky tests
  • Preempting Flaky Tests via Non-Idempotent-Outcome Tests cites Domain-Specific Fixes for Flaky Tests with Wrong Assumptions on Underdetermined Specifications
  • Preempting Flaky Tests via Non-Idempotent-Outcome Tests cites Repairing Order-Dependent Flaky Tests via Test Generation
  • Repairing Order-Dependent Flaky Tests via Test Generation cites Preempting Flaky Tests via Non-Idempotent-Outcome Tests
  • Preempting Flaky Tests via Non-Idempotent-Outcome Tests cites A study on the lifecycle of flaky tests
  • Repairing Order-Dependent Flaky Tests via Test Generation cites Domain-Specific Fixes for Flaky Tests with Wrong Assumptions on Underdetermined Specifications
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on13

  1. A study on the lifecycle of flaky testsWing Lam, Kivanç Muslu, Hitesh Sajnani, Suresh ThummalapentaICSE 2020 · 107 citations
  2. AutoCodeRover: Autonomous Program ImprovementYuntong Zhang, Haifeng Ruan, Zhiyu Fan, Abhik RoychoudhuryISSTA 2024 · 96 citations
  3. Domain-Specific Fixes for Flaky Tests with Wrong Assumptions on Underdetermined SpecificationsPeilun Zhang, Yanjie Jiang, Anjiang Wei, Victoria Stodden et al.ICSE 2021 · 26 citations
  4. Repairing Order-Dependent Flaky Tests via Test GenerationChengpeng Li, Chenguang Zhu, Wenxi Wang, August ShiICSE 2022 · 22 citations
  5. Preempting Flaky Tests via Non-Idempotent-Outcome TestsAnjiang Wei, Pu Yi, Zhengxi Li, Tao Xie et al.ICSE 2022 · 20 citations

Related papers

  1. Neurosymbolic Repair of Test FlakinessYang Chen, Reyhaneh JabbarvandISSTA 2024 · 8 citations
  2. NIODebugger: A Novel Approach to Repair Non-Idempotent-Outcome Tests with LLM-Based AgentKaiyao KeICSE 2025 · 3 citations
  3. Dockerfile Flakiness: Characterization and RepairTaha Shabani, Noor Nashid, Parsa Alian, Ali MesbahICSE 2025 · 2 citations
  4. Understanding and Improving Flaky Test ClassificationShanto Rahman, Saikat Dutta, August ShiOOPSLA 2025 · 5 citations
  5. Context Matters: Improving the Practical Reliability of LLM-Based Unit Test Generation (Experience Paper)Junjie Chen, Ziqi Wang, Lin Yang, Chen Yang et al.ISSTA 2026
Dusk over the sea between two cliffs drawn in fine vertical lines