A New Approach to Evaluating Nullability Inference Tools
Null-pointer exceptions are serious problem for Java, and researchers have developed type-based nullness checking tools to prevent them. These tools, however, have a downside: they require developers to write nullability annotations, which is time-consuming and hinders adoption. Researchers have therefore proposed nullability annotation inference tools, whose goal is to (partially) automate the task of annotating a program for nullability. However, prior works rely on differing theories of what makes a set of nullability annotations good, making comparing their effectiveness challenging. In this work, we identify a systematic bias in some prior experimental evaluation of these tools: the use of “type reconstruction” experiments to see if a tool can recover erased developer-written annotations. We show that developers make semantic code changes while adding annotations to facilitate typechecking, leading such experiments to overestimate the effectiveness of inference tools on never-annotated code. We propose a new definition of the “best” inferred annotations for a program that avoids this bias, based on a systematic exploration of the design space. With this new definition, we perform the first head-to-head comparison of three extant nullability inference tools. Our evaluation showed the complementary strengths of the tools and remaining weaknesses that could be addressed in future work.
Authors
- Manu Sridharan (ORCID: https://orcid.org/0000-0001-7993-302X)
- Martin Kellogg (ORCID: https://orcid.org/0000-0002-3185-2340)
- Erfan Arvan (ORCID: https://orcid.org/0000-0002-6170-1957)
- Nima Karimipour (ORCID: https://orcid.org/0000-0002-2599-7770)
Institutions
- University of California, Riverside (US)
- New Jersey Institute of Technology (US)
Publication Details
- Journal
- Proceedings of the ACM on software engineering.
- Published
- 2025-06-19
- DOI
- https://doi.org/10.1145/3715732
- Primary Topic
- Security and Verification in Computing
- Type
- article
- Field-Weighted Citation Impact
- 0.00