Title :
An Approach for Search Based Testing of Null Pointer Exceptions
Author :
Romano, Daniele ; Di Penta, Massimiliano ; Antoniol, Giuliano
Author_Institution :
Delft Univ. of Technol., Delft, Netherlands
Abstract :
Uncaught exceptions, and in particular null pointer exceptions (NPEs), constitute a major cause of crashes for software systems. Although tools for the static identification of potential NPEs exist, there is need for proper approaches able to identify system execution scenarios causing NPEs. This paper proposes a search-based test data generation approach aimed at automatically identify NPEs. The approach consists of two steps: (i) an inter-procedural data and control flow analysis - relying on existing technology - that identifies paths between input parameters and potential NPEs, and (ii) a genetic algorithm that evolves a population of test data with the aim of covering such paths. The algorithm is able to deal with complex inputs containing arbitrary data structures. The approach has been evaluated on to test class clusters from six Java open source systems, where NPE bugs have been artificially introduced. Results show that the approach is, indeed, able to identify the NPE bugs, and it outperforms random testing. Also, we show how the approach is able to identify real NPE bugs some of which are posted in the bug-tracking system of the Apache libraries.
Keywords :
Java; data structures; genetic algorithms; program control structures; program debugging; program testing; public domain software; software libraries; system recovery; Apache library; Java open source system; NPE bug; bug-tracking system; control flow analysis; data structure; genetic algorithm; interprocedural data; null pointer exception; search based testing; search-based test data generation; software system crash; system execution; test class cluster; Gallium; Genetic algorithms; Instruments; Java; Libraries; Null value; Testing; Null pointer exceptions; Search-based testing;
Conference_Titel :
Software Testing, Verification and Validation (ICST), 2011 IEEE Fourth International Conference on
Conference_Location :
Berlin
Print_ISBN :
978-1-61284-174-8
Electronic_ISBN :
978-0-7695-4342-0
DOI :
10.1109/ICST.2011.49