Seeker: Demand-Driven Method-Sequence Generation for Object-Oriented Unit Testing
Achieving high structural coverage of object-oriented code in unit testing requires method sequences. These method sequences help produce desired object states such as receiver or argument object states of a method under test (MUT). Automatic generation of method sequences is quite challenging, since sequences often involve methods from multiple classes, resulting in a large search space of possible sequences. Furthermore, various aspects of object-oriented programming such as encapsulation, inheritance, and nested classes pose additional challenges in effectively generating desired sequences. To address this important and yet challenging problem, we propose a novel approach, called Seeker, that uses a combination of static and dynamic analyses. In particular, Seeker forms a feedback loop between static and dynamic analyses via dynamic symbolic execution (DSE). To show the effectiveness of our approach, we compare our approach with state-of-the-art random and DSE-based approaches on four popular applications including 28 KLOC. In our evaluations, we show that Seeker achieves 12% (653 new branches) and 26% (1571 new branches) higher branch coverage than existing DSE-based and random approaches, respectively. Since the branches that are not covered by these existing approaches are generally quite hard to cover, achieving such higher coverage than these approaches is significant. We also show that Seeker detects 34 new defects.
Please follow the instructions mentioned in InstallationManual.txt for using Seeker. More details are available at our project