On the use of test smells for prediction of flaky tests

B. H. P. Camara, M. A. G. Silva, A. T. Endo, S. R. Vergilio
8/26/2021
cs.SEcs.LG

Official code: bhpachulski/SAST21-Paper (4 stars, Jupyter Notebook, CC-BY-SA-4.0, last commit 2021-08-27).

Abstract

Regression testing is an important phase to deliver software with quality. However, flaky tests hamper the evaluation of test results and can increase costs.

Show full abstract

This is because a flaky test may pass or fail non-deterministically and to identify properly the flakiness of a test requires rerunning the test suite multiple times. To cope with this challenge, approaches have been proposed based on prediction models and machine learning. Existing approaches based on the use of the test case vocabulary may be context-sensitive and prone to overfitting, presenting low performance when executed in a cross-project scenario. To overcome these limitations, we investigate the use of test smells as predictors of flaky tests. We conducted an empirical study to understand if test smells have good performance as a classifier to predict the flakiness in the cross-project context, and analyzed the information gain of each test smell. We also compared the test smell-based approach with the vocabulary-based one. As a result, we obtained a classifier that had a reasonable performance (Random Forest, 0.83) to predict the flakiness in the testing phase. This classifier presented better performance than vocabulary-based model for cross-project prediction. The Assertion Roulette and Sleepy Test test smell types are the ones associated with the best information gain values.

View on arXivView PDF

Code Implementations(1)

CC-BY-SA-4.0

This is the experimental package of paper entitled "On the use of test smells for prediction of flaky tests" that was ​submitted for publication in SAST 2021 - VI Brazilian Symposium on Systematic and Automated Software Testing.

43Jupyter NotebookAug 19, 20215 years agoCC-BY-SA-4.0
flaky-testsmachine-learningregression-testingsoftware-engineeringsoftware-testing+1 more

Similar Papers

Cite this paper

@article{camara2021test,
  title  = {On the use of test smells for prediction of flaky tests},
  author = {B. H. P. Camara and M. A. G. Silva and A. T. Endo and S. R. Vergilio},
  year   = {2021},
  eprint = {2108.11781},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2108.11781}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2108.11781.svg)](https://codeofpaper.com/paper/2108.11781)

Discussion