Litcius/Paper detail

API Usage Recommendation Via Multi-View Heterogeneous Graph Representation Learning

Yujia Chen, Cuiyun Gao, Xiaoxue Ren, Yun Peng, Xin Xia, Michael R. Lyu

2023IEEE Transactions on Software Engineering34 citationsDOI

Abstract

Developers often need to decide which APIs to use for the functions being implemented. With the ever-growing number of APIs and libraries, it becomes increasingly difficult for developers to find appropriate APIs, indicating the necessity of automatic API usage recommendation. Previous studies adopt statistical models or collaborative filtering methods to mine the implicit API usage patterns for recommendation. However, they rely on the occurrence frequencies of APIs for mining usage patterns, thus prone to fail for the low-frequency APIs. Besides, prior studies generally regard the API call interaction graph as homogeneous graph, ignoring the rich information (e.g., edge types) in the structure graph. In this work, we propose a novel method named <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">MEGA</i> for improving the recommendation accuracy especially for the low-frequency APIs. Specifically, besides <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">call interaction graph</i> , MEGA considers another two new heterogeneous graphs: <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">global API co-occurrence graph</i> enriched with the API frequency information and <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">hierarchical structure graph</i> enriched with the project component information. With the three multi-view heterogeneous graphs, MEGA can capture the API usage patterns more accurately. Experiments on three Java benchmark datasets demonstrate that MEGA significantly outperforms the baseline models by at least 19% with respect to the Success Rate@1 metric. Especially, for the low-frequency APIs, MEGA also increases the baselines by at least 55% regarding the Success Rate@1 score.

Topics & Concepts

Computer scienceJavaGraphInformation retrievalTheoretical computer scienceProgramming languageWeb Data Mining and AnalysisSoftware Engineering ResearchSoftware System Performance and Reliability
API Usage Recommendation Via Multi-View Heterogeneous Graph Representation Learning | Litcius