On Multi-Modal Learning of Editing Source Code

08/15/2021
by   Saikat Chakraborty, et al.
0

In recent years, Neural Machine Translator (NMT) has shown promise in automatically editing source code. Typical NMT based code editor only considers the code that needs to be changed as input and suggests developers with a ranked list of patched code to choose from - where the correct one may not always be at the top of the list. While NMT based code editing systems generate a broad spectrum of plausible patches, the correct one depends on the developers' requirement and often on the context where the patch is applied. Thus, if developers provide some hints, using natural language, or providing patch context, NMT models can benefit from them. As a proof of concept, in this research, we leverage three modalities of information: edit location, edit code context, commit messages (as a proxy of developers' hint in natural language) to automatically generate edits with NMT models. To that end, we build MODIT, a multi-modal NMT based code editing engine. With in-depth investigation and analysis, we show that developers' hint as an input modality can narrow the search space for patches and outperform state-of-the-art models to generate correctly patched code in top-1 position.

READ FULL TEXT
research
09/30/2018

Tree2Tree Neural Translation Model for Learning Source Code Changes

The way developers edit day-to-day code tend to be repetitive and often ...
research
07/25/2022

Overwatch: Learning Patterns in Code Edit Sequences

Integrated Development Environments (IDEs) provide tool support to autom...
research
06/10/2023

Automated Code Editing with Search-Generate-Modify

Code editing is essential in evolving software development. Many automat...
research
02/26/2021

CURE: Code-Aware Neural Machine Translation for Automatic Program Repair

Automatic program repair (APR) is crucial to improve software reliabilit...
research
07/15/2019

Characterizing Developer Use of Automatically Generated Patches

We present a study that characterizes the way developers use automatical...
research
01/25/2019

On Learning Meaningful Code Changes via Neural Machine Translation

Recent years have seen the rise of Deep Learning (DL) techniques applied...
research
12/30/2021

AntiCopyPaster: Extracting Code Duplicates As Soon As They Are Introduced in the IDE

We have developed a plugin for IntelliJ IDEA called AntiCopyPaster that ...

Please sign up or login with your details

Forgot password? Click here to reset