Automatic Test Improvement with DSpot: a Study with Ten Mature Open-Source Projects

Benjamin Danglot, Oscar Luis Vera-Pérez, Benoit Baudry, Martin Monperrus
11/20/2018
cs.SE

Official code: STAMP-project/dspot (121 stars, Java, LGPL-3.0, last commit 2024-08-07).

Abstract

In the literature, there is a rather clear segregation between manually written tests by developers and automatically generated ones. In this paper, we explore a third solution: to automatically improve existing test cases written by developers.

Show full abstract

We present the concept, design, and implementation of a system called \dspot, that takes developer-written test cases as input (junit tests in Java) and synthesizes improved versions of them as output. Those test improvements are given back to developers as patches or pull requests, that can be directly integrated in the main branch of the test code base. We have evaluated DSpot in a deep, systematic manner over 40 real-world unit test classes from 10 notable and open-source software projects. We have amplified all test methods from those 40 unit test classes. In 26/40 cases, DSpot is able to automatically improve the test under study, by triggering new behaviors and adding new valuable assertions. Next, for ten projects under consideration, we have proposed a test improvement automatically synthesized by \dspot to the lead developers. In total, 13/19 proposed test improvements were accepted by the developers and merged into the main code base. This shows that DSpot is capable of automatically improving unit-tests in real-world, large-scale Java software.

View on arXivView PDF

Code Implementations(1)

LGPL-3.0

Automatically detect and generate missing assertions for Junit test cases (also known as test amplification)

12129Java, HTMLFeb 11, 20162 years agoLGPL-3.0
coveragedspoth2020hacktoberfestinria+4 more

Similar Papers

Cite this paper

@article{danglot2018automatic,
  title  = {Automatic Test Improvement with DSpot: a Study with Ten Mature Open-Source Projects},
  author = {Benjamin Danglot and Oscar Luis Vera-Pérez and Benoit Baudry and Martin Monperrus},
  year   = {2018},
  eprint = {1811.08330},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1811.08330}
}

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/1811.08330.svg)](https://codeofpaper.com/paper/1811.08330)

Discussion