Query expansion based on statistical learning from code changes
Authors:
- 27 February 2018
- journal article
- research article
- Published by Wiley in Software: Practice and Experience
- Vol. 48 (7) , 1333-1351
Abstract
Summary: Thesaurus‐based, code‐related, and software‐specific query expansion techniques are the main contributions in free‐form query search. However, these techniques still could not put the most relevant query result in the first position because they lack the ability to infer the expansion words that represent the user needs based on a given query. In this paper, we discover that code changes can imply what users want and propose a novel query expansion technique with code changes (QECC). It exploits (changes, contexts) pairs from changed methods. On the basis of statistical learning from pairs, it can infer code changes for a given query. In this way, it expands a query with code changes and recommends the query results that meet actual needs perfectly. In addition, we implement InstaRec to perform QECC and evaluate it with 195 039 change commits from GitHub and our code tracker. The results show that QECC can improve the precision of 3 code search algorithms (ie, IR, Portfolio, and VF) by up to 52% to 62% and outperform the state‐of‐the‐art query expansion techniques (ie, query expansion based on crowd knowledge and CodeHow) by 13% to 16% when the top 1 result is inspected.Keywords
Funding Information
- National Natural Science Foundation of China (61170022, 91118003)
This publication has 35 references indexed in Scilit:
- How developers search for code: a case study2015
- Code completion with statistical language models2014
- CodeHint: dynamic and interactive synthesis of code snippets2014
- SWordNet: Inferring semantically related words from software contextEmpirical Software Engineering, 2013
- Searching connected API subgraph via text phrases2012
- A Survey of Automatic Query Expansion in Information RetrievalACM Computing Surveys, 2012
- Code Reuse in Open Source SoftwareManagement Science, 2008
- CodeGenie2007
- Using natural language program analysis to locate and understand action-oriented concerns2007
- A maximum entropy approach to adaptive statistical language modellingComputer Speech & Language, 1996