一句话:通过大规模实证分析揭示 Solidity 智能合约代码克隆高度普遍、部分共同演化且很少参与缺陷修复。
近年来 Solidity 智能合约发展迅速,但尚缺乏对其代码克隆性质与影响的系统分析。本文对 26,294 个智能合约、97,877 个函数进行实证评估,考察代码克隆的普遍性、演化、缺陷倾向,并识别克隆出现的原因。结果显示,代码克隆在智能合约中高度普遍;平均 32.01% 的克隆会共同演化,说明需要谨慎管理以避免一致性问题。与传统软件开发不同,智能合约中的代码克隆很少涉及缺陷修复。最后,作者识别出影响克隆出现的三个主要因素,为开发者理解与管理 Solidity 智能合约中的代码克隆提供实证依据。
In recent years, the development of Solidity smart contracts has been increasing rapidly in popularity. Code cloning is a common coding practice, and many prior studies have revealed that code clones could negatively impact software maintenance and quality. However, there is little work systematically analyzing the nature and impacts of code clones in solidity smart contracts. To bridge this gap, we investigate the prevalence, evolution, and bug-proneness of code clones in solidity smart contracts, and further identify the possible reasons for these clones' occurrences. With our evaluation of 26,294 smart contracts with 97,877 functions, we have found that code clones are highly prevalent in smart contracts. Additionally, on average, 32.01% of clones co-evolve, indicating the need for careful management to avoid consistency issues. Surprisingly, unlike in traditional software development, code clones in smart contracts are rarely involved in bug fixes. Finally, we identify three main factors that affect the occurrences of clones. We believe our study can provide valuable insights for developers to understand and manage code clones in solidity smart contracts.
DOI 原文 ·
@inproceedings{paperbot8784,
title = {Code Cloning in Solidity Smart Contracts: Prevalence, Evolution, and Impact on Development},
author = {Ran Mo and Haopeng Song and Wei Ding and Chaochao Wu},
booktitle = {ICSE},
year = {2025},
doi = {10.1109/icse55347.2025.00123}
}