DocumentCode :
1035768
Title :
Reducing the use of nullable types through non-null by default and monotonic non-null
Author :
Chalin, P. ; James, P.R. ; Rioux, F.
Author_Institution :
Dept. of Comput. Sci. & Software Eng., Concordia Univ., Montreal, QC
Volume :
2
Issue :
6
fYear :
2008
fDate :
12/1/2008 12:00:00 AM
Firstpage :
515
Lastpage :
531
Abstract :
With Java 5 annotations, the authors note a marked increase in tools that can statically detect potential null dereferences. To be effective, such tools require that developers annotate declarations with nullity modifiers and have annotated API libraries. Unfortunately, in the experience of the authors, specifying moderately large code bases, the use of non-null annotations is more labour intensive than it should be. Motivated by this experience, the authors conducted an empirical study of five open source projects totalling 700 K lines-of-code, which confirms that, on average, 75% of reference declarations are meant to be non-null, by design. Guided by these results, the authors propose the adoption of non-null-by-default semantics. This new default has advantages of better matching general practice, lightening developer annotation burden and being safer. The authors also describe the eclipse Java modelling language (JML) Java development tooling (JDT), a tool supporting the new semantics, including the ability to read the extensive API library specifications written in the JML. Issues of backwards compatibility are addressed. In a second phase of the empirical study, the authors analysed the uses of null and noted that over half of the nullable field references are only assigned non-null values. For this category of reference, the authors introduce the concept of monotonic non-null type and illustrate the benefits of its use.
Keywords :
Java; application program interfaces; software libraries; Java 5 annotations; Java development tooling; annotated API libraries; eclipse Java modelling language; lightening developer annotation; monotonic nonnull type annotation;
fLanguage :
English
Journal_Title :
Software, IET
Publisher :
iet
ISSN :
1751-8806
Type :
jour
DOI :
10.1049/iet-sen:20080010
Filename :
4717283
Link To Document :
بازگشت