一句话:提出 APIComp,用知识图谱从 API 文档抽取知识并自动生成 API 元素比较,效果优于启发式基线。
开发者常需比较相似 API 的共性与细微差异,但这类信息分散在 API 参考文档中。作者先通过 Stack Overflow 问题和 API 文档的实证研究,确认 API 比较问题普遍存在,并归纳出八类有助于比较的 API 陈述。基于此,论文提出 APIComp:离线阶段从 API 参考文档抽取知识并构建 API 知识图谱;在线阶段针对给定的两个 API 类或方法,从多个方面生成比较结果。评估表明,所抽取的多种知识质量总体较高;APIComp 生成的比较结果显著优于基于启发式规则和文本相似度的基线方法,且能帮助开发者完成 API 选择任务。
Developers are concerned with the comparison of similar APIs in terms of their commonalities and (often subtle) differences. Our empirical study of Stack Overflow questions and API documentation confirms that API comparison questions are common and can often be answered by knowledge contained in API reference documentation. Our study also identifies eight types of API statements that are useful for API comparison. Based on these findings, we propose a knowledge graph based approach APIComp that automatically extracts API knowledge from API reference documentation to support the comparison of a pair of API classes or methods from different aspects. Our approach includes an offline phase for constructing an API knowledge graph, and an online phase for generating an API comparison result for a given pair of API elements. Our evaluation shows that the quality of different kinds of extracted knowledge in the API knowledge graph is generally high. Furthermore, the comparison results generated by APIComp are significantly better than those generated by a baseline approach based on heuristic rules and text similarity, and our generated API comparison results are useful for helping developers in API selection tasks.
DOI 原文 ·
@inproceedings{paperbot5878,
title = {Generating concept based API element comparison using a knowledge graph},
author = {Yang Liu and Mingwei Liu and Xin Peng and Christoph Treude and Zhenchang Xing and Xiaoxin Zhang},
booktitle = {ASE},
year = {2020},
doi = {10.1145/3324884.3416628}
}