一句话:提出 KGE4AR,用统一 API 知识图谱及其嵌入表示实现可扩展的类比 API 推荐,显著优于现有方法。
库迁移需要用不同库替换现有库并保持软件行为不变,其关键步骤是为目标功能找到类比 API;由于库与 API 数量庞大,人工查找耗时且易错。已有的自动化类比 API 推荐技术(尤其是基于文档的方法)存在文档语义理解不完整与可扩展性差的问题。本文提出 KGE4AR,一种基于文档、使用知识图谱(KG)嵌入的类比 API 推荐方法。它引入统一的 API 知识图谱,全面表示文档知识并捕获高层语义,随后将该统一 API 知识图谱嵌入为向量,以支持高效、可扩展的相似度计算。作者在 35,773 个 Java 库上分「有目标库」与「无目标库」两种场景进行评估,KGE4AR 明显优于当前最优技术,MRR 分别提升 47.1%–143.0% 与 11.7%–80.6%,并展现出随库数量增长的可扩展性。
Library migration, which replaces the current library with a different one to retain the same software behavior, is common in software evolution. An essential part of this is finding an analogous API for the desired functionality. However, due to the multitude of libraries/APIs, manually finding such an API is time-consuming and error-prone. Researchers created automated analogical API recommendation techniques, notably documentation-based methods. Despite potential, these methods have limitations, e.g., incomplete semantic understanding in documentation and scalability issues. In this study, we present KGE4AR, a novel documentation-based approach using knowledge graph (KG) embedding for recommending analogical APIs during library migration. KGE4AR introduces a unified API KG to comprehensively represent documentation knowledge, capturing high-level semantics. It further embeds this unified API KG into vectors for efficient, scalable similarity calculation. We assess KGE4AR with 35,773 Java libraries in two scenarios, with and without target libraries. KGE4AR notably outperforms state-of-the-art techniques (e.g., 47.1%-143.0% and 11.7%-80.6% MRR improvements), showcasing scalability with growing library counts.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{abs-2308-11422,
title = {Recommending Analogical APIs via Knowledge Graph Embedding},
author = {Mingwei Liu and Yanjun Yang and Yiling Lou and Xin Peng and Zhong Zhou and Xueying Du and Tianyong Yang},
booktitle = {FSE},
year = {2023},
doi = {10.1145/3611643.3616305}
}