Publication in conference proceedings
Exploring APIs with N-gram language models
Gonçalo Prendi (Prendi, G.); Hugo Sousa (Sousa, H.); André Santos (Santos, A. L.); Ricardo Ribeiro (Ribeiro, R.);
INFORUM 2015: Atas do 7.o Simpósio Nacional de Informática
Year (definitive publication)
2015
Language
English
Country
Portugal
More Information
Web of Science®

Times Cited: 0

(Last checked: 2026-04-13 03:57)

View record in Web of Science®

Scopus

This publication is not indexed in Scopus

Google Scholar

Times Cited: 1

(Last checked: 2026-04-11 22:47)

View record in Google Scholar

This publication is not indexed in Overton

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
APIs,Java,Perplexity,Source code mining,Code completion,N-gram language models