Code Clone Refactoring in C# with Lambda Expressions
Takuto Kawamoto, Yoshiki Higo

TL;DR
This paper introduces a C#-specific technique using lambda expressions to analyze and consolidate code clones, demonstrating its effectiveness on real-world projects with a significant portion of clones being refactorable.
Contribution
The study presents a novel C#-focused method leveraging lambda expressions for clone refactoring, filling a gap in behavior parameterization research beyond Java.
Findings
35.0% of clone pairs were suitable for refactoring
28.9% of clone pairs were successfully refactored
Applied to 2,217 clone pairs from 22 projects
Abstract
"Extract Method" refactoring is a technique for consolidating code clones. Parameterization approaches are used to extract a single method from multiple code clones that contain differences. This approach parameterizes expressions and behaviors within a method. In particular, behavior parameterization has been extensively studied in Java programs, but little research has been conducted on other programming languages. Lambda expressions can be used to parameterize behaviors, but the specifications of each programming language significantly affect the applicability of this technique. Therefore, the optimal "Extract Method" approach may vary depending on the programming language. In this study, we propose a C#-specific technique that uses lambda expressions to analyze and consolidate code clones. We evaluated our proposed method by applying it to code clones detected by the NiCad clone…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Logic, programming, and type systems · Software Testing and Debugging Techniques
