Exploring APIs with N-gram Language Models
Event Title
INFORUM 2015
Year (definitive publication)
2015
Language
English
Country
Portugal
More Information
--
Abstract
Software development requires the use of external Application Programming Interfaces (APIs) in order to reuse libraries and frameworks. Programmers often struggle with unfamiliar APIs. Such difficulties often lead to an incorrect sequence of API calls that may not produce the desired outcome. Language models have shown the ability to capture regularities in text as well as in code. In this paper we explore the use of n-gram language models and their ability to capture regularities in APIs. We explored some of the most widely used APIs with the Java programming language, training several language models over hundreds of GitHub Java projects that use these APIs. The evaluation shows perplexity values for these language models that hint the possibility of using them to produce a tool to assist developers with code completion when using an unfamiliar API. On the one hand, such a tool may help developers to write correct API call sequences more efficiently; and, on the other hand, allows them to explore the features offered by the API.
Acknowledgements
--
Keywords
Português