Publication Type

Conference Proceeding Article

Version

acceptedVersion

Publication Date

11-2015

Abstract

Over the years of software development, a vast amount of source code has been accumulated. Many code search tools were proposed to help programmers reuse previously-written code by performing free-text queries over a large-scale codebase. Our experience shows that the accuracy of these code search tools are often unsatisfactory. One major reason is that existing tools lack of query understanding ability. In this paper, we propose CodeHow, a code search technique that can recognize potential APIs a user query refers to. Having understood the potentially relevant APIs, CodeHow expands the query with the APIs and performs code retrieval by applying the Extended Boolean model, which considers the impact of both text similarity and potential APIs on code search. We deploy the backend of CodeHow as a Microsoft Azure service and implement the front-end as a Visual Studio extension. We evaluate CodeHow on a large-scale codebase consisting of 26K C# projects downloaded from GitHub. The experimental results show that when the top 1 results are inspected, CodeHow achieves a precision score of 0.794 (i.e., 79.4% of the first returned results are relevant code snippets). The results also show that CodeHow outperforms conventional code search tools. Furthermore, we perform a controlled experiment and a survey of Microsoft developers. The results confirm the usefulness and effectiveness of CodeHow in programming practices.

Keywords

API understanding, Code search, Extended Boolean model, Software reuse

Discipline

Computer Sciences | Programming Languages and Compilers | Software Engineering

Publication

2015 30th IEEE/ACM International Conference on Automated Software Engineering, ASE: Lincoln, NE, November 9-13: Proceedings

First Page

260

Last Page

270

ISBN

9781509000258

Identifier

10.1109/ASE.2015.42

Publisher

IEEE

City or Country

Piscataway, NJ

Embargo Period

10-6-2019

Copyright Owner and License

Authors

Additional URL

https://doi.org/10.1109/ASE.2015.42

Share

COinS