DeepDir: a deep learning approach for API directive detection

  • PDF / 160,635 Bytes
  • 3 Pages / 595 x 842 pts (A4) Page_size
  • 70 Downloads / 227 Views

DOWNLOAD

REPORT


. LETTER .

September 2021, Vol. 64 199102:1–199102:3 https://doi.org/10.1007/s11432-019-1520-6

DeepDir: a deep learning approach for API directive detection Jingxuan ZHANG1,2,3* , He JIANG4 , Shuai LU5 , Ge LI5 & Xin CHEN3,6 1

College of Computer Science and Technology, Nanjing University of Aeronautics and Astronautics, Nanjing 210016, China; 2 State Key Laboratory for Novel Software Technology, Nanjing University, Nanjing 210023, China; 3 Key Laboratory of Complex Systems Modeling and Simulation, Ministry of Education, Hangzhou 310018, China; 4 School of Software, Dalian University of Technology, Dalian 116024, China; 5 School of Electronic Engineering and Computer Science, Peking University, Beijing 100871, China; 6 School of Computer Science and Technology, Hangzhou Dianzi University, Hangzhou 310018, China Received 30 April 2019/Accepted 20 July 2019/Published online 24 November 2020

Citation Zhang J X, Jiang H, Lu S, et al. DeepDir: a deep learning approach for API directive detection. Sci China Inf Sci, 2021, 64(9): 199102, https://doi.org/10.1007/s11432-019-1520-6

Dear editor, Software developers tend to reuse existing libraries to facilitate their development process and implement certain functionalities by invoking application programming interfaces (APIs) [1]. However, it remains a challenging task for developers to correctly use APIs [2], so they often consult API learning resources [3, 4]. As one of the most important API learning resources, API specifications (also known as API references) detail the instructions on legal API usages with different types of knowledge [1], e.g., functionalities, concepts, and code samples. Out of these knowledge types, developers should particularly pay attention to API directives, i.e., the natural language statements to describe clear constraints or guidelines that developers should be aware of when programming with APIs [5]. Once API directives are neglected, fatal development and performance bugs may be easily produced in programming. Hence, it could be ideal if API directives can be automatically detected. Monperrus et al. [5] proposed an approach to resolve the task of automatically detecting API directives in API specifications by leveraging a set of syntactic patterns. However, this approach simply treats API specifications as bags-ofwords and lacks a deep semantic understanding of API specifications. The drawbacks of the bags-of-words assumption in the existing approach motivate us to shift our attention to deep learning models. Deep learning models can obtain a deep understanding of high-level semantics for natural language in two aspects. On the one hand, they can learn the distributional representations of words. Two words with similar semantics are close to each other in the semantic space, so they have a similar effect on deep learning models [6]. On the other hand, deep learning models can distinguish semantic differences between sentences with different word sequences. Hence, sentences with similar word sequences usually achieve similar results in d