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

Q-ARE:基于查询的API推荐评估数据集

Q-ARE: An Evaluation Dataset for Query Based API Recommendation

College of Computer Science and Technology, National University of Defense Technology(国防科技大学计算机学院);State Key Laboratory of Complex & Critical Software Environment(复杂与关键软件环境国家重点实验室)

Shenglong Wu, Xunhui Zhang, Tao Wang

AI总结:

本文构建了Q-ARE数据集,用于评估基于查询的API推荐方法的语义理解能力,通过分析开源Java项目的方法调用链,引入API调用深度和调用密度两个指标,评估现有方法在多级调用结构中的表现。

摘要:

随着软件系统规模的扩大,开发者在众多选项中选择合适的API变得更加困难。高效识别满足功能需求的API成为关键挑战。为评估现有基于查询的API推荐方法的语义理解能力,本文构建了Q-ARE数据集,基于GitHub上的开源Java项目。通过分析方法及其调用链,识别直接或间接被目标方法调用的第三方API,并递归扩展多级调用以统一层次结构为API推荐目标集。此外,我们引入了两个指标:API调用深度,衡量查询方法与目标API之间的调用距离,以及调用密度,量化调用链中与目标API相关的代码行比例。基于Q-ARE,我们系统评估了几种基于查询的API推荐方法和通用大语言模型。结果表明,随着API调用深度增加和调用密度下降,性能显著下降,表明现有方法仍难以处理多级方法调用结构。Q-ARE及其指标为评估API推荐中的语义理解提供了新基准,并为改进未来算法提供了见解。

英文摘要:

As software systems grow in scale, developers face increasing difficulty in selecting appropriate Application Programming Interfaces (APIs) from numerous options. Efficiently identifying APIs that satisfy functional requirements has become a key challenge. To evaluate the semantic understanding of existing query-based API recommendation methods, this paper constructs Q-ARE (Query-based API Recommendation Evaluation), a dataset based on open-source Java projects from GitHub. Methods and their invocation chains are analyzed to identify third-party APIs directly or indirectly invoked by target methods, recursively expanding multi-level invocations to unify hierarchical call structures into API recommendation target sets. Furthermore, we introduce two metrics: API Call Depth, measuring the invocation distance between a query method and a target API, and Invocation Density, quantifying the proportion of code lines associated with the target API in the invocation chain. Based on Q-ARE, we systematically evaluate several query-based API recommendation methods and general Large Language Models (LLMs). Results show that performance drops significantly as API Call Depth increases and invocation density decreases, indicating that existing methods still struggle with multi-level method invocation structures. Q-ARE and its metrics provide a new benchmark for assessing semantic understanding in API recommendation and offer insights for improving future algorithms.

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

↑