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

重新审视、基准测试和探索API建议:我们还有多远?

Revisiting, Benchmarking and Exploring API Recommendation: How Far Are We?

Yun Peng, Shuqing Li, Wenwei Gu, Yichen Li, Wenxuan Wang, Cuiyun Gao, Michael Lyu

摘要:

应用程序编程接口(API)将特定功能的实现封装为接口,极大地提高了现代软件开发的效率。随着API的大量涌现,开发人员很难熟悉所有的API,通常需要寻找合适的API来使用。因此,大量的努力已经投入到改进API推荐任务中。然而,由于缺乏统一的任务定义和标准化基准,越来越难以衡量新模式的业绩。例如,一些研究将该任务视为代码完成问题;而另一些研究则建议使用自然语言查询的相关API。为了减少挑战并更好地促进未来的研究,在本文中,我们重新审视了API推荐任务,并旨在对这些方法进行基准测试。具体而言,本文根据任务定义将方法分为两类,即,基于查询的API推荐和基于代码的API推荐。我们研究了11个最近提出的方法以及4个广泛使用的IDE。一个基准命名为APIBench,然后建立两个各自类别的方法。基于APIBench,我们提取了一些可操作的见解和API推荐的挑战。我们还获得了一些建议和方向,提高推荐API的性能,包括数据源选择,适当的查询重构,低资源设置,跨领域自适应。

英文摘要:

Application Programming Interfaces (APIs), which encapsulate the implementation of specific functions as interfaces, greatly improve the efficiency of modern software development. As numbers of APIs spring up nowadays, developers can hardly be familiar with all the APIs, and usually need to search for appropriate APIs for usage. So lots of efforts have been devoted to improving the API recommendation task. However, it has been increasingly difficult to gauge the performance of new models due to the lack of a uniform definition of the task and a standardized benchmark. For example, some studies regard the task as a code completion problem; while others recommend relative APIs given natural language queries. To reduce the challenges and better facilitate future research, in this paper, we revisit the API recommendation task and aim at benchmarking the approaches. Specifically, the paper groups the approaches into two categories according to the task definition, i.e., query-based API recommendation and code-based API recommendation. We study 11 recently-proposed approaches along with 4 widely-used IDEs. One benchmark named as APIBench is then built for the two respective categories of approaches. Based on APIBench, we distill some actionable insights and challenges for API recommendation. We also achieve some implications and directions for improving the performance of recommending APIs, including data source selection, appropriate query reformulation, low resource setting, and cross-domain adaptation.

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

↑