个人信息Personal Information
教授
博士生导师
硕士生导师
主要任职:软件学院、大连理工大学-立命馆大学国际信息与软件学院副院长
性别:男
毕业院校:北陆先端科学技术大学院大学
学位:博士
所在单位:软件学院、国际信息与软件学院
学科:软件工程
办公地点:综合楼525
联系方式:0411-62274401
电子邮箱:wqkong@dlut.edu.cn
ROSF: Leveraging Information Retrieval and Supervised Learning for Recommending Code Snippets
点击次数:
论文类型:期刊论文
发表时间:2019-01-01
发表刊物:IEEE TRANSACTIONS ON SERVICES COMPUTING
收录刊物:SCIE、EI
卷号:12
期号:1
页面范围:34-46
ISSN号:1939-1374
关键字:Code snippets recommendation; information retrieval; supervised learning; topic model; feature
摘要:When implementing unfamiliar programming tasks, developers commonly search code examples and learn usage patterns of APIs from the code examples or reuse them by copy-pasting and modifying. For providing high-quality code examples, previous studies present several methods to recommend code snippets mainly based on information retrieval. In this paper, to provide better recommendation results, we propose ROSF, Recommending code Snippets with multi-aspect Features, a novel method combining both information retrieval and supervised learning. In our method, we recommend Top-K code snippets for a given free-formquery based on two stages, i.e., coarse-grained searching and fine-grained re-ranking. First, we generate a code snippet candidate set by searching a code snippet corpus using an information retrieval method. Second, we predict probability values of the code snippets for different relevance scores in the candidate set by the learned prediction model from a training set, re-rank these candidate code snippets according to the probability values, and recommend the final results to developers. We conduct several experiments to evaluate our method in a large- scale corpus containing 921,713 real-world code snippets. The results show that ROSF is an effective method for code snippets recommendation and outperforms the-state-of-the-art methods by 20-41 percent in Precision and 13-33 percent in NDCG.