arrow
Return

Learning to rank code examples for code search engines

delete2016-01-21
delete56
PRE
AI
H
Haoran Niu *
I
Iman Keivanloo
Y
Ying Zou
DOI:10.1007/s10664-015-9421-5delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
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.
Keywords:
Learning to rank
Code example
Code search
Code recommendation
AI Summary

AI Summary

Key information extracted from the uploaded paper, including a brief overview, abstract, background, key highlights, visual analysis, and future outlook.

Journal

Empirical Software Engineering cover
Empirical Software Engineering
IF:
3.6
Papers:
2.0K
Citations:
5.3K

Organization

Q
queens university - canada
Scholars:
1.8W
Papers: 1.7W
Citations: 29
Cited Papers

Cited Papers

Dandruff and Seborrhea
err1938-04-01
err0
errOAAI
errGeorge M. MacKee; George M. Lewis
errShare
errSave
Neuroscience research in Africa: Current status
err2016-06-01
err0
errOAAI
errFoad Abd-Allah; Najib Kissani; Anthony William; Mohammed Ibrahim Oraby; Ramez Reda Moustafa; Ehab Shaker; Mohamed Soliman El-Tamawy; Raad Shakir
errShare
errSave
errShare
errSave
err
IF0
err
err0
PREAI
err
errShare
errSave
errShare
errSave
VECTOR-SPACE MODEL FOR AUTOMATIC INDEXING
err1975-11-01
err4.8K
errOAAI
errSALTON, G; WONG, A; YANG, CS
errShare
errSave
researcher View more