A random testing strategy for object-oriented software constructs test runs by repeatedly performing the following three tasks: 1) randomly select a method under test (MUT); 2) randomly select or construct target or argument objects to feed to the chosen method; 3) invoke the test case. Usually all the objects created for or returned by a MUT are stored in an object pool for reuse by future test cases. When testing contract-equipped software it becomes difficult for a random testing strategy to select input objects that satisfy the MUT’s preconditions. The generated test cases often fail the preconditions and thus some methods are rarely tested (if at all). We propose an improvement to random testing through a smarter selection of objects in order to satisfy more preconditions. All predicates appearing in the classes under test are collected into a pool and evaluated on the objects involved in each test case invocation. Predicates are mapped to satisfying object combinations in the pool and can be easily selected as input upon a test cas
To submit an update or takedown request for this paper, please submit an Update/Correction/Removal Request.