arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2102.08502cs.SE
收藏

来自技术问答网站的自动API使用场景文档

Automatic API Usage Scenario Documentation from Technical Q&A Sites

Gias Uddin, Foutse Khomh, Chanchal K Roy

摘要:

在线技术问答网站Stack Overflow(SO)在开发人员中很受欢迎,以支持他们的编码和多样化的开发需求。为了解决API官方文档资源中的缺点,一些研究因此集中在用见解来增强官方API文档(例如,代码示例)。这些技术建议将有关API的代码示例/见解添加到其官方文档中。评论是带有积极/消极情绪的固执己见的句子。然而,我们知道以前没有研究试图通过考虑API代码示例和评论来自动从SO生成API文档。在本文中,我们提出了两个新的算法,可用于自动产生API文档从SO结合代码的例子和评论对这些例子。第一种算法被称为统计文档,它使用不同的度量(例如,星级)。第二种算法被称为基于概念的文档,它将相似的和概念上相关的使用场景聚集在一起。API使用场景包含代码示例、由代码示例解决的底层任务的文本描述以及评论(即,意见与积极和消极的情绪)从其他开发人员对代码示例。我们在Opiner中部署了这些算法,Opiner是一个基于Web的平台,可以从在线论坛中聚合有关API的信息。我们通过挖掘SO中所有基于Java JSON的帖子,并根据帖子中生成的文档进行三次用户研究来评估算法。

英文摘要:

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 has 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. 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 paper, 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑