Clone Refactoring with Lambda Expressions

Abstract

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 technique that examines the applicability of Lambda expressions for the refactoring of clones with behavioral differences. Moreover, we empirically investigate the applicability and characteristics of the Lambda expressions introduced to refactor a large dataset of clones. Our findings show that Lambda expressions enable the refactoring of a significant portion of clones that could not be refactored by any other means.

Software Clones Refactoring Lambda Expressions ICSE
  • The paper can be downloaded here.
  • The replication data and instructions can be found here.

BibTex

@inproceedings{Tsantalis:ICSE:2017,
    author={Tsantalis, Nikolaos and Mazinanian, Davood and Rostami, Shahriar},
    title={Clone Refactoring with Lambda Expressions},
    booktitle={Proceedings of the 39th International Conference on Software Engineering},
    series = {ICSE 2017},
    year = {2017},
    location = {Buenos Aires, Argentina},
    numpages = {11},
}