SEAug 9, 2020

Combining Code Embedding with Static Analysis for Function-Call Completion

arXiv:2008.03731v27.32 citationsHas Code
Originality Incremental advance
AI Analysis

This addresses code completion for developers, especially novices, by providing more general and context-relevant suggestions, though it is incremental as it builds on existing static analysis methods.

The paper tackled the problem of improving function-call completion in IDEs by combining code embeddings learned from independent repositories with static analysis, resulting in significantly improved correctness of suggestions as evaluated on unseen open-source projects.

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.

Code Implementations2 repos
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes