Context-aware API recommendation using tensor factorization

被引:0
作者
Yu Zhou
Chen Chen
Yongchao Wang
Tingting Han
Taolue Chen
机构
[1] Nanjing University of Aeronautics and Astronautics,College of Computer Science and Technology
[2] University of London,Birkbeck
[3] Nanjing University,State Key Laboratory for Novel Software Technology
来源
Science China Information Sciences | 2023年 / 66卷
关键词
API recommendation; tensor factorization; context awareness; word embedding; intelligent software development;
D O I
暂无
中图分类号
学科分类号
摘要
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 context-aware 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 query-API-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.
引用
收藏
相关论文
共 23 条
  • [1] Robillard M P(2010)Recommendation systems for software engineering IEEE Softw 27 80-86
  • [2] Walker R J(2017)Tensor methods and recommender systems WIREs Data Min Knowl Discov 7 e1201-2537
  • [3] Zimmermann T(2011)Natural language processing (almost) from scratch J Mach Learn Res 12 2493-1087
  • [4] Frolov E(2012)Exemplar: a source code search engine for finding highly relevant applications IEEE Trans Software Eng 38 1069-6219
  • [5] Oseledets I(2018)Recommending APIs for API related questions in stack overflow IEEE Access 6 6205-2172
  • [6] Collobert R(2022)Boosting API recommendation with implicit feedback IIEEE Trans Software Eng 48 2157-970
  • [7] Weston J(2006)Approximate structural context matching: an approach to recommend relevant examples IEEE Trans Software Eng 32 952-139
  • [8] Bottou L(2017)API usage pattern recommendation for software development J Syst Software 129 127-undefined
  • [9] McMillan C(undefined)undefined undefined undefined undefined-undefined
  • [10] Grechanik M(undefined)undefined undefined undefined undefined-undefined