Learning the Relation between Code Features and Code Transforms with Structured Prediction

07/22/2019
by   Zhongxing Yu, et al.
0

We present in this paper the first approach for structurally predicting code transforms at the level of AST nodes using conditional random fields. Our approach first learns offline a probabilistic model that captures how certain code transforms are applied to certain AST nodes, and then uses the learned model to predict transforms for new, unseen code snippets. We implement our approach in the context of repair transform prediction for Java programs. Our implementation contains a set of carefully designed code features, deals with the training data imbalance issue, and comprises transform constraints that are specific to code. We conduct a large-scale experimental evaluation based on a dataset of 4,590,679 bug fixing commits from real-world Java projects. The experimental results show that our approach predicts the code transforms with a success rate varying from 37.1

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/10/2021

Megadiff: A Dataset of 600k Java Source Code Changes Categorized by Diff Size

This paper presents Megadiff, a dataset of source code diffs. It focuses...
research
06/25/2018

The Hamming and Golay Number-Theoretic Transforms

New number-theoretic transforms are derived from known linear block code...
research
04/03/2019

Styler: Learning Formatting Conventions to Repair Checkstyle Errors

Formatting coding conventions play an important role on code readability...
research
05/24/2022

A Complex Java Code Generator for ACL2 Based on a Shallow Embedding of ACL2 in Java

This paper describes a code generator that translates ACL2 constructs to...
research
05/12/2023

Opti Code Pro: A Heuristic Search-based Approach to Code Refactoring

This paper presents an approach that evaluates best-first search methods...
research
12/20/2017

Kayak: Safe Semantic Refactoring to Java Streams

Refactorings are structured changes to existing software that leave its ...

Please sign up or login with your details

Forgot password? Click here to reset