Context-aware API recommendation using tensor factorization

被引:0
作者
Yu ZHOU [1 ,2 ]
Chen CHEN [1 ]
Yongchao WANG [1 ]
Tingting HAN [3 ]
Taolue CHEN [3 ,2 ]
机构
[1] College of Computer Science and Technology, Nanjing University of Aeronautics and Astronautics
[2] State Key Laboratory for Novel Software Technology, Nanjing University
[3] Birkbeck, University of London
关键词
D O I
暂无
中图分类号
TP391.3 [检索机];
学科分类号
081203 ; 0835 ;
摘要
An activity constantly engaged by most programmers in coding is to search for appropriate application programming interfaces(APIs). Contextual information is widely recognized to play a crucial role in effective API recommendation, but it is largely overlooked in practice. In this paper, we propose contextaware API recommendation using tensor factorization(CARTF), a novel API recommendation approach in considering programmers' working context. To this end, we use tensors to explicitly represent the queryAPI-context triadic relation. When a new query is made, CARTF harnesses word embeddings to retrieve similar user queries, based on which a third-order tensor is constructed. CARTF then applies non-negative tensor factorization to complete missing values in the tensor and the Smith-Waterman algorithm to identify the most matched context. Finally, the ranking of the candidate APIs can be derived based on which API sequences are recommended. Our evaluation confirms the effectiveness of CARTF for class-level and method-level API recommendations, outperforming state-of-the-art baseline approaches against a number of performance metrics, including SuccessRate, Precision, and Recall.
引用
收藏
页码:78 / 93
页数:16
相关论文
共 9 条
[1]   Boosting API Recommendation With Implicit Feedback [J].
Zhou, Yu ;
Yang, Xinying ;
Chen, Taolue ;
Huang, Zhiqiu ;
Ma, Xiaoxing ;
Gall, Harald .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2022, 48 (06) :2157-2172
[2]   Recommending APIs for API Related Questions in Stack Overflow [J].
Zhang, Jingxuan ;
Jiang, He ;
Ren, Zhilei ;
Chen, Xin .
IEEE ACCESS, 2018, 6 :6205-6219
[3]  
API usage pattern recommendation for software development[J] . Haoran Niu,Iman Keivanloo,Ying Zou.The Journal of Systems & Software . 2016
[4]  
Exemplar: A Source Code Search Engine for Finding Highly Relevant Applications[J] . McMillan, Collin,Grechanik, Mark,Poshyvanyk, Denys,Fu, Chen,Xie, Qing.IEEE Transactions on Software Engineering . 2012 (5)
[5]  
Natural Language Processing (almost) from Scratch[J] . Ronan Collobert,Jason Weston,Léon Bottou,Michael Karlen,Koray Kavukcuoglu,Pavel P. Kuksa.CoRR . 2011
[6]   Recommendation Systems for Software Engineering [J].
Robillard, Martin P. ;
Walker, Robert J. ;
Zimmermann, Thomas .
IEEE SOFTWARE, 2010, 27 (04) :80-86
[7]  
Approximate Structural Context Matching: An Approach to Recommend Relevant Examples[J] . Holmes R.,Walker R.J.,Murphy G.C..IEEE Transactions on Software Engineering . 2006 (12)
[8]  
Leveraging Crowd Knowledge for Software Comprehension and Development. Ponzanelli L,Bacchelli A,Lanza M. Software Maintenance and Reengineering (CSMR),2013 17th European Conference on . 2013
[9]  
Combining deep learning with information retrieval to localize buggy files for bug reports. LAM A N,NGUYEN A,NGUYEN H,etal. IEEE/ACM International Conference on Automated Software Engineering . 2015