Automatically identifying valid API versions for software development tutorials on the Web

Automatically identifying valid API versions for software development tutorials on the Web
复制标题

DOI:
10.1002/smr.2227
复制
发表时间:
2019-11-21
影响因子:
2
通讯作者:
Damevski,Kostadin
Damevski,Kostadin
中科院分区:
计算机科学4区
文献类型:
--
作者:
Nishi,Manziba Akanda;Damevski,Kostadin

文献摘要

相似文献

在线教程是许多开发人员用来学习新api和技术的社区创建信息的宝贵来源。一旦写好,教程就很少被积极策划,并且随着时间的推移会变得过时。教程经常引用变化很快的API,不推荐的类、方法和字段会使教程不适用于API的新版本。较新的教程可能与仍在使用的旧api不兼容。在本文中,我们首先对教程版本控制问题进行了实证研究,证实了它在Web上流行的教程中的存在。我们随后提出了一种基于文献中类似技术的技术,用于自动检测教程的适用API版本范围,只要访问它们引用的官方API文档。建议的技术识别教程中提到的每个API,并将其映射到官方文档中相应的API元素。本教程的版本是通过组合提到的所有组成API的版本范围来确定的。基于API提及的不同粒度级别和不同的问题约束,我们的技术的精度从61%到89%不等,召回率从42%到84%不等。我们观察到,由于方法重载,API方法最难以准确地消除歧义。由于教程中提到的API通常是冗余的,并且每次提到特定的API元素通常在教程中出现几次,因此预测版本范围与真实版本范围的距离很低:在我们的示例教程中,平均为3.61。
Online tutorials are a valuable source of community‐created information used by numerous developers to learn new APIs and techniques. Once written, tutorials are rarely actively curated and can become dated over time. Tutorials often reference APIs that change rapidly, and deprecated classes, methods, and fields can render tutorials inapplicable to newer releases of the API. Newer tutorials may not be compatible with older APIs that are still in use.In this paper, we first empirically study the tutorial versioning problem, confirming its presence in popular tutorials on the Web. We subsequently propose a technique, based on similar techniques in the literature, for automatically detecting the applicable API version ranges of tutorials, given access to the official API documentation they reference. The proposed technique identifies each API mention in a tutorial and maps the mention to the corresponding API element in the official documentation. The version of the tutorial is determined by combining the version ranges of all of the constituent API mentions. Our technique's precision varies from 61% to 89% and recall varies from 42% to 84% based on different levels of granularity of API mentions and different problem constraints. We observe API methods are the most challenging to accurately disambiguate due to method overloading. As the API mentions in tutorials are often redundant, and each mention of a specific API element commonly occurs several times in a tutorial, the distance of the predicted version range from the true version range is low: 3.61 on average for the tutorials in our sample.