用户名: 密码: 验证码:
Learning to rank code examples for code search engines
详细信息    查看全文
  • 作者:Haoran Niu ; Iman Keivanloo ; Ying Zou
  • 关键词:Learning to rank ; Code example ; Code search ; Code recommendation
  • 刊名:Empirical Software Engineering
  • 出版年:2017
  • 出版时间:February 2017
  • 年:2017
  • 卷:22
  • 期:1
  • 页码:259-291
  • 全文大小:
  • 刊物类别:Computer Science
  • 刊物主题:Software Engineering/Programming and Operating Systems; Programming Languages, Compilers, Interpreters;
  • 出版者:Springer US
  • ISSN:1573-7616
  • 卷排序:22
文摘
Source code examples are used by developers to implement unfamiliar tasks by learning from existing solutions. To better support developers in finding existing solutions, code search engines are designed to locate and rank code examples relevant to user’s queries. Essentially, a code search engine provides a ranking schema, which combines a set of ranking features to calculate the relevance between a query and candidate code examples. Consequently, the ranking schema places relevant code examples at the top of the result list. However, it is difficult to determine the configurations of the ranking schemas subjectively. In this paper, we propose a code example search approach that applies a machine learning technique to automatically train a ranking schema. We use the trained ranking schema to rank candidate code examples for new queries at run-time. We evaluate the ranking performance of our approach using a corpus of over 360,000 code snippets crawled from 586 open-source Android projects. The performance evaluation study shows that the learning-to-rank approach can effectively rank code examples, and outperform the existing ranking schemas by about 35.65 % and 48.42 % in terms of normalized discounted cumulative gain (NDCG) and expected reciprocal rank (ERR) measures respectively.

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700