Automatic test factoring for Java

Download: PDF, PostScript.

“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), November 9-11, 2005, pp. 114-123.
A previous version appeared as MIT Laboratory for Computer Science technical report MIT-LCS-TR-991, (Cambridge, MA), June 7, 2005.


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, PostScript.

BibTeX entry:

   author = {David Saff and Shay Artzi and Jeff H. Perkins and Michael D.
   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 = {November~9--11,},
   year = {2005}

(This webpage was created with bibtex2web.)

Back to Program Analysis Group publications.