Automatic Test Improvement with DSpot: a Study with Ten Mature Open-Source Projects
arXiv:1811.08330 · doi:10.1007/s10664-019-09692-y
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. 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.
References in corpus (5)
Cited by in corpus (9)
- Generating Accurate Assert Statements for Unit Test Cases using Pretrained Transformers
- Production Monitoring to Improve Test Suites
- Small-Amp: Test Amplification in a Dynamically Typed Language
- An Approach and Benchmark to Detect Behavioral Changes of Commits in Continuous Integration
- BreakBot: Analyzing the Impact of Breaking Changes to Assist Library Evolution
- Suggestions on Test Suite Improvements with Automatic Infection and Propagation Analysis
- Augmenting Diffs With Runtime Information
- Developer-Centric Test Amplification The Interplay Between Automatic Generation and Human Exploration
- Towards Automatic Generation of Amplified Regression Test Oracles