Software developers use application-programming interface (api) documentation to learn how to use the features of software libraries. How quickly software developers learn to use a library's features determines ho...
详细信息
ISBN:
(纸本)9781457721243
Software developers use application-programming interface (api) documentation to learn how to use the features of software libraries. How quickly software developers learn to use a library's features determines how quickly they can apply those features in a software application. Recent studies have shown that api documentation is, unfortunately, not always as helpful to software developers as they need it to be. This paper studies the prototype of a tool and a method that are being developed to help technical writers identify the elements of api reference documentation that help software developers complete programming tasks. The tool and method described in this paper use a remote user-assessment platform, which enables researchers and technical writers to study the effect that document design variations have on a large and diverse audience. Such an approach can help technical writers identify new best practices for writing effective api documentation.
Using api reference documentation like JavaDoc is an integral part of software development. Previous research introduced a grounded taxonomy that organizes api documentation knowledge in 12 types, including knowledge ...
详细信息
ISBN:
(纸本)9781450355728
Using api reference documentation like JavaDoc is an integral part of software development. Previous research introduced a grounded taxonomy that organizes api documentation knowledge in 12 types, including knowledge about the Functionality, Structure, and Quality of an api. We study how well modern text classification approaches can automatically identify documentation containing specific knowledge types. We compared conventional machine learning (k-NN and SVM) with deep learning approaches trained on manually-annotated Java and. NET api documentation (n = 5,574). When classifying the knowledge types individually (i.e., multiple binary classifiers) the best AUPRC was up to 87%. The deep learning and SVM classifiers seem complementary. For four knowledge types (Concept, Control, Pattern, and Non-Information), SVM clearly outperforms deep learning which, on the other hand, is more accurate for identifying the remaining types. When considering multiple knowledge types at once (i.e., multi-label classification) deep learning outperforms naive baselines and traditional machine learning achieving a MacroAUC up to 79%. We also compared classifiers using embeddings pre-trained on generic text corpora and Stack-Overflow but did not observe significant improvements. Finally, to assess the generalizability of the classifiers, we re-tested them on a different, unseen Python documentation dataset. Classifiers for Functionality, Concept, Purpose, Pattern, and Directive seem to generalize from Java and. NET to Python documentation. We discuss our results and how they inform the development of tools for supporting developers sharing and accessing api knowledge.
Developers often search for application programming interfaces (apis) and their usage patterns to speed up the efficiency of software development. This paper focuses on the api sequence search task, which refers to us...
详细信息
ISBN:
(纸本)9781665452786
Developers often search for application programming interfaces (apis) and their usage patterns to speed up the efficiency of software development. This paper focuses on the api sequence search task, which refers to using a function-relevant textual query to search for api sequences mined from open-source software repositories that can implement this function. However, the severe semantic gap between text and api makes it challenging to discover the correspondence between natural language queries and desired api sequences. Therefore, we propose a method called documentation-guided api sequence search (DGAS), through which we do not need to worry about the semantic gap between text and api. Specifically, DGAS consists of documentation-guided cross-modal attention (DGCA) and documentation-guided cross-modal matching (DGCM). DGCA calculates the cross-modal attention map using features extracted from the same modality (i.e., api documentation sequence and textual query) instead of from different modalities (i.e., api sequence and textual query) to bridge the semantic gap during the cross-modal attention phase. Besides, DGCM takes api documentation as supplementary information of api sequence to bridge the semantic gap during the cross-modal matching phase. We use the api documentation to extend the existing dataset for api sequence generation to construct a dataset for api sequence search to evaluate DGAS. Experimental results show that DGAS outperforms the baseline methods.
Developers often call apis to improve development efficiency, but they misuse apis due to lack of understanding of source code logic and other unavoidable reasons, resulting in serious consequences such as program cra...
详细信息
ISBN:
(数字)9781665481434
ISBN:
(纸本)9781665481434
Developers often call apis to improve development efficiency, but they misuse apis due to lack of understanding of source code logic and other unavoidable reasons, resulting in serious consequences such as program crashes. Many studies that extract api usage constraints from api documentation or codebases expect to get out of this dilemma through api misuse detection. However, low recall remains a hurdle for researchers to overcome. In this work, we make full use of api documentation and codebases to construct constraint knowledge graph, and propose a new api misuse detector, MisuseHint. We precisely define api constraints into seven categories, utilize api caveat knowledge in documentation and api usage patterns in codebases, and fuse knowledge from both to build knowledge graph with rich constraints. To detect api misuses, we obtain api usage constraints in the knowledge graph and analyze static code to propose different strategies to determine whether api misuses exist. Through defect pattern analysis, object variable tracking, and Z3 SAT solver, our detector can identify various complex situations of code at a fine-grained level, especially solving various complex problems of Call Order and State Checking constraints. Experimental results on MUBench show that our recall reaches 39.78%, demonstrating the validity and theoretical feasibility of fusing documentation and codebases using knowledge graphs. MisuseHint achieves a recall of 76.34% when it is always given sufficient api constraints. This detector can practically help developers program effectively.
api(application programming interface)documentation is critical for developers to learn ***,it is unclear whether api documentation indeed improves the api learnability for *** this paper,we focus on two types of api ...
详细信息
api(application programming interface)documentation is critical for developers to learn ***,it is unclear whether api documentation indeed improves the api learnability for *** this paper,we focus on two types of api documentation,i.e.,official api tutorials and api crowd ***,we analyze api coverage and check api consistencies in api documentation based on the api ***,we conduct a survey and extract several characteristics to analyze which api documentation can help developers learn *** findings show that:1)api crowd documentation can be regarded as a supplement to the official api tutorials to some extent;2)the concerns for frequently-used apis between different types of api documentation show a huge mismatch,which may prevent developers from deeply understanding the usages of apis through only one type of api documentation;3)official api tutorials can help developers seek api information on a long page and api crowd documentation could provide long codes for a particular programming *** findings may help developers select the suitable api documentation and find the useful information they need.
Code comments can help in program comprehension and are considered as important artifacts to help developers in software maintenance. However, the comments are mostly missing or are outdated, specially in complex soft...
详细信息
ISBN:
(纸本)9781665414036
Code comments can help in program comprehension and are considered as important artifacts to help developers in software maintenance. However, the comments are mostly missing or are outdated, specially in complex software projects. As a result, several automatic comment generation models are developed as a solution. The recent models explore the integration of external knowledge resources such as Unified Modeling Language class diagrams to improve the generated comments. In this paper, we propose api2Com, a model that leverages the Application Programming Interface documentations (api Docs) as a knowledge resource for comment generation. The api Docs include the description of the methods in more details and therefore, can provide better context in the generated comments. The api Docs are used along with the code snippets and Abstract Syntax Trees in our model. We apply the model on a large Java dataset of over 130,000 methods and evaluate it using both Transformer and RNN-base architectures. Interestingly, when api Docs are used, the performance increase is negligible. We therefore run different experiments to reason about the results. For methods that only contain one api, adding api Docs improves the results by 4% BLEU score on average (BLEU score is an automatic evaluation metric used in machine translation). However, as the number of apis that are used in a method increases, the performance of the model in generating comments decreases due to long documentations used in the input. Our results confirm that the api Docs can be useful in generating better comments, but, new techniques are required to identify the most informative ones in a method rather than using all documentations simultaneously.
Application programming interfaces (apis) documentation is the official reference of the apis. Defects in api documentation pose serious hurdles to their comprehension and usage. In this paper, we present DRONE, a too...
详细信息
ISBN:
(纸本)9781728117645
Application programming interfaces (apis) documentation is the official reference of the apis. Defects in api documentation pose serious hurdles to their comprehension and usage. In this paper, we present DRONE, a tool that can automatically detect the directive defects in apis documents and recommend repair solutions to fix them. Particularly, DRONE focuses on four defect types related to parameter usage constraints. To achieve this, DRONE leverages techniques from static program analysis, natural language processing and logic reasoning. The implementation is based on the Eclipse-plugin architecture, which provides an integrated user interface. Extensive experiments demonstrate the efficacy of the tool.
Application Programming Interface (api) documents represent one of the most important references for api users. However, it is frequently reported that the documentation is inconsistent with the source code and deviat...
详细信息
ISBN:
(纸本)9781538638682
Application Programming Interface (api) documents represent one of the most important references for api users. However, it is frequently reported that the documentation is inconsistent with the source code and deviates from the api itself. Such inconsistencies in the documents inevitably confuse the api users hampering considerably their api comprehension and the quality of software built from such apis. In this paper, we propose an automated approach to detect defects of api documents by leveraging techniques from program comprehension and natural language processing. Particularly, we focus on the directives of the api documents which are related to parameter constraints and exception throwing declarations. A first-order logic based constraint solver is employed to detect such defects based on the obtained analysis results. We evaluate our approach on parts of well documented JDK 1.8 apis. Experiment results show that, out of around 2000 api usage constraints, our approach can detect 1158 defective document directives, with a precision rate of 81.6%, and a recall rate of 82.0%, which demonstrates its practical feasibility.
Context: Well established libraries typically have api documentation. However, they frequently lack examples and explanations, possibly making difficult their effective reuse. Stack Overflow is a question-and-answer w...
详细信息
Context: Well established libraries typically have api documentation. However, they frequently lack examples and explanations, possibly making difficult their effective reuse. Stack Overflow is a question-and-answer web site oriented to issues related to software development. Despite the increasing adoption of Stack Overflow, the information related to a particular topic (e.g., an api) is spread across the website. Thus, Stack Overflow still lacks organization of the crowd knowledge available on it. Objective: Our target goal is to address the problem of the poor quality documentation for apis by providing an alternative artifact to document them based on the crowd knowledge available on Stack Overflow, called crowd cookbook. A cookbook is a recipe-oriented book, and we refer to our cookbook as crowd cookbook since it contains content generated by a crowd. The cookbooks are meant to be used through an exploration process, i.e. browsing. Method: In this paper, we present a semi-automatic approach that organizes the crowd knowledge available on Stack Overflow to build cookbooks for apis. We have generated cookbooks for three apis widely used by the software development community: SWT, LINQ and QT. We have also defined desired properties that crowd cookbooks must meet, and we conducted an evaluation of the cookbooks against these properties with human subjects. Results: The results showed that the cookbooks built using our approach, in general, meet those properties. As a highlight, most of the recipes were considered appropriate to be in the cookbooks and have self-contained information. Conclusion: We concluded that our approach is capable to produce adequate cookbooks automatically, which can be as useful as manually produced cookbooks. This opens an opportunity for api designers to enrich existent cookbooks with the different points of view from the crowd, or even to generate initial versions of new cookbooks.
Software developers increasingly rely on application programming interfaces (apis) of frameworks to increase productivity. An api method is generally used within code snippets along with other methods of the api of in...
详细信息
Software developers increasingly rely on application programming interfaces (apis) of frameworks to increase productivity. An api method is generally used within code snippets along with other methods of the api of interest. When developers invoke api methods in a framework, they often encounter difficulty to determine which methods to call due to the huge number of included methods in that api. Developers usually exploit a source code search tool searching for code snippets that use the api methods of interest. However, the number of returned code snippets is very large which hinders the developer to locate useful ones. Moreover, co-usage relationships between api methods are often not documented. This article presents an approach to identify multi-level frequent usage patterns (IML-FUP) to help developers understand api usage and facilitate the development tasks when they use new apis. An identified pattern represents a set of api methods that are frequently called together across interfering usage scenarios. In order to investigate the efficiency of the proposed approach, an experimental evaluation is conducted using four apis and 89 client programs. For all studied apis, the experimental results show that the proposed approach identifies usage patterns that are always strongly cohesive and highly consistent. (C) 2017 Elsevier Inc. All rights reserved.
暂无评论