Publication Type

Conference Proceeding Article

Version

acceptedVersion

Publication Date

2-2020

Abstract

Nowadays, developers use APIs to implement their applications. To know how to use an API, developers may search for code examples that use the API in repositories such as GitHub. Although code search engines have been developed to help developers perform such search, these engines typically only accept a query containing the description of the task that needs to be implemented or the names of the APIs that the developer wants to use without the capability for the developer to specify particular search constraints, such as the class and parameter types that the relevant API should take. These engines are not designed for cases when the specific API and its types to search are known and the developers want code examples that show how the specific API is used, and therefore, their search results are often too inaccurate. In this work, we propose a tool, named AUSearch, to fill this gap. Given an API query that allows type constraints, AUSearch finds code examples in GitHub that contain usages of the specific APIs in the query. AUSearch performs type resolutions to ensure that the API usages found in the returned files are indeed invocations of the APIs specified in the query and highlights the relevant lines of code in the files for easier reference. We show that AUSearch is much more accurate than GitHub Code Search. A video demonstrating our tool is available from https://youtu.be/DKiGal5bSkU.

Keywords

API usage, code search, GitHub, type resolution

Discipline

Software Engineering

Research Areas

Software and Cyber-Physical Systems

Publication

2020 27th IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER): 18-21 February, Ontario, Canada: Proceedings

First Page

637

Last Page

641

ISBN

9781728151434

Identifier

10.1109/SANER48275.2020.9054809

Publisher

IEEE

City or Country

Piscataway, NJ

Copyright Owner and License

Authors

Additional URL

https://doi.org/10.1109/SANER48275.2020.9054809

Share

COinS