Flaky Test Sanitisation via On-the-Fly Assumption Inference for Tests with Network Dependencies

08/01/2022
by   Jens Dietrich, et al.
0

Flaky tests cause significant problems as they can interrupt automated build processes that rely on all tests succeeding and undermine the trustworthiness of tests. Numerous causes of test flakiness have been identified, and program analyses exist to detect such tests. Typically, these methods produce advice to developers on how to refactor tests in order to make test outcomes deterministic. We argue that one source of flakiness is the lack of assumptions that precisely describe under which circumstances a test is meaningful. We devise a sanitisation technique that can isolate f laky tests quickly by inferring such assumptions on-the-fly, allowing automated builds to proceed as flaky tests are ignored. We demonstrate this approach for Java and Groovy programs by implementing it as extensions for three popular testing frameworks (JUnit4, JUnit5 and Spock) that can transparently inject the inferred assumptions. If JUnit5 is used, those extensions can be deployed without refactoring project source code. We demonstrate and evaluate the utility of our approach using a set of six popular real-world programs, addressing known test flakiness issues in these programs caused by dependencies of tests on network availability. We find that our method effectively sanitises failures induced by network connectivity problems with high precision and recall.

READ FULL TEXT
research
02/14/2022

Gamekins: Gamifying Software Testing in Jenkins

Developers have to write thorough tests for their software in order to f...
research
09/13/2022

Inline Tests

Unit tests are widely used to check source code quality, but they can be...
research
03/17/2023

On the Effect of Instrumentation on Test Flakiness

Test flakiness is a problem that affects testing and processes that rely...
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
10/06/2019

Automated Isolation for White-box Test Generation

Context. White-box test generation is a technique used for automatically...
research
02/18/2023

Practical Flaky Test Prediction using Common Code Evolution and Test History Data

Non-deterministically behaving test cases cause developers to lose trust...
research
10/12/2021

NetRep: Automatic Repair for Network Programs

Debugging imperative network programs is a challenging task for develope...

Please sign up or login with your details

Forgot password? Click here to reset