Generating parameterized unit tests

Gordon Fraser, Andreas Zeller
2011 Proceedings of the 2011 International Symposium on Software Testing and Analysis - ISSTA '11  
State-of-the art techniques for automated test generation focus on generating executions that cover program behavior. As they do not generate oracles, it is up to the developer to figure out what a test does and how to check the correctness of the observed behavior. In this paper, we present an approach to generate parameterized unit tests-unit tests containing symbolic pre-and postconditions characterizing test input and test result. Starting from concrete inputs and results, we use test
more » ... tion and mutation to systematically generalize pre-and postconditions while simplifying the computation steps. Evaluated on five open source libraries, the generated parameterized unit tests are (a) more expressive, characterizing general rather than concrete behavior; (b) need fewer computation steps, making them easier to understand; and (c) achieve a higher coverage than regular unit tests.
doi:10.1145/2001420.2001464 dblp:conf/issta/FraserZ11 fatcat:lqqaqdfzmrhnxg57k75suuwnfa