TY - JOUR
T1 - An empirical analysis of source code metrics and smart contract resource consumption
AU - Ajienka, Nemitari
AU - Vangorp, Peter
AU - Capiluppi, Andrea
PY - 2020/10
Y1 - 2020/10
N2 - A smart contract (SC) is a programme stored in the Ethereum blockchain by a contract-creation transaction. SC developers deploy an instance of the SC and attempt to execute it in exchange for a fee, paid in Ethereum coins (Ether). If the computation needed for their execution turns out to be larger than the effort proposed by the developer (i.e., the gasLimit), their client instantiation will not be completed successfully. In this paper, we examine SCs from 11 Ethereum blockchain-oriented software projects hosted on GitHub.com, and we evaluate the resources needed for their deployment (i.e., the gasUsed). For each of these contracts, we also extract a suite of object-oriented metrics, to evaluate their structural characteristics. Our results show a statistically significant correlation between some of the object-oriented (OO) metrics and the resources consumed on the Ethereum blockchain network when deploying SCs. This result has a direct impact on how Ethereum developers engage with a SC: evaluating its structural characteristics, they will be able to produce a better estimate of the resources needed to deploy it. Other results show specific source code metrics to be prioritised based on application domains when the projects are clustered based on common themes.
AB - A smart contract (SC) is a programme stored in the Ethereum blockchain by a contract-creation transaction. SC developers deploy an instance of the SC and attempt to execute it in exchange for a fee, paid in Ethereum coins (Ether). If the computation needed for their execution turns out to be larger than the effort proposed by the developer (i.e., the gasLimit), their client instantiation will not be completed successfully. In this paper, we examine SCs from 11 Ethereum blockchain-oriented software projects hosted on GitHub.com, and we evaluate the resources needed for their deployment (i.e., the gasUsed). For each of these contracts, we also extract a suite of object-oriented metrics, to evaluate their structural characteristics. Our results show a statistically significant correlation between some of the object-oriented (OO) metrics and the resources consumed on the Ethereum blockchain network when deploying SCs. This result has a direct impact on how Ethereum developers engage with a SC: evaluating its structural characteristics, they will be able to produce a better estimate of the resources needed to deploy it. Other results show specific source code metrics to be prioritised based on application domains when the projects are clustered based on common themes.
KW - abstract syntax-tree (AST)
KW - blockchain-oriented software (BOS)
KW - Chidamber and Kemerer (C&K)
KW - object-oriented (OO)
KW - object-oriented programming (OOP)
KW - smart contract (SC)
KW - PREDICTION
KW - COHESION
U2 - 10.1002/smr.2267
DO - 10.1002/smr.2267
M3 - Article
VL - 32
JO - Journal of software-Evolution and process
JF - Journal of software-Evolution and process
SN - 2047-7481
IS - 10
M1 - e2267
ER -