Function completion in the time of massive data: A code embedding perspective

08/09/2020
by   M. Weyssow, et al.
0

Code completion is an important feature of integrated development environments (IDEs). It allows developers to produce code faster, especially novice ones who are not fully familiar with APIs and others code. Previous works on code completion have mainly exploited static type systems of programming languages or code history of the project under development or of other projects using common APIs. In this work, we present a novel approach for improving current function-calls completion tools by learning from independent code repositories, using well-known natural language processing models that can learn vector representation of source code (code embeddings). Our models are not trained on historical data of specific projects. Instead, our approach allows to learn high-level concepts and their relationships present among thousands of projects. As a consequence, the resulting system is able to provide general suggestions that are not specific to particular projects or APIs. Additionally, by taking into account the context of the call to complete, our approach suggests function calls relevant to that context. We evaluated our approach on a set of open-source projects unseen during the training. The results show that the use of the trained model along with a code suggestion plug-in based on static type analysis improves significantly the correctness of the completion suggestions.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/22/2020

DevReplay: Automatic Repair with Editable Fix Pattern

Static analysis tools, or linters, detect violation of source code conve...
research
06/05/2023

A Static Evaluation of Code Completion by Large Language Models

Large language models trained on code have shown great potential to incr...
research
03/08/2021

Siri, Write the Next Method

Code completion is one of the killer features of Integrated Development ...
research
06/19/2023

Guiding Language Models of Code with Global Context using Monitors

Language models of code (LMs) work well when the surrounding code in the...
research
06/18/2020

Learning to Format Coq Code Using Language Models

Should the final right bracket in a record declaration be on a separate ...
research
06/01/2023

Better Context Makes Better Code Language Models: A Case Study on Function Call Argument Completion

Pretrained code language models have enabled great progress towards prog...
research
03/18/2022

How Do Programmers Express High-Level Concepts using Primitive Data Types?

We investigated how programmers express high-level concepts such as path...

Please sign up or login with your details

Forgot password? Click here to reset