Suppr超能文献

智能合约软件度量:初探。

Smart contracts software metrics: A first study.

机构信息

Dept. of Computer Science and Mathematics, University Of Cagliari, Cagliari, Italy.

Dept. of Economics and Business Sciences, University Of Cagliari, Cagliari, Italy.

出版信息

PLoS One. 2023 Apr 12;18(4):e0281043. doi: 10.1371/journal.pone.0281043. eCollection 2023.

Abstract

Smart contracts (SC) are software programs that reside and run over a blockchain. The code can be written in different languages with the common purpose of implementing various kinds of transactions onto the hosting blockchain. They are ruled by the blockchain infrastructure with the intent to automatically implement the typical conditions of traditional contracts. Programs must satisfy context-dependent constraints which are quite different from traditional software code. In particular, since the bytecode is uploaded in the hosting blockchain, the size, computational resources, interaction between different parts of the program are all limited. This is true even if the specific programming languages implement more or less the same constructs as that of traditional languages: there is not the same freedom as in normal software development. The working hypothesis used in this article is that Smart Contract specific constraints should be captured by specific software metrics (that may differ from traditional software metrics). We tested this hypothesis on 85K Smart Contracts written in Solidity and uploaded on the Ethereum blockchain. We analyzed Smart Contracts from two repositories "Etherscan" and "Smart Corpus" and we computed the statistics of a set of software metrics related to Smart Contracts and compared them to the metrics extracted from more traditional software projects. Our results show that generally, Smart Contract metrics have more restricted ranges than the corresponding metrics in traditional software systems. Some of the stylized facts, like power law in the tail of the distribution of some metrics, are only approximate but the lines of code follow a log-normal distribution which reminds us of the same behaviour already found in traditional software systems.

摘要

智能合约(SC)是驻留在区块链上并在其上运行的软件程序。代码可以用不同的语言编写,其共同目的是将各种类型的交易实施到托管区块链上。它们受区块链基础设施的规则约束,旨在自动实现传统合约的典型条件。程序必须满足与上下文相关的约束条件,这些约束条件与传统软件代码有很大的不同。特别是,由于字节码被上传到托管区块链中,程序的大小、计算资源以及程序各部分之间的交互都受到限制。即使特定编程语言实现的结构与传统语言的结构或多或少相同:与正常软件开发相比,也没有相同的自由度。本文使用的工作假设是,智能合约的特定约束条件应该由特定的软件指标(可能与传统软件指标不同)来捕获。我们在以太坊区块链上上传的 85K 个 Solidity 编写的智能合约上测试了这个假设。我们分析了来自“Etherscan”和“Smart Corpus”两个存储库的智能合约,并计算了一组与智能合约相关的软件指标的统计数据,并将其与从更传统的软件项目中提取的指标进行了比较。我们的结果表明,一般来说,智能合约的指标比传统软件系统中的相应指标的范围更受限制。一些风格化的事实,如某些指标分布的尾部的幂律,只是近似的,但代码行数遵循对数正态分布,这让我们想起了在传统软件系统中已经发现的相同行为。

https://cdn.ncbi.nlm.nih.gov/pmc/blobs/4b89/10096301/2dbcaf72a769/pone.0281043.g001.jpg

相似文献

1
Smart contracts software metrics: A first study.
PLoS One. 2023 Apr 12;18(4):e0281043. doi: 10.1371/journal.pone.0281043. eCollection 2023.
2
Delegate contract signing mechanism based on smart contract.
PLoS One. 2022 Aug 19;17(8):e0273424. doi: 10.1371/journal.pone.0273424. eCollection 2022.
4
Using Ethereum blockchain to store and query pharmacogenomics data via smart contracts.
BMC Med Genomics. 2020 Jun 1;13(1):74. doi: 10.1186/s12920-020-00732-x.
5
Design and Application of Legally Valid Payment Templates Based on Linking Contracts.
Comput Math Methods Med. 2022 Jul 18;2022:1331237. doi: 10.1155/2022/1331237. eCollection 2022.
7
Blockchain-Based Architecture Design for Personal Health Record: Development and Usability Study.
J Med Internet Res. 2022 Apr 13;24(4):e35013. doi: 10.2196/35013.
8
A Decentralized Marketplace for Patient-Generated Health Data: Design Science Approach.
J Med Internet Res. 2023 Feb 27;25:e42743. doi: 10.2196/42743.
9
Multi-objective test selection of smart contract and blockchain applications.
PeerJ Comput Sci. 2023 Oct 17;9:e1587. doi: 10.7717/peerj-cs.1587. eCollection 2023.
10
Comparison of Smart Contract Blockchains for Healthcare Applications.
AMIA Annu Symp Proc. 2020 Mar 4;2019:1266-1275. eCollection 2019.

本文引用的文献

1
CBGRU: A Detection Method of Smart Contract Vulnerability Based on a Hybrid Model.
Sensors (Basel). 2022 May 7;22(9):3577. doi: 10.3390/s22093577.
2
Punctuated equilibrium in software evolution.
Phys Rev E Stat Nonlin Soft Matter Phys. 2004 Dec;70(6 Pt 2):067103. doi: 10.1103/PhysRevE.70.067103. Epub 2004 Dec 23.
3
Software systems as complex networks: structure, function, and evolvability of software collaboration graphs.
Phys Rev E Stat Nonlin Soft Matter Phys. 2003 Oct;68(4 Pt 2):046116. doi: 10.1103/PhysRevE.68.046116. Epub 2003 Oct 20.
4
Signatures of small-world and scale-free properties in large computer programs.
Phys Rev E Stat Nonlin Soft Matter Phys. 2003 Jul;68(1 Pt 2):017102. doi: 10.1103/PhysRevE.68.017102. Epub 2003 Jul 15.

文献AI研究员

20分钟写一篇综述,助力文献阅读效率提升50倍。

立即体验

用中文搜PubMed

大模型驱动的PubMed中文搜索引擎

马上搜索

文档翻译

学术文献翻译模型,支持多种主流文档格式。

立即体验