API Method Recommendation without Worrying about the Task-API Knowledge Gap

被引:160
作者
Huang, Qiao [1 ]
Xia, Xin [2 ]
Xing, Zhenchang [3 ]
Lo, David [4 ]
Wang, Xinyu [1 ]
机构
[1] Zhejiang Univ, Hangzhou, Peoples R China
[2] Monash Univ, Clayton, Vic, Australia
[3] Australian Natl Univ, Canberra, ACT, Australia
[4] Singapore Management Univ, Singapore, Singapore
来源
PROCEEDINGS OF THE 2018 33RD IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMTED SOFTWARE ENGINEERING (ASE' 18) | 2018年
关键词
API Recommendation; API Documentation; Stack Overflow; Word Embedding; SEARCH;
D O I
10.1145/3238147.3238191
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Developers often need to search for appropriate APIs for their programming tasks. Although most libraries have API reference documentation, it is not easy to find appropriate APIs due to the lexical gap and knowledge gap between the natural language description of the programming task and the API description in API documentation. Here, the lexical gap refers to the fact that the same semantic meaning can be expressed by different words, and the knowledge gap refers to the fact that API documentation mainly describes API functionality and structure but lacks other types of information like concepts and purposes, which are usually the key information in the task description. In this paper, we propose an API recommendation approach named BIKER (Li-Information source based KnowledgE Recommendation) to tackle these two gaps. To bridge the lexical gap, BIKER uses word embedding technique to calculate the similarity score between two text descriptions. Inspired by our survey findings that developers incorporate Stack Overflow posts and API documentation for bridging the knowledge gap, BIKER leverages Stack Overflow posts to extract candidate APIs for a program task, and ranks candidate APIs by considering the query's similarity with both Stack Overflow posts and API documentation. It also summarizes supplementary information (e.g., API description, code examples in Stack Overflow posts) for each API to help developers select the APIs that are most relevant to their tasks. Our evaluation with 413 API-related questions confirms the effectiveness of BIKER for both class-and method-level API recommendation, compared with state-of-the-art baselines. Our user study with 28 Java developers further demonstrates the practicality of BIKER for API search.
引用
收藏
页码:293 / 304
页数:12
相关论文
共 51 条
[1]  
Allamanis M, 2015, PR MACH LEARN RES, V37, P2123
[2]   Combining Deep Learning with Information Retrieval to Localize Buggy Files for Bug Reports [J].
An Ngoc Lam ;
Anh Tuan Nguyen ;
Hoan Anh Nguyen ;
Nguyen, Tien N. .
2015 30TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE), 2015, :476-481
[3]   Statistical Translation of English Texts to API Code Templates [J].
Anh Tuan Nguyen ;
Rigby, Peter C. ;
Thanh Van Nguyen ;
Karanfil, Mark ;
Nguyen, Tien N. .
PROCEEDINGS OF THE 2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING COMPANION (ICSE-C 2017), 2017, :331-333
[4]  
[Anonymous], 2018, DEEPAPIS ONLINE DEMO
[5]  
[Anonymous], 2018, RACKS DATASET TOOL D
[6]  
[Anonymous], 2017, STACK OVERFLOW DATA
[7]  
[Anonymous], 2007, Encyclopedia of measurement and statistics, DOI [DOI 10.4135/9781412952644, 10.4135/9781412952644]
[8]  
[Anonymous], P ACL 2004 INT POST
[9]  
[Anonymous], 2018, STACK OVERFLOW QUEST
[10]  
[Anonymous], 2017, JAVA SE 8 API DOCUME