Clone Refactoring with Lambda Expressions

@article{Tsantalis2017CloneRW,
  title={Clone Refactoring with Lambda Expressions},
  author={Nikolaos Tsantalis and Davood Mazinanian and Shahriar Rostami},
  journal={2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE)},
  year={2017},
  pages={60-70}
}
Lambda expressions have been introduced in Java 8 to support functional programming and enable behavior parameterization by passing functions as parameters to methods. The majority of software clones (duplicated code) are known to have behavioral differences (i.e., Type-2 and Type-3 clones). However, to the best of our knowledge, there is no previous work to investigate the utility of Lambda expressions for parameterizing such behavioral differences in clones. In this paper, we propose a… 

Figures and Tables from this paper

Programmers do not favor lambda expressions for concurrent object-oriented code
TLDR
This paper investigated the application of lambda expressions in 2923 open-source projects, implemented in one of the most common OO programming languages: C#, C++, and Java, and observed that developers compromise their code by applying a significantly higher number of impure, capturing lambda expressions, which are capable of causing race conditions.
Understanding the Impact of Introducing Lambda Expressions in Java Programs
TLDR
It is argued in this paper that one can improve program comprehension when she applies particular transformations to introduce lambda expressions (e.g., replacing anonymous inner classes with lambda expressions), which might support the implementation of effective tools for automatic program transformations.
Does the Introduction of Lambda Expressions Improve the Comprehension of Java Programs?
TLDR
It is argued in this paper that one can improve program comprehension when she applies particular transformations to introduce lambda expressions, and that state-of-the-art models for estimating program readability are not helpful to capture the benefits of a program transformation to introducelambda expressions.
Understanding the use of lambda expressions in Java
TLDR
Interestingly, it is found that developers are using Java's built-in functional interfaces inefficiently, i.e., they prefer to use general functional interfaces over the specialized ones, overlooking the performance overheads that might be imposed.
Análise do impacto na compreensão de programas Java com a introdução de expressões lambda
TLDR
Evaluating whether the adoption of lambda expressions leads to improvements in the understanding of the program, one of the benefits expected from the use of the new Java construct and in which situations it should be applied concluded that adopting lambda expressions can reduce the complexity and size of programs.
How Compact Will My System Be? A Fully-Automated Way to Calculate LoC Reduced by Clone Refactoring
TLDR
A new technique to calculate a reducible LoC is proposed that was able to merge clones that were not counted in the existing technique and confirmed that a reduvable LoC which was calculated with considering refactorability is 25% of a reducer which was estimated without consideringRefactorability.
State-of-the-Art Report on Type III Clone Refactoring Techniques
TLDR
A semi-automation approach is proposed for discussion, which includes both a heuristic-based part for the refactoring that can be automated, while preserving code quality, and an artificial neural-network based model to learn refactorings for more complex code differences and their transformations.
Automated Refactoring to Reactive Programming
  • M. Köhler, G. Salvaneschi
  • Computer Science
    2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE)
  • 2019
TLDR
This paper proposes 2Rx, a refactoring approach to automatically convert asynchronous code to reactive programming, and shows that 2RX is effective with the most common asynchronous constructs, covering 12.7% of projects with asynchronous computations, and it can provide aRefactoring for 91.8% of their occurrences.
Automatic Refactoring for Renamed Clones in Test Code
TLDR
A novel tool, JTestParametrizer, is presented for automatically refactoring method-scope renamed clones in test suites to improve code conciseness, reduce the amount of duplication, and make test suites easier to maintain and extend.
An Automatic Advisor for Refactoring Software Clones Based on Machine Learning
TLDR
A unique learning method is suggested that automatically extracts features from the detected code clones and trains models to advise developers on what type needs to be refactored.
...
1
2
3
4
...

References

SHOWING 1-10 OF 42 REFERENCES
Assessing the Refactorability of Software Clones
TLDR
This work proposes an approach for automatically assessing whether a pair of clones can be safely refactored without changing the behavior of the program, and performs a large-scale empirical study on over a million clone pairs detected by four different clone detection tools in nine open-source projects.
LambdaFicator: From imperative to functional programming through automated refactoring
TLDR
LambdaFicator is presented, a tool which automates two refactorings that converts anonymous inner classes to lambda expressions and converts for loops that iterate over Collections to functional operations that use lambda expressions.
Crossing the gap from imperative to functional programming through refactoring
TLDR
LambdaFicator is designed and implemented, a tool which automates two refactorings that converts anonymous inner classes to lambda expressions and converts for loops that iterate over Collections to functional operations that use lambda expressions.
An empirical study on the maintenance of source code clones
TLDR
An automatic approach to classify the evolution of source code clone fragments is proposed and a fine-grained analysis of clone evolution in four different Java and C software systems is reported, aimed at investigating to what extent clones are consistently propagated or they evolve independently.
Increasing clone maintenance support by unifying clone detection and refactoring activities
Do code clones matter?
TLDR
For the analyzed commercial and open source systems, it was found that inconsistent changes to clones are very frequent but also identified a significant number of faults induced by such changes.
Detecting differences across multiple instances of code clones
TLDR
The study shows that the approach to automatically detecting differences across multiple clone instances can significantly improve developers’performance inRefactoring decisions, refactoring details, and task completion time on clone-related refactored tasks.
Automatic Identification of Important Clones for Refactoring and Tracking
TLDR
This research work applies the concept of evolutionary coupling to identify clones that are important for refactoring or tracking and determines and analyzes constrained association rules of clone fragments that evolved following a particular change pattern called Similarity Preserving Change Pattern and are important from the perspective ofRefactoring and tracking.
Assessing the effect of clones on changeability
TLDR
This paper compares measures of the maintenance effort on methods with clones against those without and finds that some methods seem to increase significantly their maintenance effort when a clone was present, but the characteristics analyzed in these methods did not reveal any systematic relation between cloning and such maintenance effort increase.
Does Automated Refactoring Obviate Systematic Editing?
TLDR
It is found that scoping refactoring based on systematic edits based on the entire method increases the applicability of automated clone removal, which indicates that automated refactored does not obviate the need for systematic editing.
...
1
2
3
4
5
...