Giter Site home page Giter Site logo

flaky-tests-detection's Introduction

Flaky tests detection

Visualise tests whose state changes most often. During software development, it is often common that some tests start to randomly fail, but finding those tests is a tedious and time consuming problem. Flaky tests detection solves that problem by processing historical xunit test results and cheks which tests changes state most often. Flaky tests detection is available as Github Action plugin and Python package. For usage, see example at the actions page.

Implementation is based on "Modeling and ranking flaky tests at Apple" by Kowalczyk, Emily & Nair, Karan & Gao, Zebao & Silberstein, Leo & Long, Teng & Memon, Atif.

Features

  • Prints out top test names and their latest calculation window scores (normal fliprate and exponentially weighted moving average fliprate that take previous calculation windows into account).
  • Calculation grouping options:
    • n days.
    • n runs.
  • Heatmap visualization of the scores and history.

Parameters

Data options (choose one)

  • --test-history-csv
    • Give a path to a test history csv file which includes three fields: timestamp, test_identifier and test_status.
  • --junit-files
    • Give a path to a folder with JUnit test results.

Calculation options

  • --grouping-option

    • days to use n days for fliprate calculation windows.
    • runs to use n runs for fliprate calculation windows.
  • --window-size

    • Fliprate calculation window size n.
  • --window-count

    • History size for exponentially weighted moving average calculations.
  • --top-n

    • How many top highest scoring tests to print out.

Heatmap generation

  • --heatmap
    • Turn heatmap generation on.
    • Two pictures generated: normal fliprate and exponentially weighted moving average fliprate score.
    • Same parameters used as with the printed statistics.

Full examples

  • Precomputed test_history.csv with daily calulations. 1 day windows, 7 day history and 5 tests printed out.
    • --test-history-csv=example_history/test_history.csv --grouping-option=days --window-size=1 --window-count=7 --top-n=5
  • JUnit files with calculations per 5 runs. 15 runs history and 5 tests printed out.
    • --junit-files=example_history/junit_files --grouping-option=runs --window-size=5 --window-count=3 --top-n=5
  • Precomputed test_history.csv with daily calculations and heatmap generation. 1 day windows, 7 day history and 50 tests printed and generated to heatmaps.
    • --test-history-csv=example_history/test_history.csv --grouping-option=days --window-size=1 --window-count=7 --top-n=50 --heatmap

Install module

  • make install

Install module and development packages

  • make install_dev

Run pytest

  • make run_test

Acknowledgement

The package was developed by F-Secure Corporation and University of Helsinki in the scope of IVVES project. This work was labelled by ITEA3 and funded by local authorities under grant agreement “ITEA-2019-18022-IVVES”

flaky-tests-detection's People

Contributors

f3licity avatar guotin avatar matveypashkovskiy avatar oikajo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.