Satisfying Test Preconditions through Guided Object Selection

A random testing strategy can be effective at finding faults, but may leave some routines entirely untested if it never gets to call them on objects satisfying their preconditions. This limitation is particularly frustrating if the object pool does contain some precondition-satisfying objects but the strategy, which selects objects at random, does not use them. The extension of random testing described in this article addresses the problem. Experimentally, the resulting strategy succeeds in testing 56% of the routines that the pure random strategy missed; it tests hard routines 3.6 times more often; although it misses some of the faults detected by the original strategy, it finds 9.5% more faults overall; and it causes negligible overhead.

[1]  Nikolai Tillmann,et al.  Unit tests reloaded: parameterized unit testing with symbolic execution , 2006, IEEE Software.

[2]  Simeon C. Ntafos,et al.  On random and partition testing , 1998, ISSTA.

[3]  Andreas Zeller,et al.  Mining object behavior with ADABU , 2006, WODA '06.

[4]  Yoonsik Cheon,et al.  A specification-based fitness function for evolutionary testing of object-oriented programs , 2006, GECCO '06.

[5]  Catherine Oriat,et al.  Jartege: A Tool for Random Generation of Unit Tests for Java Classes , 2004, QoSA/SOQUA.

[6]  Margus Veanes,et al.  Model-Based Testing of Object-Oriented Reactive Systems with Spec Explorer , 2008, Formal Methods and Testing.

[7]  Bertrand Meyer,et al.  Programs That Test Themselves , 2009, Computer.

[8]  Dave Thomas,et al.  Mock Objects , 2002, IEEE Softw..

[9]  Michael D. Ernst,et al.  Eclat: Automatic Generation and Classification of Test Inputs , 2005, ECOOP.

[10]  Bertrand Meyer,et al.  Experimental assessment of random testing for object-oriented software , 2007, ISSTA '07.

[11]  Bertrand Meyer,et al.  ARTOO , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[12]  Paolo Tonella,et al.  Evolutionary testing of classes , 2004, ISSTA '04.

[13]  Tsong Yueh Chen,et al.  Adaptive Random Testing , 2004, ASIAN.

[14]  Sarfraz Khurshid,et al.  Korat: automated testing based on Java predicates , 2002, ISSTA '02.

[15]  Yannis Smaragdakis,et al.  JCrasher: an automatic robustness tester for Java , 2004, Softw. Pract. Exp..

[16]  Elaine J. Weyuker,et al.  Analyzing Partition Testing Strategies , 1991, IEEE Trans. Software Eng..

[17]  Bertrand Meyer,et al.  On the Predictability of Random Tests for Object-Oriented Software , 2008, 2008 1st International Conference on Software Testing, Verification, and Validation.

[18]  Bertrand Meyer,et al.  Automatic Testing of Object-Oriented Software , 2007, SOFSEM.

[19]  Daniel Hoffman,et al.  Boundary Values and Automated Component Testing , 1999, Softw. Test. Verification Reliab..