arrow
Return

Generative API usage code recommendation with parameter concretization

delete2019-07-30
delete11
PRE
AI
C
Chi Chen
X
Xin Peng *
孙俊 cover
孙俊 (Jun Sun)
Z
Zhenchang Xing
王新 (Xin Wang)
Y
Yifan Zhao
张海蕊 cover
张海蕊 (Hairui Zhang)
DOI:10.1007/s11432-018-9821-9delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Many programming languages and development frameworks have extensive libraries (e.g., JDK and Android libraries) that ease the task of software engineering if used effectively. With numerous library classes and sometimes intricate API (application programming interface) usage constraints, programmers often have difficulty remembering the library APIs and/or using them correctly. This study addresses this problem by developing an engine called DeepAPIRec, which automatically recommends the API usage code. Compared to the existing proposals, our approach distinguishes itself in two ways. First, it is based on a tree-based long short-term memory (LSTM) neural network inspired by recent developments in the machine-learning community. A tree-based LSTM neural network allows us to model and reason about variable-length, preceding and succeeding code contexts, and to make precise predictions. Second, we apply data-flow analysis to generate concrete parameters for the API usage code, which not only allows us to generate complete code recommendations but also improves the accuracy of the learning results according to the tree-based LSTM neural network. Our approach has been implemented for supporting Java programs. Our experimental studies on the JDK library show that at statement-level recommendations, DeepAPIRec can achieve a top-1 accuracy of about 37% and a top-5 accuracy of about 64%, which are significantly better than the existing approaches. Our user study further confirms that DeepAPIRec can help developers to complete a segment of code faster and more accurately as compared to IntelliJ IDEA.
Keywords:
code recommendation
API
deep learning
data dependency
parameter concretization
AI Summary

AI Summary

Key information extracted from the uploaded paper, including a brief overview, abstract, background, key highlights, visual analysis, and future outlook.

Journal

Science China Information Sciences cover
Science China Information Sciences
IF:
7.6
Papers:
4.9K
Citations:
8.9K

Organization

F
fudan university
Scholars:
11.8W
Papers: 7.7W
Citations: 121
A
Australian National University
Scholars:
2.1W
Papers: 2.3W
Citations: 3.9W
Cited Papers

Cited Papers

err
IF0
err
err0
PREAI
err
errShare
errSave
err
IF0
err
err0
PREAI
err
errShare
errSave
LogPruner: detect, analyze and prune logging calls in Android apps
err2018-04-18
err6
PREAI
errZhou, Xin; Wu, Kaidong; Cai, Huaqian; Lou, Shuai; Zhang, Ying; Huang, Gang
errShare
errSave
researcher View more