Automatic test factoring for Java

Download: PDF.

“Automatic test factoring for Java” by David Saff, Shay Artzi, Jeff H. Perkins, and Michael D. Ernst. In ASE 2005: Proceedings of the 20th Annual International Conference on Automated Software Engineering, (Long Beach, CA, USA), Nov. 2005, pp. 114-123.

Abstract

Test factoring creates fast, focused unit tests from slow system-wide tests; each new unit test exercises only a subset of the functionality exercised by the system test. Augmenting a test suite with factored unit tests should catch errors earlier in a test run.

One way to factor a test is to introduce mock objects. If a test exercises a component T, which interacts with another component E (the “environment”), the implementation of E can be replaced by a mock. The mock checks that T's calls to E are as expected, and it simulates E's behavior in response. We introduce an automatic technique for test factoring. Given a system test for T and E, and a record of T's and E's behavior when the system test is run, test factoring generates unit tests for T in which E is mocked. The factored tests can isolate bugs in T from bugs in E and, if E is slow or expensive, improve test performance or cost.

Our implementation of automatic dynamic test factoring for the Java language reduces the running time of a system test suite by up to an order of magnitude.

Download: PDF.

BibTeX entry:

@inproceedings{SaffAPE2005,
   author = {David Saff and Shay Artzi and Jeff H. Perkins and Michael D.
	Ernst},
   title = {Automatic test factoring for {Java}},
   booktitle = {ASE 2005: Proceedings of the 20th Annual International
	Conference on Automated Software Engineering},
   pages = {114--123},
   address = {Long Beach, CA, USA},
   month = nov,
   year = {2005}
}

Back to Publications that use Daikon as a test subject.