A Multi-factor Approach for Flaky Test Detection and Automated Root Cause Analysis
Paper i proceeding, 2021

Developers often spend time to determine whether test case failures are real failures or flaky. The flaky tests, also known as non-deterministic tests, switch their outcomes without any modification in the codebase, hence reducing the confidence of developers during maintenance as well as in the quality of a product. Re-running test cases to reveal flakiness is resource-consuming, unreliable and does not reveal the root causes of test flakiness. Our paper evaluates a multi-factor approach to identify flaky test executions implemented in a tool named MDF laker. The four factors are: trace-back coverage, flaky frequency, number of test smells, and test size. Based on the extracted factors, MDFlaker uses k-Nearest Neighbor (KNN) to determine whether failed test executions are flaky. We investigate MDFlaker in a case study with 2166 test executions from different open-source repositories. We evaluate the effectiveness of our flaky detection tool. We illustrate how the multi-factor approach can be used to reveal root causes for flakiness, and we conduct a qualitative comparison between MDF laker and other tools proposed in literature. Our results show that the combination of different factors can be used to identify flaky tests. Each factor has its own trade-off, e.g., trace-back leads to many true positives, while flaky frequency yields more true negatives. Therefore, specific combinations of factors enable classification for testers with limited information (e.g., not enough test history information).

Författare

Azeem Ahmad

Linköpings universitet

Francisco Gomes

Software Engineering 1

Göteborgs universitet

Zhixiang Shi

Linköpings universitet

Kristian Sandahl

Linköpings universitet

Ola Leifler

Linköpings universitet

Proceedings - Asia-Pacific Software Engineering Conference, APSEC

15301362 (ISSN)

Vol. 2021-December 338-348
978-166543784-4 (ISBN)

28th Asia-Pacific Software Engineering Conference, APSEC 2021
Virtual, Online, Taiwan,

Ämneskategorier (SSIF 2025)

Programvaruteknik

Datavetenskap (datalogi)

DOI

10.1109/APSEC53868.2021.00041

Mer information

Senast uppdaterat

2025-06-30