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
相关论文
共 50 条
  • [1] Mutation Testing for Integer Overflow in Ethereum Smart Contracts
    Jinlei Sun
    Song Huang
    Changyou Zheng
    Tingyong Wang
    Cheng Zong
    Zhanwei Hui
    Tsinghua Science and Technology, 2022, 27 (01) : 27 - 40
  • [2] Mutation Testing for Integer Overflow in Ethereum Smart Contracts
    Sun, Jinlei
    Huang, Song
    Zheng, Changyou
    Wang, Tingyong
    Zong, Cheng
    Hui, Zhanwei
    TSINGHUA SCIENCE AND TECHNOLOGY, 2022, 27 (01) : 27 - 40
  • [3] Gas Estimation and Optimization for Smart Contracts on Ethereum
    Li, Chunmiao
    2021 36TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING ASE 2021, 2021, : 1082 - 1086
  • [4] GASOL: Gas Analysis and Optimization for Ethereum Smart Contracts
    Albert, Elvira
    Correas, Jesus
    Gordillo, Pablo
    Roman-Diez, Guillermo
    Rubio, Albert
    TOOLS AND ALGORITHMS FOR THE CONSTRUCTION AND ANALYSIS OF SYSTEMS, PT II, TACAS 2020, 2020, 12079 : 118 - 125
  • [5] Reducing the Gas Usage of Ethereum Smart Contracts without a Sidechain
    Farokhnia, Soroush
    Goharshady, Amir Kafshdar
    2023 IEEE INTERNATIONAL CONFERENCE ON BLOCKCHAIN AND CRYPTOCURRENCY, ICBC, 2023,
  • [6] Confidential Ethereum Smart Contracts
    Yuan, Michael Juntao
    Hynes, Nick
    Long, Ju
    IT PROFESSIONAL, 2022, 24 (06) : 54 - 58
  • [7] MuSC: A Tool for Mutation Testing of Ethereum Smart Contract
    Li, Zixin
    Wu, Haoran
    Xu, Jiehui
    Wang, Xingya
    Zhang, Lingming
    Chen, Zhenyu
    34TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2019), 2019, : 1198 - 1201
  • [8] Mutation Testing of Smart Contracts As a Service
    Barboni, Morena
    Morichetta, Andrea
    Polini, Andrea
    Banescu, Sebastian
    Zulkoski, Edward
    QUALITY OF INFORMATION AND COMMUNICATIONS TECHNOLOGY, QUATIC 2024, 2024, 2178 : 93 - 109
  • [9] Mutation Testing of Smart Contracts at Scale
    Hartel, Pieter
    Schumi, Richard
    TESTS AND PROOFS (TAP 2020), 2020, 12165 : 23 - 42
  • [10] Smart Money Wasting: Analyzing Gas Cost Drivers of Ethereum Smart Contracts
    Severin, Benedikt
    Hesenius, Marc
    Blum, Florian
    Hettmer, Michael
    Gruhn, Volker
    2022 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2022), 2022, : 293 - 304