Preempting Flaky Tests via Non-Idempotent-Outcome Tests

24Citations
Citations of this article
16Readers
Mendeley users who have this article in their library.
Get full text

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 'self-pollutes' 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.

Cite

CITATION STYLE

APA

Wei, A., Yi, P., Li, Z., Xie, T., Marinov, D., & Lam, W. (2022). Preempting Flaky Tests via Non-Idempotent-Outcome Tests. In Proceedings - International Conference on Software Engineering (Vol. 2022-May, pp. 1730–1742). IEEE Computer Society. https://doi.org/10.1145/3510003.3510170

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free