Stepwise API usage assistance using n-gram language models

Detalhes bibliográficos
Autor(a) principal: Santos, A. L.
Data de Publicação: 2017
Outros Autores: Prendi, G., Sousa, H., Ribeiro, R.
Tipo de documento: Artigo
Idioma: eng
Título da fonte: Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
Texto Completo: http://hdl.handle.net/10071/14222
Resumo: Reusing software involves learning third-party APIs, a process that is often time-consuming and error-prone. Recommendation systems for API usage assistance based on statistical models built from source code corpora are capable of assisting API users through code completion mechanisms in IDEs. A valid sequence of API calls involving different types may be regarded as a well-formed sentence of tokens from the API vocabulary. In this article we describe an approach for recommending subsequent tokens to complete API sentences using n-gram language models built from source code corpora. The provided system was integrated in the code completion facilities of the Eclipse IDE, providing contextualized completion proposals for Java taking into account the nearest lines of code. The approach was evaluated against existing client code of four widely used APIs, revealing that in more than 90% of the cases the expected subsequent token is within the 10-top-most proposals of our models. The high score provides evidence that the recommendations could help on API learning and exploration, namely through the assistance on writing valid API sentences.
id RCAP_e33bc6cb3395fec54ca973225b9a518c
oai_identifier_str oai:repositorio.iscte-iul.pt:10071/14222
network_acronym_str RCAP
network_name_str Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
repository_id_str 7160
spelling Stepwise API usage assistance using n-gram language modelsAPIUsabilityN-gramsCode completionIDEReusing software involves learning third-party APIs, a process that is often time-consuming and error-prone. Recommendation systems for API usage assistance based on statistical models built from source code corpora are capable of assisting API users through code completion mechanisms in IDEs. A valid sequence of API calls involving different types may be regarded as a well-formed sentence of tokens from the API vocabulary. In this article we describe an approach for recommending subsequent tokens to complete API sentences using n-gram language models built from source code corpora. The provided system was integrated in the code completion facilities of the Eclipse IDE, providing contextualized completion proposals for Java taking into account the nearest lines of code. The approach was evaluated against existing client code of four widely used APIs, revealing that in more than 90% of the cases the expected subsequent token is within the 10-top-most proposals of our models. The high score provides evidence that the recommendations could help on API learning and exploration, namely through the assistance on writing valid API sentences.Elsevier2017-08-01T15:32:07Z2017-01-01T00:00:00Z20172019-03-22T15:13:16Zinfo:eu-repo/semantics/publishedVersioninfo:eu-repo/semantics/articleapplication/pdfhttp://hdl.handle.net/10071/14222eng0164-121210.1016/j.jss.2016.06.063Santos, A. L.Prendi, G.Sousa, H.Ribeiro, R.info:eu-repo/semantics/openAccessreponame:Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)instname:Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informaçãoinstacron:RCAAP2023-11-09T17:46:44Zoai:repositorio.iscte-iul.pt:10071/14222Portal AgregadorONGhttps://www.rcaap.pt/oai/openaireopendoar:71602024-03-19T22:22:34.047201Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos) - Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informaçãofalse
dc.title.none.fl_str_mv Stepwise API usage assistance using n-gram language models
title Stepwise API usage assistance using n-gram language models
spellingShingle Stepwise API usage assistance using n-gram language models
Santos, A. L.
API
Usability
N-grams
Code completion
IDE
title_short Stepwise API usage assistance using n-gram language models
title_full Stepwise API usage assistance using n-gram language models
title_fullStr Stepwise API usage assistance using n-gram language models
title_full_unstemmed Stepwise API usage assistance using n-gram language models
title_sort Stepwise API usage assistance using n-gram language models
author Santos, A. L.
author_facet Santos, A. L.
Prendi, G.
Sousa, H.
Ribeiro, R.
author_role author
author2 Prendi, G.
Sousa, H.
Ribeiro, R.
author2_role author
author
author
dc.contributor.author.fl_str_mv Santos, A. L.
Prendi, G.
Sousa, H.
Ribeiro, R.
dc.subject.por.fl_str_mv API
Usability
N-grams
Code completion
IDE
topic API
Usability
N-grams
Code completion
IDE
description Reusing software involves learning third-party APIs, a process that is often time-consuming and error-prone. Recommendation systems for API usage assistance based on statistical models built from source code corpora are capable of assisting API users through code completion mechanisms in IDEs. A valid sequence of API calls involving different types may be regarded as a well-formed sentence of tokens from the API vocabulary. In this article we describe an approach for recommending subsequent tokens to complete API sentences using n-gram language models built from source code corpora. The provided system was integrated in the code completion facilities of the Eclipse IDE, providing contextualized completion proposals for Java taking into account the nearest lines of code. The approach was evaluated against existing client code of four widely used APIs, revealing that in more than 90% of the cases the expected subsequent token is within the 10-top-most proposals of our models. The high score provides evidence that the recommendations could help on API learning and exploration, namely through the assistance on writing valid API sentences.
publishDate 2017
dc.date.none.fl_str_mv 2017-08-01T15:32:07Z
2017-01-01T00:00:00Z
2017
2019-03-22T15:13:16Z
dc.type.status.fl_str_mv info:eu-repo/semantics/publishedVersion
dc.type.driver.fl_str_mv info:eu-repo/semantics/article
format article
status_str publishedVersion
dc.identifier.uri.fl_str_mv http://hdl.handle.net/10071/14222
url http://hdl.handle.net/10071/14222
dc.language.iso.fl_str_mv eng
language eng
dc.relation.none.fl_str_mv 0164-1212
10.1016/j.jss.2016.06.063
dc.rights.driver.fl_str_mv info:eu-repo/semantics/openAccess
eu_rights_str_mv openAccess
dc.format.none.fl_str_mv application/pdf
dc.publisher.none.fl_str_mv Elsevier
publisher.none.fl_str_mv Elsevier
dc.source.none.fl_str_mv reponame:Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
instname:Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informação
instacron:RCAAP
instname_str Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informação
instacron_str RCAAP
institution RCAAP
reponame_str Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
collection Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos)
repository.name.fl_str_mv Repositório Científico de Acesso Aberto de Portugal (Repositórios Cientìficos) - Agência para a Sociedade do Conhecimento (UMIC) - FCT - Sociedade da Informação
repository.mail.fl_str_mv
_version_ 1799134786878439424