Software Engineering Dept., National University of Moderns Languages, Islamabad, Pakistan.
Computer Science Dept., Quaid-i-Azam University, Islamabad, Pakistan.
PLoS One. 2022 Dec 1;17(12):e0277216. doi: 10.1371/journal.pone.0277216. eCollection 2022.
Cloning in software is generally perceived as a threat to its maintenance and that is why it needs to be managed properly. Understanding clones from a historical perspective is essential for effective clone management. Analysis of code refactorings performed on clones in previous releases will help developers in taking decisions about clone refactoring in future releases. In this paper we perform a longitudinal study on the evolution of clone refactorings in various versions of five software systems. To perform a systematic study on clone refactoring evolution, we define clone evolution patterns for studying refactorings in a formal notation. Our results show that only a small proportion of code clones are refactored between the versions and most of the refactorings are inconsistent within clone classes. Moreover, clone refactorings may cause clone removal. Analysis of the source code of refactored clones reveals similar reasons of inconsistent refactorings and clone removal for five Java systems. This analysis will help in devising appropriate strategies for managing clone refactorings in software and hence provide foundation for devising better clone management tools.
在软件中,克隆通常被视为对其维护的威胁,因此需要进行适当的管理。从历史角度理解克隆对于有效的克隆管理至关重要。分析以前版本中对克隆执行的代码重构将帮助开发人员在未来版本中做出关于克隆重构的决策。在本文中,我们对五个软件系统的各个版本中的克隆重构演化进行了纵向研究。为了对克隆重构演化进行系统研究,我们为研究重构定义了克隆演化模式,以形式化符号表示。我们的结果表明,版本之间只有一小部分代码克隆被重构,并且大多数重构在克隆类内是不一致的。此外,克隆重构可能导致克隆的删除。对重构克隆的源代码进行分析揭示了五个 Java 系统中不一致重构和克隆删除的类似原因。这种分析将有助于设计软件中管理克隆重构的适当策略,并为设计更好的克隆管理工具提供基础。