Research on API Sequence Recommendation Based on Code Property Graph
The utilization of APIs not only enhances software reusability but also improves development efficiency and reduces costs. However, with the continuous increase in the number of APIs, developers face difficulties in quickly recalling and comprehending the appropriate API call sequences and their constraints. Thus, there is a need for an efficient API sequence recommendation tool. The key task in achieving efficient API sequence recommendation is to understand the semantic structure of the code context. However, most researchers currently lack an analysis of program structure in API sequence recommendation studies, leading to a decrease in the accuracy of these tools. To achieve a deeper understanding of the semantic context of code, this paper employs semantic syntax information and incorporates control structure information to improve the accuracy of API sequence recommendations. Specifically, this study first employs early fusion techniques based on the abstract syntax tree to incorporate control flow edges and data dependency edges—two types of heterogeneous edges—to construct a new representation of code known as a code property graph. This graph is then used to analyze the semantic syntax information and control structures of the code. Subsequently, a relational graph attention network model is employed to analyze the code property graph. Experimental results indicate that the accuracy of API sequence recommendations significantly improves with the incorporation of code control structures.
Authors
- Xun-Jiang Luo (ORCID: https://orcid.org/0009-0007-3837-025X)
Institutions
- Ningbo University (CN)
Publication Details
- Published
- 2024-11-01
- DOI
- https://doi.org/10.1109/iccbd-ai65562.2024.00058
- Primary Topic
- Web Data Mining and Analysis
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Ministry of Education
- Natural Science Foundation of Zhejiang Province