Takuan: Root Causing Order-Dependent Flaky Tests through Analysis of Dynamic Invariants

Authors

  • NATE LEVIN Department of Computer Science, George Mason University, Fairfax, VA
  • Yule Zhang Department of Electrical and Computer Engineering, University of Texas at Austin, Austin, TX
  • August Shi Department of Electrical and Computer Engineering, University of Texas at Austin, Austin, TX
  • Wing Lam Department of Computer Science, George Mason University, Fairfax, VA

DOI:

https://doi.org/10.13021/jssr2023.3893

Abstract

Automated testing is crucial to the development of stable, effective software. It allows developers to confidently make changes while preventing regressions in functionality. When tests can both pass and fail on the same version of code, they are known as “flaky tests.” Some flaky tests, known as order-dependent (OD) flaky tests, will pass or fail depending on test execution order. Prior work has investigated using dynamic tracing information to root cause flaky tests, but no work has utilized dynamic invariants, which are conditions that always hold true at a given point in a program (e.g., a field always has a certain value). We present Takuan, a framework for analyzing and root causing OD tests using dynamic invariants. Given an OD test, Takuan finds differences in the invariants collected from passing and failing runs, outputting “problem invariants”. Takuan then searches for methods that influence the problem invariants. We tested Takuan on 11 OD tests from 11 open-source projects taken from a public dataset. Takuan correctly found a problem invariant in five of the tests and indicated an influential method in three of the tests. Our work implies that dynamic invariants may be an effective way to root cause OD tests.

Published

2023-10-27

Issue

Section

College of Engineering and Computing: Department of Computer Science

Categories