Null pointer exceptions are common bugs in Java projects. Previous research has shown that dereferencing the results of method calls is the main source of these bugs, as developers do not anticipate that some methods ...
详细信息
ISBN:
(纸本)9781538632383
Null pointer exceptions are common bugs in Java projects. Previous research has shown that dereferencing the results of method calls is the main source of these bugs, as developers do not anticipate that some methods return null. To make matters worse, we find that whether a method returns null or not (nullness), is rarely documented. We argue that method nullness is a vital piece of information that can help developers avoid this category of bugs. This is especially important for external apis where developers may not even have access to the code. In this paper, we study the method nullness of Apache Lucene, the de facto standard library for text processing in Java. Particularly, we investigate how often the result of each Lucene method is checked against null in Lucene clients. We call this measure method nullability, which can serve as a proxy for method nullness. Analyzing Lucene internal and external usage, we find that most methods are never checked for null. External clients check more methods than Lucene checks internally. Manually inspecting our dataset reveals that some null checks are unnecessary. We present an IDE plugin that complements existing documentation and makes up for missing documentation regarding method nullness and generates nullness annotations, so that static analysis can pinpoint potentially missing or unnecessary null checks.
Software systems use several third party libraries via their available interfaces popularly known as the application programming interface (api). The runtime usage of the api in an object-oriented software system can ...
详细信息
ISBN:
(纸本)9780769551258
Software systems use several third party libraries via their available interfaces popularly known as the application programming interface (api). The runtime usage of the api in an object-oriented software system can be defined by several characteristics including the type and number of api objects created, the methods invoked on those objects, and the source code locations from where the objects were created or invoked during their lifetime. These characteristics can be used to identify the source code locations exhibiting different types of runtime behavior which can be used for program comprehension, debugging, performance monitoring and fault detection. In this paper, we define object invocation model based on above-mentioned characteristics. We also propose an implementation framework that can be used to extract key model parameters from any source code. The Java Collections api is one of the most widely used Java apis. We demonstrate effectiveness of our proposed approach by analyzing object invocation model for Java Collection api in a large open source project.
Understanding apiusage is important for upstream and downstream developers. However, compiling a dataset of api clients is often a tedious task, especially since one needs many clients to draw a representative pictur...
详细信息
ISBN:
(纸本)9781538609927
Understanding apiusage is important for upstream and downstream developers. However, compiling a dataset of api clients is often a tedious task, especially since one needs many clients to draw a representative picture of the apiusage. In this paper, we present KOWALSKI, a tool that takes the name of an api, then finds and downloads client binaries by exploiting the Maven dependency management system. As a case study, we collect clients of Apache Lucene, the de facto standard for full-text search, analyze the binaries, and create a typed call graph that allows developers to identify hotspots in the api.
Almost all software development revolves around the discovery and use of application programming interfaces (apis). Once a suitable api is selected, programmers must begin the process of determining what functionality...
详细信息
ISBN:
(纸本)9781728108100
Almost all software development revolves around the discovery and use of application programming interfaces (apis). Once a suitable api is selected, programmers must begin the process of determining what functionality in the api is relevant to a programmer's task and how to use it. Our work aims to understand how api functionality is discovered by programmers and where tooling may be appropriate. We employed a mixed methods approach to investigate Apache Beam, a distributed data processing api, by mining Beam client code and running a lab study to see how people discover Beam's available functionality. We found that programmers' prior experience with similar apis significantly impacted their ability to find relevant features in an api and attempting to form a top-down mental model of an api resulted in less discovery of features.
暂无评论