2014 Software Evolution Week --- IEEE Conference on Software Maintenance, Reengineering, and Reverse Engineering (CSMR-WCRE), February 3-6, 2014, Antwerp, Belgium

Desktop Layout

Empirical Investigation
Main Research
Willem Elsschotzaal, Chairs: Rudolf Ferenc and Rocco Oliveto
Does Return Null Matter?
Shuhei Kimura, Keisuke Hotta, Yoshiki Higo, Hiroshi Igaki, and Shinji Kusumoto
(Osaka University, Japan)
Abstract: Developers often use null references for the returned values of methods (return null) in object-oriented languages. Although developers often use return null to indicate that a program does not satisfy some necessary conditions, it is generally felt that a method returning null is costly to maintain. One of the reasons for is that when a method receives a value returned from a method invocation whose code includes return null, it is necessary to check whether the returned value is null or not (null check). As developers often forget to write null checks, null dereferences occur frequently. However, it has not been clarified to what degree return null affects software maintenance during software evolution. This paper shows the influences of return null by investigating return null and null check in the evolution of source code. Experiments conducted on 14 open source projects showed that developers modify return null more frequently than return statements that do not include null. This result indicates that return null has a negative effect on software maintenance. It was also found that the size and the development phases of projects have no effect on the frequency of modifications on return null and null check. In addition, we found that all the projects in this experiment had from one to four null checks per 100 lines.


Time stamp: 2019-07-23T00:48:42+02:00