Automatic Detection and Repair Recommendation of Directive Defects in Java API Documentation

Yu Zhou,Changzhi Wang,Xin Yan,Taolue Chen,Sebastiano Panichella,Harald Gall
DOI: https://doi.org/10.1109/tse.2018.2872971
IF: 7.4
2020-09-01
IEEE Transactions on Software Engineering
Abstract:Application Programming Interfaces (APIs) represent key tools for software developers to build complex software systems. However, several studies have revealed that even major API providers tend to have incomplete or inconsistent API documentation. This can severely hamper the API comprehension and, as a consequence, the quality of the software built on them. In this paper, we propose DRONE (Detect and Repair of dOcumentatioN dEfects), a framework to automatically detect and repair defects from API documents by leveraging techniques from program analysis, natural language processing, and constraint solving. Specifically, we target at the directives of API documents, which are related to parameter constraints and exception handling declarations. Furthermore, in presence of defects, we also provide a prototypical repair recommendation system. We evaluate our approach on parts of the well-documented APIs of JDK 1.8 APIs (including javaFX) and Android 7.0 (level 24). Across the two empirical studies, our approach can detect API defects with an average F-measure of 79.9, 71.7, and 81.4 percent, respectively. The API repairing capability has also been evaluated on the generated recommendations in a further experiment. User judgments indicate that the constraint information is addressed correctly and concisely in the rendered directives.
engineering, electrical & electronic,computer science, software engineering
What problem does this paper attempt to address?
The paper primarily aims to address the issues of incompleteness or inconsistency in Application Programming Interface (API) documentation in software development. These issues can lead to difficulties for developers when using these APIs and affect the quality of the software being built. To solve this problem, the authors propose a framework named DRONE (Detect and Repair of dOcumentatioN dEfects), which can automatically detect and repair defects in API documentation. Specifically, DRONE achieves its functionality by combining program analysis, natural language processing, and constraint solving techniques. It mainly works on the instructional parts of the API documentation, which are related to parameter constraints and exception handling declarations. When defects are found in the documentation, DRONE can also provide prototype repair suggestions. To validate the effectiveness of DRONE, the authors evaluated it in two experimental studies, using parts of the Java Development Kit (JDK) 1.8 (including JavaFX) and Android 7.0 (API level 24) APIs as datasets. The results show that DRONE has a high average F-measure in detecting API defects (79.9%, 71.7%, and 81.4% respectively). Furthermore, the generated repair suggestions were also evaluated, and user feedback indicated that the constraint information was correctly and concisely expressed in the provided instructions.