Lune

ICSE2021Top-tier venue

Domain-Specific Fixes for Flaky Tests with Wrong Assumptions on Underdetermined Specifications

Peilun Zhang, Yanjie Jiang, Anjiang Wei, Victoria Stodden, Darko Marinov, August Shi

Abstract

Library developers can provide classes and methods with underdetermined specifications that allow flexibility in future implementations. Library users may write code that relies on a specific implementation rather than on the specification, e.g., assuming mistakenly that the order of elements cannot change in the future. Prior work proposed the NonDex approach that detects such wrong assumptions. We present a novel approach, called DexFix, to repair wrong assumptions on underdetermined specifications in an automated way. We run the NonDex tool on 200 open-source Java projects and detect 275 tests that fail due to wrong assumptions. The majority of failures are from iterating over HashMap/HashSet collections and the getDeclaredFields method. We provide several new repair strategies that can fix these violations in both the test code and the main code. DexFix proposes fixes for 119 tests from the detected 275 tests. We have already reported fixes for 102 tests as GitHub pull requests: 74 have been merged, with only 5 rejected, and the remaining 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.

8 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

  • Free Lunch for Testing: Fuzzing Deep-Learning Libraries from Open Source cites FLEX: fixing flaky tests in machine learning projects by updating assertion bounds
  • Free Lunch for Testing: Fuzzing Deep-Learning Libraries from Open Source cites A large-scale longitudinal study of flaky tests
  • FLEX: fixing flaky tests in machine learning projects by updating assertion bounds cites TERA: optimizing stochastic regression tests in machine learning projects
  • TERA: optimizing stochastic regression tests in machine learning projects cites FLEX: fixing flaky tests in machine learning projects by updating assertion bounds
  • FLEX: fixing flaky tests in machine learning projects by updating assertion bounds cites A study on the lifecycle of flaky tests
  • Preempting Flaky Tests via Non-Idempotent-Outcome Tests cites FLEX: fixing flaky tests in machine learning projects by updating assertion bounds
  • Preempting Flaky Tests via Non-Idempotent-Outcome Tests cites A large-scale longitudinal study of flaky tests
  • 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 FLEX: fixing flaky tests in machine learning projects by updating assertion bounds
  • Repairing Order-Dependent Flaky Tests via Test Generation cites A large-scale longitudinal study of flaky tests
  • TERA: optimizing stochastic regression tests in machine learning projects 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 papers8

  1. Free Lunch for Testing: Fuzzing Deep-Learning Libraries from Open SourceAnjiang Wei, Yinlin Deng, Chenyuan Yang, Lingming ZhangICSE 2022 · 91 citations
  2. FLEX: fixing flaky tests in machine learning projects by updating assertion boundsSaikat Dutta, August Shi, Sasa MisailovicFSE 2021 · 33 citations
  3. Repairing Order-Dependent Flaky Tests via Test GenerationChengpeng Li, Chenguang Zhu, Wenxi Wang, August ShiICSE 2022 · 22 citations
  4. Preempting Flaky Tests via Non-Idempotent-Outcome TestsAnjiang Wei, Pu Yi, Zhengxi Li, Tao Xie et al.ICSE 2022 · 20 citations
  5. TERA: optimizing stochastic regression tests in machine learning projectsSaikat Dutta, Jeeva Selvam, Aryaman Jain, Sasa MisailovicISSTA 2021 · 12 citations

Builds on2

  1. A study on the lifecycle of flaky testsWing Lam, Kivanç Muslu, Hitesh Sajnani, Suresh ThummalapentaICSE 2020 · 107 citations
  2. A large-scale longitudinal study of flaky testsWing Lam, Stefan Winter, Anjiang Wei, Tao Xie et al.OOPSLA 2020 · 63 citations

Related papers

  1. NPEX: Repairing Java Null Pointer Exceptions without TestsJunhee Lee, Seongjoon Hong, Hakjoo OhICSE 2022 · 13 citations
  2. API-Misuse Detection Driven by Fine-Grained API-Constraint Knowledge GraphXiaoxue Ren, Xinyuan Ye, Zhenchang Xing, Xin Xia et al.ASE 2020 · 62 citations
  3. Automated Program Repair, What Is It Good For? Not Absolutely Nothing!Hadeel Eladawy, Claire Le Goues, Yuriy BrunICSE 2024 · 15 citations
  4. Inferring and Applying Def-Use Like Configuration Couplings in Deployment DescriptorsChengyuan Wen, Yaxuan Zhang, Xiao He, Na MengASE 2020 · 3 citations
  5. UnitCon: Synthesizing Targeted Unit Tests for Java Runtime ExceptionsSujin Jang, Yeonhee Ryou, Heewon Lee, Kihong HeoFSE 2025
Dusk over the sea between two cliffs drawn in fine vertical lines