Gas-centered mutation testing of Ethereum Smart Contracts

被引:0
作者
Delgado-Perez, Pedro [1 ,3 ]
Melendez-Lapi, Ignacio [2 ]
Boubeta-Puig, Juan [1 ]
机构
[1] Univ Cadiz, Dept Comp Sci & Engn, UCASE Software Engn Res Grp, Cadiz, Spain
[2] Univ Cadiz, Sch Engn, Cadiz, Spain
[3] Univ Cadiz, Dept Comp Sci & Engn, UCASE Software Engn Res Grp, Cadiz 11519, Spain
关键词
blockchain; Ethereum; gas consumption; mutation testing; smart contract;
D O I
10.1002/smr.2672
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Smart contracts (SC) are programs embodying certain business logic stored on a blockchain network like Ethereum. The execution of transactions on SC has a cost, measured in gas units, that depends on the low-level operations performed. Therefore, a poor choice of high-level language constructs could lead to overcharging users for their transactions. Thus, a testing process focused on possible deviations of the gas used in diverse scenarios could provide substantial global savings. This paper presents a gas-centered mutation testing approach for taking care of the gas consumed by Solidity SCs. This approach can be useful to improve the test quality to detect gas-related problems, reason about performance issues that only manifest in certain situations, and identify alternative more optimal implementations. We define and implement several mutation operators specifically designed to perturb gas consumption while preserving contract semantics in general. Our experiments using several real-world SCs show the feasibility of the technique, with some mutants reproducing meaningful differences in the consumption and exposing some gas limits not tight enough in historic transactions. Therefore, our approach is shown to be a good ally to prevent the appearance of gas-related issues and lays the groundwork for researchers seeking to improve performance testing practices. This paper proposes a gas-centered mutation testing approach for taking care of the gas consumed by Ethereum Smart Contracts (ESC). We define several mutation operators specifically designed to perturb gas consumption of ESC written in Solidity while preserving contract semantics in general. Our experiments, applying an implementation of these operators to real-world ESC, show the feasibility of the approach, with some mutants reproducing meaningful differences in the consumption and exposing some gas limits not tight enough in historic transactions. image
引用
收藏
页数:19
相关论文
共 54 条
  • [1] Towards roadmap to implement blockchain in healthcare systems based on a maturity model
    Akbar, Muhammad Azeem
    Leiva, Victor
    Rafi, Saima
    Qadri, Syed Furqan
    Mahmood, Sajjad
    Alsanad, Ahmed
    [J]. JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS, 2022, 34 (12)
  • [2] GASOL: Gas Analysis and Optimization for Ethereum Smart Contracts
    Albert, Elvira
    Correas, Jesus
    Gordillo, Pablo
    Roman-Diez, Guillermo
    Rubio, Albert
    [J]. TOOLS AND ALGORITHMS FOR THE CONSTRUCTION AND ANALYSIS OF SYSTEMS, PT II, TACAS 2020, 2020, 12079 : 118 - 125
  • [3] Running on Fumes Preventing Out-of-Gas Vulnerabilities in Ethereum Smart Contracts Using Static Resource Analysis
    Albert, Elvira
    Gordillo, Pablo
    Rubio, Albert
    Sergey, Ilya
    [J]. VERIFICATION AND EVALUATION OF COMPUTER AND COMMUNICATION SYSTEMS, VECOS 2019, 2019, 11847 : 63 - 78
  • [4] Andesta Erfan, 2020, Proceedings of the 10th International Conference on Computer and Knowledge Engineering (ICCKE 2020), P405, DOI 10.1109/ICCKE50421.2020.9303670
  • [5] SuMo: A mutation testing approach and tool for the Ethereum blockchain
    Barboni, Morena
    Morichetta, Andrea
    Polini, Andrea
    [J]. JOURNAL OF SYSTEMS AND SOFTWARE, 2022, 193
  • [6] ReSuMo: Regression Mutation Testing for Solidity Smart Contracts
    Barboni, Morena
    Casoni, Francesco
    Morichetta, Andrea
    Polini, Andrea
    [J]. QUALITY OF INFORMATION AND COMMUNICATIONS TECHNOLOGY, QUATIC 2022, 2022, 1621 : 61 - 76
  • [7] SuMo: A Mutation Testing Strategy for Solidity Smart Contracts
    Barboni, Morena
    Morichetta, Andrea
    Polini, Andrea
    [J]. 2021 IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATION OF SOFTWARE TEST (AST 2021), 2021, : 50 - 59
  • [8] CEPchain: A graphical model-driven solution for integrating complex event processing and blockchain
    Boubeta-Puig, Juan
    Rosa-Bilbao, Jesus
    Mendling, Jan
    [J]. EXPERT SYSTEMS WITH APPLICATIONS, 2021, 184
  • [9] Mutomvo: Mutation testing framework for simulated cloud and HPC environments
    Canizares, Pablo C.
    Nunez, Alberto
    Merayo, Mercedes G.
    [J]. JOURNAL OF SYSTEMS AND SOFTWARE, 2018, 143 : 187 - 207
  • [10] Deviant: A Mutation Testing Tool for Solidity Smart Contracts
    Chapman, Patrick
    Xu, Dianxiang
    Deng, Lin
    Xiong, Yin
    [J]. 2019 IEEE INTERNATIONAL CONFERENCE ON BLOCKCHAIN (BLOCKCHAIN 2019), 2019, : 319 - 324