Lune

ICSE2022Top-tier venue

Preempting Flaky Tests via Non-Idempotent-Outcome Tests

Anjiang Wei, Pu Yi, Zhengxi Li, Tao Xie, Darko Marinov, Wing Lam

Abstract

Regression testing can greatly help in software development, but it can be seriously undermined by flaky tests, which can both pass and fail, seemingly nondeterministically, on the same code commit. Flaky tests are an emerging topic in both research and industry. Prior work has identified multiple categories of flaky tests, developed techniques for detecting these flaky tests, and analyzed some detected flaky tests. To proactively detect, i.e., preempt, flaky tests, we propose to detect non-idempotent-outcome (NIO) tests, a novel category related to flaky tests. In particular, we run each test twice in the same test execution environment, e.g., run each Java test twice in the same Java Virtual Machine. A test is NIO if it passes in the first run but fails in the second. Each NIO test has side effects and "selfpollutes" the state shared among test runs. We perform experiments on both Java and Python open-source projects, detecting 223 NIO Java tests and 138 NIO Python tests. We have inspected all 361 detected tests and opened pull requests that fix 268 tests, with 192 already accepted, only 6 rejected, and the remaining 70 pending.

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.

6 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Transforming Test Suites into Croissants cites FlakeFlagger: Predicting Flakiness Without Rerunning Tests
  • Transforming Test Suites into Croissants cites A large-scale longitudinal study of flaky tests
  • Transforming Test Suites into Croissants cites Detecting flaky tests in probabilistic and machine learning applications
  • Transforming Test Suites into Croissants cites A study on the lifecycle of flaky tests
  • FlakeFlagger: Predicting Flakiness Without Rerunning Tests cites A large-scale longitudinal study of flaky tests
  • A Dataset of Reproducible Flaky-Test Failures cites FlakeFlagger: Predicting Flakiness Without Rerunning Tests
  • A Dataset of Reproducible Flaky-Test Failures cites Repairing Order-Dependent Flaky Tests via Test Generation
  • A Dataset of Reproducible Flaky-Test Failures cites A study on the lifecycle of flaky tests
  • Do Automatic Test Generation Tools Generate Flaky Tests? cites FlakeFlagger: Predicting Flakiness Without Rerunning Tests
  • Do Automatic Test Generation Tools Generate Flaky Tests? cites Repairing Order-Dependent Flaky Tests via Test Generation
  • Do Automatic Test Generation Tools Generate Flaky Tests? cites Detecting flaky tests in probabilistic and machine learning applications
  • Do Automatic Test Generation Tools Generate Flaky Tests? cites A study on the lifecycle of flaky tests
  • FlakyGuard: Automatically Fixing Flaky Tests at Industry Scale cites Repairing Order-Dependent Flaky Tests via Test Generation
  • FlakyGuard: Automatically Fixing Flaky Tests at Industry Scale cites A study on the lifecycle of flaky tests
  • Repairing Order-Dependent Flaky Tests via Test Generation cites A large-scale longitudinal study of flaky tests
  • Repairing Order-Dependent Flaky Tests via Test Generation cites Detecting flaky tests in probabilistic and machine learning applications
  • Detecting flaky tests in probabilistic and machine learning applications cites A study on the lifecycle of flaky tests
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers6

  1. Repairing Order-Dependent Flaky Tests via Test GenerationChengpeng Li, Chenguang Zhu, Wenxi Wang, August ShiICSE 2022 · 22 citations
  2. Do Automatic Test Generation Tools Generate Flaky Tests?Martin Gruber, Muhammad Firhard Roslan, Owain Parry, Fabian Scharnböck et al.ICSE 2024 · 12 citations
  3. Transforming Test Suites into CroissantsYang Chen, Alperen Yildiz, Darko Marinov, Reyhaneh JabbarvandISSTA 2023 · 5 citations
  4. FlakyGuard: Automatically Fixing Flaky Tests at Industry ScaleChengpeng Li, Farnaz Behrang, August Shi, Peng LiuASE 2025 · 1 citation
  5. A Dataset of Reproducible Flaky-Test FailuresSuzzana Rafi, Mahbub-Ul-Hoque Sumon, Md Erfan, Maruf Morshed Khan et al.ISSTA 2026

Builds on13

  1. A study on the lifecycle of flaky testsWing Lam, Kivanç Muslu, Hitesh Sajnani, Suresh ThummalapentaICSE 2020 · 107 citations
  2. Detecting flaky tests in probabilistic and machine learning applicationsSaikat Dutta, August Shi, Rutvik Choudhary, Zhekun Zhang et al.ISSTA 2020 · 71 citations
  3. FlakeFlagger: Predicting Flakiness Without Rerunning TestsAbdulrahman Alshammari, Christopher Morris, Michael Hilton, Jonathan BellICSE 2021 · 63 citations
  4. A large-scale longitudinal study of flaky testsWing Lam, Stefan Winter, Anjiang Wei, Tao Xie et al.OOPSLA 2020 · 63 citations
  5. Fixing dependency errors for Python build reproducibilitySuchita Mukherjee, Abigail Almanza, Cindy Rubio-GonzálezISSTA 2021 · 55 citations

Related papers

  1. Evolution-aware detection of order-dependent flaky testsChengpeng Li, August ShiISSTA 2022 · 12 citations
  2. NIODebugger: A Novel Approach to Repair Non-Idempotent-Outcome Tests with LLM-Based AgentKaiyao KeICSE 2025 · 3 citations
  3. FlakeSync: Automatically Repairing Async Flaky TestsShanto Rahman, August ShiICSE 2024 · 7 citations
  4. Dependent-test-aware regression testing techniquesWing Lam, August Shi, Reed Oei, Sai Zhang et al.ISSTA 2020 · 44 citations
  5. Detecting Flaky Tests by Controlling Nondeterministic API BehaviorHengchen Yuan, Jiefang Lin, August ShiOOPSLA 2026
Dusk over the sea between two cliffs drawn in fine vertical lines