Javascript must be enabled to continue!
Automatic Refactoring Approach for Asynchronous Mechanisms with CompletableFuture
View through CrossRef
To address the inherent limitations of Future in asynchronous programming frameworks, JDK 1.8 introduced the CompletableFuture class, which features approximately 50 different methods for composing and executing asynchronous computations and handling exceptions. This paper proposes an automatic refactoring method that integrates multiple static analysis techniques, including visitor pattern analysis, alias analysis, and executor inheritance structure analysis, to conduct precondition checks. Distinct from existing Future refactoring methods, this approach considers custom executor types, thereby extending its applicability. Using this method, the ReFuture automatic refactoring plugin was implemented within the Eclipse JDT framework. The method was evaluated in terms of the number of refactorings, refactoring time, and error introduction, alongside a side-by-side comparison with the existing method. The refactoring outcomes for nine large applications, including ActiveMQ, Hadoop, and Elasticsearch, show that ReFuture successfully refactored 639 out of 813 potential code structures, achieving a refactoring success rate of 64.70% without introducing errors. This tool effectively facilitates the refactoring to CompletableFuture and enhances refactoring efficiency compared to manual methods.
Title: Automatic Refactoring Approach for Asynchronous Mechanisms with CompletableFuture
Description:
To address the inherent limitations of Future in asynchronous programming frameworks, JDK 1.
8 introduced the CompletableFuture class, which features approximately 50 different methods for composing and executing asynchronous computations and handling exceptions.
This paper proposes an automatic refactoring method that integrates multiple static analysis techniques, including visitor pattern analysis, alias analysis, and executor inheritance structure analysis, to conduct precondition checks.
Distinct from existing Future refactoring methods, this approach considers custom executor types, thereby extending its applicability.
Using this method, the ReFuture automatic refactoring plugin was implemented within the Eclipse JDT framework.
The method was evaluated in terms of the number of refactorings, refactoring time, and error introduction, alongside a side-by-side comparison with the existing method.
The refactoring outcomes for nine large applications, including ActiveMQ, Hadoop, and Elasticsearch, show that ReFuture successfully refactored 639 out of 813 potential code structures, achieving a refactoring success rate of 64.
70% without introducing errors.
This tool effectively facilitates the refactoring to CompletableFuture and enhances refactoring efficiency compared to manual methods.
Related Results
A Systematic Literature Review on Software- refactoring Techniques, Challenges, and Practices
A Systematic Literature Review on Software- refactoring Techniques, Challenges, and Practices
Abstract
Software-refactoring improves the quality and reduces the complexity during the whole life cycle of the software system. The objective of this work is to elicit th...
Refactoring for Java-Structured Concurrency
Refactoring for Java-Structured Concurrency
Structured concurrency treats multiple tasks running in different threads as a single unit, thereby improving reliability and enhancing observability. The existing IDE (Integrated ...
MEASURING MAINTAINABILITY INDEX BEFORE AND AFTER CODE REFACTORING
MEASURING MAINTAINABILITY INDEX BEFORE AND AFTER CODE REFACTORING
Measuring the maintainability index of software is crucial to ensure bettermaintenance and improve quality. Refactoring code is important in improving software quality and increasi...
A Task-driven Grammar Refactoring Algorithm
A Task-driven Grammar Refactoring Algorithm
This paper presents our proposal and the implementation of an algorithm for automated refactoring of context-free grammars. Rather than operating under some domain-specific task, i...
Investigating the Refactoring Capabilities of Small Open-Weight Language Models
Investigating the Refactoring Capabilities of Small Open-Weight Language Models
Refactoring is essential for developing maintainable software. Using Large Language Models in software engineering is widespread, but compared to well-established domains such as c...
Deep Active Learning for Label-Efficient Refactoring Prediction
Deep Active Learning for Label-Efficient Refactoring Prediction
Software refactoring improves the maintainability of code and reduces technical debt, but making the construction of a labeled refactoring dataset is a costly and labor-intensive p...
Post-Refactoring Recovery of Unit Tests: An Automated Approach
Post-Refactoring Recovery of Unit Tests: An Automated Approach
— In application development lifecycle, specifically in test-driven development, refactoring plays a crucial role in sustaining ease. However, in-spite of bringing ease, refactorin...
Modernizing Blockchain Code: How Refactoring Tools Define Future Technologies
Modernizing Blockchain Code: How Refactoring Tools Define Future Technologies
Blockchain technology has emerged as a transformative force across various industries, offering decentralized and secure systems for transactions and data management. However, as t...

