Cargando…

Probabilistic and Systematic Coverage of Consecutive Test-Method Pairs for Detecting Order-Dependent Flaky Tests

Software developers frequently check their code changes by running a set of tests against their code. Tests that can nondeterministically pass or fail when run on the same code version are called flaky tests. These tests are a major problem because they can mislead developers to debug their recent c...

Descripción completa

Detalles Bibliográficos
Autores principales: Wei, Anjiang, Yi, Pu, Xie, Tao, Marinov, Darko, Lam, Wing
Formato: Online Artículo Texto
Lenguaje:English
Publicado: 2021
Materias:
Acceso en línea:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7979169/
http://dx.doi.org/10.1007/978-3-030-72016-2_15
_version_ 1783667238576848896
author Wei, Anjiang
Yi, Pu
Xie, Tao
Marinov, Darko
Lam, Wing
author_facet Wei, Anjiang
Yi, Pu
Xie, Tao
Marinov, Darko
Lam, Wing
author_sort Wei, Anjiang
collection PubMed
description Software developers frequently check their code changes by running a set of tests against their code. Tests that can nondeterministically pass or fail when run on the same code version are called flaky tests. These tests are a major problem because they can mislead developers to debug their recent code changes when the failures are unrelated to these changes. One prominent category of flaky tests is order-dependent (OD) tests, which can deterministically pass or fail depending on the order in which the set of tests are run. By detecting OD tests in advance, developers can fix these tests before they change their code. Due to the high cost required to explore all possible orders (n! permutations for n tests), prior work has developed tools that randomize orders to detect OD tests. Experiments have shown that randomization can detect many OD tests, and that most OD tests depend on just one other test to fail. However, there was no analysis of the probability that randomized orders detect OD tests. In this paper, we present the first such analysis and also present a simple change for sampling random test orders to increase the probability. We finally present a novel algorithm to systematically explore all consecutive pairs of tests, guaranteeing to detect all OD tests that depend on one other test, while running substantially fewer orders and tests than simply running all test pairs.
format Online
Article
Text
id pubmed-7979169
institution National Center for Biotechnology Information
language English
publishDate 2021
record_format MEDLINE/PubMed
spelling pubmed-79791692021-03-23 Probabilistic and Systematic Coverage of Consecutive Test-Method Pairs for Detecting Order-Dependent Flaky Tests Wei, Anjiang Yi, Pu Xie, Tao Marinov, Darko Lam, Wing Tools and Algorithms for the Construction and Analysis of Systems Article Software developers frequently check their code changes by running a set of tests against their code. Tests that can nondeterministically pass or fail when run on the same code version are called flaky tests. These tests are a major problem because they can mislead developers to debug their recent code changes when the failures are unrelated to these changes. One prominent category of flaky tests is order-dependent (OD) tests, which can deterministically pass or fail depending on the order in which the set of tests are run. By detecting OD tests in advance, developers can fix these tests before they change their code. Due to the high cost required to explore all possible orders (n! permutations for n tests), prior work has developed tools that randomize orders to detect OD tests. Experiments have shown that randomization can detect many OD tests, and that most OD tests depend on just one other test to fail. However, there was no analysis of the probability that randomized orders detect OD tests. In this paper, we present the first such analysis and also present a simple change for sampling random test orders to increase the probability. We finally present a novel algorithm to systematically explore all consecutive pairs of tests, guaranteeing to detect all OD tests that depend on one other test, while running substantially fewer orders and tests than simply running all test pairs. 2021-03-01 /pmc/articles/PMC7979169/ http://dx.doi.org/10.1007/978-3-030-72016-2_15 Text en © The Author(s) 2021 Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made. The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.
spellingShingle Article
Wei, Anjiang
Yi, Pu
Xie, Tao
Marinov, Darko
Lam, Wing
Probabilistic and Systematic Coverage of Consecutive Test-Method Pairs for Detecting Order-Dependent Flaky Tests
title Probabilistic and Systematic Coverage of Consecutive Test-Method Pairs for Detecting Order-Dependent Flaky Tests
title_full Probabilistic and Systematic Coverage of Consecutive Test-Method Pairs for Detecting Order-Dependent Flaky Tests
title_fullStr Probabilistic and Systematic Coverage of Consecutive Test-Method Pairs for Detecting Order-Dependent Flaky Tests
title_full_unstemmed Probabilistic and Systematic Coverage of Consecutive Test-Method Pairs for Detecting Order-Dependent Flaky Tests
title_short Probabilistic and Systematic Coverage of Consecutive Test-Method Pairs for Detecting Order-Dependent Flaky Tests
title_sort probabilistic and systematic coverage of consecutive test-method pairs for detecting order-dependent flaky tests
topic Article
url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7979169/
http://dx.doi.org/10.1007/978-3-030-72016-2_15
work_keys_str_mv AT weianjiang probabilisticandsystematiccoverageofconsecutivetestmethodpairsfordetectingorderdependentflakytests
AT yipu probabilisticandsystematiccoverageofconsecutivetestmethodpairsfordetectingorderdependentflakytests
AT xietao probabilisticandsystematiccoverageofconsecutivetestmethodpairsfordetectingorderdependentflakytests
AT marinovdarko probabilisticandsystematiccoverageofconsecutivetestmethodpairsfordetectingorderdependentflakytests
AT lamwing probabilisticandsystematiccoverageofconsecutivetestmethodpairsfordetectingorderdependentflakytests