• DocumentCode
    251835
  • Title

    Does return null matter?

  • Author

    Kimura, Shunji ; Hotta, Kazuhiro ; Higo, Y. ; Igaki, Hiroshi ; Kusumoto, Shinji

  • Author_Institution
    Grad. Sch. of Inf. Sci. & Technol., Osaka Univ., Suita, Japan
  • fYear
    2014
  • fDate
    3-6 Feb. 2014
  • Firstpage
    244
  • Lastpage
    253
  • 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.
  • Keywords
    object-oriented languages; program diagnostics; software maintenance; method invocation; null check; null dereferences; object-oriented languages; return null; software evolution; software maintenance; source code; Correlation; Educational institutions; Java; Null value; Software maintenance; Writing; return null; software evolution; software maintenance;
  • fLanguage
    English
  • Publisher
    ieee
  • Conference_Titel
    Software Maintenance, Reengineering and Reverse Engineering (CSMR-WCRE), 2014 Software Evolution Week - IEEE Conference on
  • Conference_Location
    Antwerp
  • Type

    conf

  • DOI
    10.1109/CSMR-WCRE.2014.6747176
  • Filename
    6747176