Artigo Revisado por pares

IECS: Intent-Enforced Code Search via Extended Boolean Model

2017; IOS Press; Volume: 33; Issue: 4 Linguagem: Inglês

10.3233/jifs-161994

ISSN

1875-8967

Autores

Yangrui Yang, Qing Huang,

Tópico(s)

Web Data Mining and Analysis

Resumo

Most code search tools seem to yield semantically correct matches, but the search results rarely meet the demands of users perfectly. These results still have to be modified manually. One major reason is that existing tools lack the ability of intent predicting to guess what else a user might do af ter obtaining the results. In this paper, we propose an intent-enforced code search approach (IECS) that can predict the potential intents for a query before performing code retrieval. Then it expands the query with the intents and applies the Extended Boolean Model to retrieve the relevant results without any subsequent modification. We implement SnippetGen, a code search tool performing IECS. Compared with CodeHow and Google Code Search (CS), SnippetGen outperforms them by 28.5% with a precision score of 0.846 (i.e., 84.6% of the first returned results are relevant results) when we utilize these tools to perform 70 queries on a codebase consisting of 27K projects downloaded from GitHub. We also perform a controlled experiment by asking 20 participants to complete 3 tasks with SnippetGen and CodeHow. The results confirm the effectiveness of SnippetGen in programming practice.

Referência(s)