Composing Unit Tests

If we were to apply the testing techniques of object-oriented systems prescribed by the XUnit framework to a car factory, the result would be an inefficient process: A tire would be created, quality assured and then thrown away, only to be recreated later to test the functionality of the whole car. XUnit makes it difficult to reuse intermediate results of low level unit tests. As a consequence a higher level unit test is forced to recreate test scenarios which were already created by lower level unit tests. This duplicated testing effort is time-consuming both for setting up new scenarios and for running the tests. To address this problem we suggest a semi-automatic approach to compose tests. First we describe how we can detect candidates of composable test cases by partially ordering their sets of covered method signatures, then we present techniques to refactor unit tests accordingly.

[1]  Oscar Nierstrasz,et al.  One-Method Commands: Linking Methods and Their Tests , 2004 .

[2]  Oscar Nierstrasz,et al.  Ordering broken unit tests for focused debugging , 2004, 20th IEEE International Conference on Software Maintenance, 2004. Proceedings..

[3]  John D. McGregor,et al.  Testing a Software Product Line , 2001, PSSE.

[4]  Kent Beck,et al.  Test-infected: programmers love writing tests , 2000 .

[5]  Michele Lanza,et al.  CodeCrawler-lessons learned in building a software visualization tool , 2003, Seventh European Conference onSoftware Maintenance and Reengineering, 2003. Proceedings..

[6]  Jonathan Edwards,et al.  Example centric programming , 2004, SIGP.

[7]  Gregg Rothermel,et al.  Test case prioritization: an empirical study , 1999, Proceedings IEEE International Conference on Software Maintenance - 1999 (ICSM'99). 'Software Maintenance for Business Change' (Cat. No.99CB36360).

[8]  Henry Lieberman,et al.  A Session with Tinker: Interleaving Program Testing with Program Writing , 1980, LISP Conference.

[9]  Oscar Nierstrasz,et al.  Towards a Taxonomy of SUnit Tests , 2005, ESUG.

[10]  Jonathan Edwards Example centric programming , 2004, OOPSLA 2004.

[11]  Henry Lieberman,et al.  A session with Tinker: Interleaving program testing with program design , 1980, LISP Conference.

[12]  Gregg Rothermel,et al.  Prioritizing test cases for regression testing , 2000, ISSTA '00.