SmartPaste: Learning to Adapt Source Code

By Miltiadis Allamanis, Marc Brockschmidt. 2017

24 citations recorded by the source corpus.

Deep Neural Networks have been shown to succeed at a range of natural language tasks such as machine translation and text summarization. While tasks on source code (ie, formal languages) have been considered recently, most work in this area does not attempt to capitalize on the unique opportunities offered by its known syntax and structure. In this work, we introduce SmartPaste, a first task that requires to use such information. The task is a variant of the program repair problem that requires to adapt a given (pasted) snippet of code to surrounding, existing source code. As first solutions, we design a set of deep neural models that learn to represent the context of each variable location and variable usage in a data flow-sensitive way. Our evaluation suggests that our models can learn to solve the SmartPaste task in many cases, achieving 58.6% accuracy, while learning meaningful representation of variable usages.

Subfields: Information Systems, Information Systems and Management, Natural Language Processing

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Information Systems

  1. Charles Sutton
  2. Miltiadis Allamanis
  3. Michael Pradel
  4. Earl T. Barr
  5. Koushik Sen
  6. Premkumar T. Devanbu
  7. Rafael-Michael Karampatsis
  8. Rishabh Singh

In Information Systems and Management

  1. Koushik Sen
  2. Michael Pradel
  3. Tal Ben-Nun
  4. Alice Shoshana Jakobovits
  5. Torsten Hoefler
  6. Rohan Bavishi
  7. Premkumar T. Devanbu
  8. Miltiadis Allamanis

In Natural Language Processing

  1. Charles Sutton
  2. Miltiadis Allamanis
  3. Michael Pradel
  4. Premkumar T. Devanbu
  5. Earl T. Barr
  6. Koushik Sen
  7. Rafael-Michael Karampatsis
  8. Rohan Bavishi

Citations in the corpus