Javascript must be enabled to continue!
Refactoring for Java-Structured Concurrency
View through CrossRef
Structured concurrency treats multiple tasks running in different threads as a single unit, thereby improving reliability and enhancing observability. The existing IDE (Integrated Development Environment) does not provide sufficient support to leverage such an advanced structure and conduct refactoring automatically. Manual refactoring is tedious and error prone. There is an urgent need to provide adequate support to perform automatic refactoring. To this end, this paper proposes ReStruct, an automatic refactoring approach to transform unstructured concurrency to structured concurrency. ReStruct first employs visitor pattern analysis to acquire the target code for refactoring and then performs a precondition to filter out the code that meets the refactoring criteria. Subsequently, it performs scope analysis to guide the refactoring process. Finally, ReStruct performs refactoring on the AST of the source program. ReStruct is implemented as an Eclipse plugin and is evaluated in seven real-world projects via the number of refactorings and changes to LOCs (lines of code), time, and performance after refactoring. The experimental results illustrate that a total of 82 unstructured codes are refactored, with an average of 27.3 s per project. Furthermore, the performances of these refactored projects are improved by an average of 6.5%, demonstrating its effectiveness.
Title: Refactoring for Java-Structured Concurrency
Description:
Structured concurrency treats multiple tasks running in different threads as a single unit, thereby improving reliability and enhancing observability.
The existing IDE (Integrated Development Environment) does not provide sufficient support to leverage such an advanced structure and conduct refactoring automatically.
Manual refactoring is tedious and error prone.
There is an urgent need to provide adequate support to perform automatic refactoring.
To this end, this paper proposes ReStruct, an automatic refactoring approach to transform unstructured concurrency to structured concurrency.
ReStruct first employs visitor pattern analysis to acquire the target code for refactoring and then performs a precondition to filter out the code that meets the refactoring criteria.
Subsequently, it performs scope analysis to guide the refactoring process.
Finally, ReStruct performs refactoring on the AST of the source program.
ReStruct is implemented as an Eclipse plugin and is evaluated in seven real-world projects via the number of refactorings and changes to LOCs (lines of code), time, and performance after refactoring.
The experimental results illustrate that a total of 82 unstructured codes are refactored, with an average of 27.
3 s per project.
Furthermore, the performances of these refactored projects are improved by an average of 6.
5%, demonstrating its effectiveness.
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...
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...
Automatic Refactoring Approach for Asynchronous Mechanisms with CompletableFuture
Automatic Refactoring Approach for Asynchronous Mechanisms with CompletableFuture
To address the inherent limitations of Future in asynchronous programming frameworks, JDK 1.8 introduced the CompletableFuture class, which features approximately 50 different meth...
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...
DOMASCOS (DOMAin Specific COncurrency Skeletons)
DOMASCOS (DOMAin Specific COncurrency Skeletons)
Existing approaches to concurrent programming, albeit essential, are easily used incorrectly. Testing is difficult due to the inherent non-determinism introduced by concurrency, es...
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...

