Cost of Flaky Tests in Continuous Integration: An Industrial Case Study

Fabian Leinen, Daniel Elsner, Alexander Pretschner, Andreas Stahlbauer, Michael Sailer, Elmar Jurgens

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

5 Scopus citations

Abstract

Researchers and practitioners alike increasingly often perceive flaky tests as a major challenge in software engineering. They spend a lot of effort trying to detect, repair, and mitigate the negative effects of flaky tests. However, it is yet unclear where and to what extent the costs of flaky tests manifest in industrial Continuous Integration (CI) development processes. In this study, we compile cost factors introduced by flaky tests in CI development from research and practice and derive a cost model that allows gaining insight into the costs incurred. We then instantiate this model in a case study of a large, commercial software project with 30 developers and 1M SLoC. We analyze five years of development history, including CI test logs, commits from the Version Control System (VCS), issue tickets, and tracked work time to quantify the cost factors implied by flaky tests. We find that the time spent dealing with flaky tests in the studied project represents at least 2.5% of the productive developer time. This effort is divided into investigating potentially flaky test failures, which accounts for 1.1% of the total time spent, repairing flaky tests adds another 1.3 %, and developing tools to monitor flaky tests adds 0.1 %. Contrary to most other studies, we find the cost for rerunning tests to be negligible and inexpensive. Automatically rerunning a test costs 0.02 cents, while not rerunning and thus letting the pipeline fail results in a manual investigation costing 5.67 in our context. The insights gained from our case study have led to the decision to shift effort from investigation and repair to automatically rerunning tests. Our cost model can help practitioners analyze the cost of flaky tests in their context and make informed decisions. Furthermore, our case study provides a first step to better understand the costs of flaky tests, which can lead researchers to industry-relevant problems.

Original languageEnglish
Title of host publicationProceedings - 2024 IEEE Conference on Software Testing, Verification and Validation, ICST 2024
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages329-340
Number of pages12
ISBN (Electronic)9798350308181
DOIs
StatePublished - 2024
Event17th IEEE Conference on Software Testing, Verification and Validation, ICST 2024 - Toronto, Canada
Duration: 27 May 202431 May 2024

Publication series

NameProceedings - 2024 IEEE Conference on Software Testing, Verification and Validation, ICST 2024

Conference

Conference17th IEEE Conference on Software Testing, Verification and Validation, ICST 2024
Country/TerritoryCanada
CityToronto
Period27/05/2431/05/24

Keywords

  • continuous integration
  • cost modeling
  • flaky tests
  • industrial case study
  • regression testing

Fingerprint

Dive into the research topics of 'Cost of Flaky Tests in Continuous Integration: An Industrial Case Study'. Together they form a unique fingerprint.

Cite this