Combining Program Analysis and Statistical Language Model for Code Statement Completion

11/18/2019
by   Son Nguyen, et al.
0

Automatic code completion helps improve developers' productivity in their programming tasks. A program contains instructions expressed via code statements, which are considered as the basic units of program execution. In this paper, we introduce AutoSC, which combines program analysis and the principle of software naturalness to fill in a partially completed statement. AutoSC benefits from the strengths of both directions, in which the completed code statement is both frequent and valid. AutoSC is first trained on a large code corpus to derive the templates of candidate statements. Then, it uses program analysis to validate and concretize the templates into syntactically and type-valid candidate statements. Finally, these candidates are ranked by using a language model trained on the lexical form of the source code in the code corpus. Our empirical evaluation on the large datasets of real-world projects shows that AutoSC achieves 38.9-41.3 top-5 accuracy in statement completion. It also outperforms a state-of-the-art approach from 9X-69X in top-1 accuracy.

READ FULL TEXT
research
03/15/2022

ReACC: A Retrieval-Augmented Code Completion Framework

Code completion, which aims to predict the following code token(s) accor...
research
09/25/2019

Improve Language Modelling for Code Completion through Statement Level Language Model based on Statement Embedding Generated by BiLSTM

Language models such as RNN, LSTM or other variants have been widely use...
research
05/25/2017

Data-Driven Program Completion

We introduce program splicing, a programming methodology that aims to au...
research
04/10/2020

Sequence Model Design for Code Completion in the Modern IDE

Code completion plays a prominent role in modern integrated development ...
research
09/11/2020

Generating Accurate Assert Statements for Unit Test Cases using Pretrained Transformers

Unit testing represents the foundational basis of the software testing p...
research
02/20/2023

Learning Deep Semantics for Test Completion

Writing tests is a time-consuming yet essential task during software dev...
research
09/13/2022

Learning to Prevent Profitless Neural Code Completion

Currently, large pre-trained models are widely applied in neural code co...

Please sign up or login with your details

Forgot password? Click here to reset