Abstract

Although the use of APIs (Application Programming Interfaces) in software program development can effectively improve development efficiency, developers still need to spend more time in finding suitable APIs. To improve the overall development efficiency, many API recommendation approaches have been proposed. However, they could not make good use of the information in the source code, especially for the structural information. The PDG (Program Dependence Graph) of source code can contain both syntactic and structural information, which can be great representations of the source code. Based on the PDG, we propose a new approach, called JARST (Java API Recommendation combining Structural with Textual code information), which recommends the appropriate APIs by analyzing the structure information and text information of the source code. The JARST approach uses a graph neural network to learn source code structure information of PDG and uses a multi-modal approach to learn the text information in the source code. Finally, we combine the structural and textual information of the source code to implement API recommendations. We collect 625 open source Java projects from Github as our experimental objects. The experimental results show that JARST can provide accurate APIs to help software developers facilitate development activities. Moreover, it performs better than the cutting-edge studies including APIRes-CST and APIREC with higher top-k accuracy values. In detail, the improvement achieves up to 35.3%.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call