What Made This Test Flake? Pinpointing Classes Responsible for Test Flakiness

07/20/2022
by   Sarra Habchi, et al.
0

Flaky tests are defined as tests that manifest non-deterministic behaviour by passing and failing intermittently for the same version of the code. These tests cripple continuous integration with false alerts that waste developers' time and break their trust in regression testing. To mitigate the effects of flakiness, both researchers and industrial experts proposed strategies and tools to detect and isolate flaky tests. However, flaky tests are rarely fixed as developers struggle to localise and understand their causes. Additionally, developers working with large codebases often need to know the sources of non-determinism to preserve code quality, i.e., avoid introducing technical debt linked with non-deterministic behaviour, and to avoid introducing new flaky tests. To aid with these tasks, we propose re-targeting Fault Localisation techniques to the flaky component localisation problem, i.e., pinpointing program classes that cause the non-deterministic behaviour of flaky tests. In particular, we employ Spectrum-Based Fault Localisation (SBFL), a coverage-based fault localisation technique commonly adopted for its simplicity and effectiveness. We also utilise other data sources, such as change history and static code metrics, to further improve the localisation. Our results show that augmenting SBFL with change and code metrics ranks flaky classes in the top-1 and top-5 suggestions, in 26 successfully reduced the average number of classes inspected to locate the first flaky class to 19 Our results also show that localisation methods are effective in major flakiness categories, such as concurrency and asynchronous waits, indicating their general ability to identify flaky components.

READ FULL TEXT
research
05/08/2023

Debugging Flaky Tests using Spectrum-based Fault Localization

Non-deterministically behaving (i.e., flaky) tests hamper regression tes...
research
08/31/2022

Predicting Flaky Tests Categories using Few-Shot Learning

Flaky tests are tests that yield different outcomes when run on the same...
research
12/09/2021

A Qualitative Study on the Sources, Impacts, and Mitigation Strategies of Flaky Tests

Test flakiness forms a major testing concern. Flaky tests manifest non-d...
research
04/15/2021

On the Use of Mutation in Injecting Test Order-Dependency

Background: Test flakiness is identified as a major issue that compromis...
research
03/21/2022

Using Evolutionary Coupling to Establish Relevance Links Between Tests and Code Units. A case study on fault localization

Many software engineering techniques, such as fault localization, operat...
research
08/10/2017

A Hint-Based Technique for System Level Model-Based Test Case Prioritization

Test Case Prioritization (TCP) techniques aim at proposing new test case...
research
02/13/2020

Genetic Algorithms for Redundancy in Interaction Testing

It is imperative for testing to determine if the components within large...

Please sign up or login with your details

Forgot password? Click here to reset