An Approach for Search Based Testing of Null Pointer Exceptions

  • Authors:
  • Daniele Romano;Massimiliano Di Penta;Giuliano Antoniol

  • Affiliations:
  • -;-;-

  • Venue:
  • ICST '11 Proceedings of the 2011 Fourth IEEE International Conference on Software Testing, Verification and Validation
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

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.