arrow
返回

Automatic API Usage Scenario Documentation from Technical Q&A Sites

delete2021-04-23
delete11
PRE
AI
G
Gias Uddin *
F
Foutse Khomh
C
Chanchal K. Roy
DOI:10.1145/3439769delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
The online technical Q&A site Stack Overflow (SO) is popular among developers to support their coding and diverse development needs. To address shortcomings in API official documentation resources, several research works have thus focused on augmenting official API documentation with insights (e.g., code examples) from SO. The techniques propose to add code examples/insights about APIs into its official documentation. Recently, surveys of software developers find that developers in SO consider the combination of code examples and reviews about APIs as a form of API documentation, and that they consider such a combination to be more useful than official API documentation when the official resources can be incomplete, ambiguous, incorrect, and outdated. Reviews are opinionated sentences with positive/negative sentiments. However, we are aware of no previous research that attempts to automatically produce API documentation from SO by considering both API code examples and reviews. In this article, we present two novel algorithms that can be used to automatically produce API documentation from SO by combining code examples and reviews towards those examples. The first algorithm is called statistical documentation, which shows the distribution of positivity and negativity around the code examples of an API using different metrics (e.g., star ratings). The second algorithm is called concept-based documentation, which clusters similar and conceptually relevant usage scenarios. An API usage scenario contains a code example, a textual description of the underlying task addressed by the code example, and the reviews (i.e., opinions with positive and negative sentiments) from other developers towards the code example. We deployed the algorithms in Opiner, a web-based platform to aggregate information about APIs from online forums. We evaluated the algorithms by mining all Java JSON-based posts in SO and by conducting three user studies based on produced documentation from the posts. The first study is a survey, where we asked the participants to compare our proposed algorithms against a Javadoc-syle documentation format (called as Type-based documentation in Opiner). The participants were asked to compare along four development scenarios (e.g., selection, documentation). The participants preferred our proposed two algorithms over type-based documentation. In our second user study, we asked the participants to complete four coding tasks using Opiner and the API official and informal documentation resources. The participants were more effective and accurate while using Opiner. In a subsequent survey, more than 80% of participants asked the Opiner documentation platform to be integrated into the formal API documentation to complement and improve the API official documentation.
Keyword:
API
documentation
usage scenario
crowd-sourced developer forum
AI总结

AI总结

对已上传原文的论文进行重点信息的提取,主要内容包括:简要概述、研究摘要、背景介绍、关键亮点、图文解析、展望与总结。

期刊

A
ACM Transactions on Software Engineering and Methodology
IF:
6.2
论文数:
1.2K
被引数:
3.4K

机构

U
University of Calgary
学者数:
3.8W
论文数: 3.3W
被引数: 52
U
universite de montreal
学者数:
4.6W
论文数: 3.8W
被引数: 46
P
Polytechnique Montreal
学者数:
3.7K
论文数: 3.4K
被引数: 42
学者 查看更多机构
引用论文

引用论文

err分享
err收藏
How API Documentation Fails
err2015-07-01
err136
PREAI
errUddin, Gias; Robillard, Martin P.
err分享
err收藏
Understanding How and Why Developers Seek and Analyze API-Related Opinions
err2021-04-01
err16
errOAAI
errUddin, Gias; Baysal, Olga; Guerrouj, Latifa; Khomh, Foutse
err分享
err收藏
Mining version histories to guide software changes
err2005-06-01
err469
PREAI
errZimmermann, T; Weissgerber, P; Diehl, S; Zeller, A
err分享
err收藏
err分享
err收藏
学者 查看更多内容