Analyzing Complex Data Structures Using PEX for Effective Test Generation
This research explores the application of Microsoft PEX for white-box test generation focused on complex data structures such as lists, queues, maps, trees, and graphs. By implementing the Directed Automated Random Testing (DART) approach, the study examines how a push-button methodology can effectively generate test inputs for programs with pointers. With concrete examples and practical implementations, it discusses the limitations of PEX, reports bugs, and suggests methods for improvement, including factory and pool approaches. The findings underline the potential for further research in this area.
Analyzing Complex Data Structures Using PEX for Effective Test Generation
E N D
Presentation Transcript
Analysis of Complex Data Structures with PEX VadimMutilin EvgeniyGerlits Vladimir Fedotov Mentor: Patrice Godefroid
Microsoft Pex • White box test generation for .NET • Implements DART (Directed Automated Random Testing): combines concrete and symbolic executions • Push button approach
Complex Data Structures • Examples: List, Queue, Map, Tree, Graph
Motivation • Nikolai Tillmann, et al. Test Input Generation for Programs with Pointers. TACAS 2009. • Does push button approach really work on complex data structures? • class MyList<T> • private T value • add(T value) • void removeAT(intindex) • T getItem(int index)
Project Goals • Understanding limits • Documentation • Authors • Concrete examples • Making out suggestions • Usage patterns • Improvements
Push Button (Results) • MyContains 6/6 (100.00%), 103 Runs
Push Button (Results) covered/total basic blocks (test runs)
Factory Approach • Pex generates template for Factory method • User adds Factory method which generates the inputs • Factory method may be parameterized
Factory (Results) covered/total basic blocks (test runs)
Pool Approach • Collection of concrete input objects • Collection is created manually by the tester • Pex iterates indexes • Implementation is called with concrete objects by their indexes
Pool (Results) covered/total basic blocks (test runs)
Relaxing Visibility Constraints Can be done with annotation
Conclusion • Pex limitations are still unclear • 2 bugs reported to the Pex team • Suggested • Pool approach • Relaxing visibility constraints with annotations • Promising topic for further research