Kayak: Safe Semantic Refactoring to Java Streams

12/20/2017
by   Cristina David, et al.
0

Refactorings are structured changes to existing software that leave its externally observable behaviour unchanged. Their intent is to improve readability, performance or other non-behavioural properties. State-of-the-art automatic refactoring tools are syntax-driven and, therefore, overly conservative. In this paper we explore semantics-driven refactoring, which enables much more sophisticated refactoring schemata. As an exemplar of this broader idea, we present Kayak, an automatic refactoring tool that transforms Java with external iteration over collections into code that uses Streams, a new abstraction introduced by Java 8. Our refactoring procedure performs semantic reasoning and search in the space of possible refactorings using automated program synthesis. Our experimental results support the conjecture that semantics-driven refactorings are more precise and are able to rewrite more complex code scenarios when compared to syntax-driven refactorings.

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
12/07/2021

IntelliTC: Automating Type Changes in IntelliJ IDEA

Developers often change the types of program elements. Such a refactorin...
research
05/30/2022

SAT-Based Extraction of Behavioural Models for Java Libraries with Collections

Behavioural models are a valuable tool for software verification, testin...
research
04/02/2020

Software Language Comprehension using a Program-Derived Semantic Graph

Traditional code transformation structures, such as an abstract syntax t...
research
02/07/2020

Grammar Filtering For Syntax-Guided Synthesis

Programming-by-example (PBE) is a synthesis paradigm that allows users t...
research
07/22/2019

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

We present in this paper the first approach for structurally predicting ...
research
05/24/2019

Type-Driven Automated Learning with Lale

Machine-learning automation tools, ranging from humble grid-search to hy...

Please sign up or login with your details

Forgot password? Click here to reset