An Automatic Localization Tool for Null Pointer Exceptions

Null pointer exceptions are common software faults, but they are dangerous and can cause a program to crash if they occur. In addition, it is hard to find them by simply running test cases. When a null pointer exception occurs, the stack trace stored by the Java runtime environment can help us to locate the cause of the exception. In this paper, firstly, we propose an automatically null pointer exception localization approach guided by stack trace, from the null pointer dereference to the null value assignment point. Secondly, an empirical study is designed to evaluate the effectiveness of the tool on eight open source projects. The experimental results show that the tool is effective in locating the null pointer exception.

[1]  Susan Horwitz,et al.  Better Debugging via Output Tracing and Callstack-Sensitive Slicing , 2010, IEEE Transactions on Software Engineering.

[2]  David E. Evans,et al.  Static detection of dynamic memory errors , 1996, PLDI '96.

[3]  Shujuan Jiang,et al.  An improved static program slicing algorithm using stack trace , 2011, 2011 IEEE 2nd International Conference on Software Engineering and Service Science.

[4]  Sen Ma,et al.  Practical null pointer dereference detection via value-dependence analysis , 2015, 2015 IEEE International Symposium on Software Reliability Engineering Workshops (ISSREW).

[5]  Martin Monperrus,et al.  Dynamic patch generation for null pointer exceptions using metaprogramming , 2017, 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER).

[6]  Dawson R. Engler,et al.  Using Redundancies to Find Errors , 2003, IEEE Trans. Software Eng..

[7]  Giuliano Antoniol,et al.  An Approach for Search Based Testing of Null Pointer Exceptions , 2011, 2011 Fourth IEEE International Conference on Software Testing, Verification and Validation.

[8]  David Hovemeyer,et al.  Evaluating and tuning a static analysis to find null pointer bugs , 2005, PASTE '05.

[9]  Tian Cong,et al.  CEGAR Based Null-Pointer Dereference Checking in C Programs , 2016 .

[10]  Janusz W. Laski,et al.  Dynamic Program Slicing , 1988, Inf. Process. Lett..

[11]  Martin Monperrus,et al.  Nopol: Automatic Repair of Conditional Statement Bugs in Java Programs , 2018, IEEE Transactions on Software Engineering.

[12]  Willem Visser,et al.  Variably interprocedural program analysis for runtime error detection , 2007, ISSTA '07.

[13]  Shujuan Jiang,et al.  Fault localization and repair for Java runtime exceptions , 2009, ISSTA.

[14]  Wei Li,et al.  Fault Localization for Null Pointer Exception Based on Stack Trace and Program Slicing , 2012, 2012 12th International Conference on Quality Software.

[15]  Ma Se Null Pointer Dereference Detection Based on Value Dependences Analysis , 2015 .

[16]  David W. Binkley,et al.  Program slicing , 2008, 2008 Frontiers of Software Maintenance.

[17]  Xiangyu Zhang,et al.  Locating faulty code by multiple points slicing , 2007, Softw. Pract. Exp..

[18]  M. Lam,et al.  Tracking down software bugs using automatic anomaly detection , 2002, Proceedings of the 24th International Conference on Software Engineering. ICSE 2002.

[19]  Martin P. Robillard,et al.  Static analysis to support the evolution of exception structure in object-oriented systems , 2003, TSEM.

[20]  Michael D. Bond,et al.  Tracking bad apples: reporting the origin of null and undefined value errors , 2007, OOPSLA.

[21]  Mangala Gowri Nanda,et al.  Accurate Interprocedural Null-Dereference Analysis for Java , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[22]  Rongxin Wu,et al.  CrashLocator: locating crashing faults based on crash stacks , 2014, ISSTA 2014.

[23]  Saurabh Sinha,et al.  Analysis and Testing of Programs with Exception Handling Constructs , 2000, IEEE Trans. Software Eng..