kirancodes.me
To Proof Maintenance & Beyond!

Saying 'hi!' is not enough: mining inputs for effective test generation

Luca Della Toffola, Cristian-Alexandru Staicu, Michael Pradel

Abstract

Automatically generating unit tests is a powerful approach to exercise complex software. Unfortunately, current techniques often fail to provide relevant input values, such as strings that bypass domain-specific sanity checks. As a result, state-of-the-art techniques are effective for generic classes, such as collections, but less successful for domain-specific software. This paper presents TestMiner, the first technique for mining a corpus of existing tests for input values to be used by test generators for effectively testing software not in the corpus. The main idea is to extract literals from thousands of tests and to adapt information retrieval techniques to find values suitable for a particular domain. Evaluating the approach with 40 Java classes from 18 different projects shows that TestMiner improves test coverage by 21% over an existing test generator. The approach can be integrated into various test generators in a straightforward way, increasing their effectiveness on previously difficult-to-test classes.

BibTeX
@inproceedings{Toffola-al:ASE17,
  author    = {Luca Della Toffola and
               Cristian{-}Alexandru Staicu and
               Michael Pradel},
  title     = {Saying 'hi!' is not enough: mining inputs for effective test generation},
  booktitle = {ASE},
  pages     = {44--49},
  publisher = {{IEEE} Computer Society},
  year      = {2017},
}

Related papers