Identifying Refactorable Micro-Clones through Mining Similarity Preserving Change Patterns

The daily lives of mass amount of people are disrupted by recurring anomalies of software services (such as crashes, denial of services, and security hacks). These anomalies originate from a lack of quality in the software codebase such as code smells. Duplicate codes (code clones), a special type of code smells are problematic and decrease software quality and increase the mentioned anomalies. Existing studies suggest to manage code clones through refactoring in order to minimize clone related complexities. While regular code clones, clones of at least 5 LOC (lines of clone), have been investigated a lot for refactoring, micro-clones (clones of at most 4 LOC) have been ignored in the existing studies. However, a software system generally contains a large number of micro-clones. Aggressively refactoring all these micro-clones is impractical. Thus, it is necessary to identify which of these large number of micro-clones residing in a software system’s codebase should be considered important for refactoring. Our research in this paper investigates this matter.We have investigated a particular clone change pattern, the Similarity Preserving Change Pattern (SPCP), by analyzing the evolutionary history of the micro-clones. We use Nicad and SPCP-Miner for our investigation and obtain the SPCP micro-clone pairs of Type 1, 2, and 3. We manually analyze the SPCP micro-clone pairs and discovered that pairs with LOC 3 and 4 are more refactorable than those with LOC of 1, and 2. Refactorable micro-clones primarily consist of four types of code constructs (functional, conditional, try-catch, and while loop). Additionally, Type 3 micro-clones in Java systems are generally not suitable for refactoring. We developed a webpage page to show micro-clones of 3 types and their refactoring techniques if they are refactorable. On the basis of our findings, we built a tool that can identify refactorable micro-clones from a software system. Our tool is available online.

Authors

Institutions

Publication Details

Published
2024-12-20
DOI
https://doi.org/10.1109/iccit64611.2024.11021894
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Identifying Refactorable Micro-Clones through Mining Similarity Preserving Change Patterns

Manishankar Mondal, Morvarid Elahi, Amit Kumar Mondal
Software Engineering Research
article

Identifying Refactorable Micro-Clones through Mining Similarity Preserving Change Patterns

Manishankar Mondal, Morvarid Elahi, Amit Kumar Mondal
article en

Abstract

The daily lives of mass amount of people are disrupted by recurring anomalies of software services (such as crashes, denial of services, and security hacks). These anomalies originate from a lack of quality in the software codebase such as code smells. Duplicate codes (code clones), a special type of code smells are problematic and decrease software quality and increase the mentioned anomalies. Existing studies suggest to manage code clones through refactoring in order to minimize clone related complexities. While regular code clones, clones of at least 5 LOC (lines of clone), have been investigated a lot for refactoring, micro-clones (clones of at most 4 LOC) have been ignored in the existing studies. However, a software system generally contains a large number of micro-clones. Aggressively refactoring all these micro-clones is impractical. Thus, it is necessary to identify which of these large number of micro-clones residing in a software system’s codebase should be considered important for refactoring. Our research in this paper investigates this matter.We have investigated a particular clone change pattern, the Similarity Preserving Change Pattern (SPCP), by analyzing the evolutionary history of the micro-clones. We use Nicad and SPCP-Miner for our investigation and obtain the SPCP micro-clone pairs of Type 1, 2, and 3. We manually analyze the SPCP micro-clone pairs and discovered that pairs with LOC 3 and 4 are more refactorable than those with LOC of 1, and 2. Refactorable micro-clones primarily consist of four types of code constructs (functional, conditional, try-catch, and while loop). Additionally, Type 3 micro-clones in Java systems are generally not suitable for refactoring. We developed a webpage page to show micro-clones of 3 types and their refactoring techniques if they are refactorable. On the basis of our findings, we built a tool that can identify refactorable micro-clones from a software system. Our tool is available online.

Khulna University (BD)
Openalex Percentile: Top 51%
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Identifying Refactorable Micro-Clones through Mining Similarity Preserving Change Patterns — Manishankar Mondal, Morvarid Elahi, et al. · (2024) | TGRS Research Map | TGRS