以太坊智能合约的气体中心突变测试

IF 1.7 4区 计算机科学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING
Pedro Delgado-Pérez, Ignacio Meléndez-Lapi, Juan Boubeta-Puig
{"title":"以太坊智能合约的气体中心突变测试","authors":"Pedro Delgado-Pérez,&nbsp;Ignacio Meléndez-Lapi,&nbsp;Juan Boubeta-Puig","doi":"10.1002/smr.2672","DOIUrl":null,"url":null,"abstract":"<p>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.</p>","PeriodicalId":48898,"journal":{"name":"Journal of Software-Evolution and Process","volume":"36 9","pages":""},"PeriodicalIF":1.7000,"publicationDate":"2024-04-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://onlinelibrary.wiley.com/doi/epdf/10.1002/smr.2672","citationCount":"0","resultStr":"{\"title\":\"Gas-centered mutation testing of Ethereum Smart Contracts\",\"authors\":\"Pedro Delgado-Pérez,&nbsp;Ignacio Meléndez-Lapi,&nbsp;Juan Boubeta-Puig\",\"doi\":\"10.1002/smr.2672\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<p>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.</p>\",\"PeriodicalId\":48898,\"journal\":{\"name\":\"Journal of Software-Evolution and Process\",\"volume\":\"36 9\",\"pages\":\"\"},\"PeriodicalIF\":1.7000,\"publicationDate\":\"2024-04-12\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"https://onlinelibrary.wiley.com/doi/epdf/10.1002/smr.2672\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Journal of Software-Evolution and Process\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://onlinelibrary.wiley.com/doi/10.1002/smr.2672\",\"RegionNum\":4,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q3\",\"JCRName\":\"COMPUTER SCIENCE, SOFTWARE ENGINEERING\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Software-Evolution and Process","FirstCategoryId":"94","ListUrlMain":"https://onlinelibrary.wiley.com/doi/10.1002/smr.2672","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0

摘要

智能合约(SC)是存储在以太坊等区块链网络上的体现特定业务逻辑的程序。在 SC 上执行交易的成本(以气体单位衡量)取决于所执行的底层操作。因此,如果高级语言结构选择不当,可能会导致向用户收取过高的交易费用。因此,如果测试过程侧重于不同场景中使用的气体可能出现的偏差,就能在全球范围内节省大量费用。本文提出了一种以气体为中心的突变测试方法,用于关注 Solidity SC 消耗的气体。这种方法有助于提高测试质量,检测与气体相关的问题,推理仅在特定情况下才会出现的性能问题,并找出更优化的替代实现方案。我们定义并实现了几种突变算子,它们专门用于扰乱气体消耗,同时在总体上保留了合同语义。我们使用几个真实 SC 进行的实验表明了该技术的可行性,其中一些突变算子在消耗方面再现了有意义的差异,并暴露了一些在历史事务中不够严格的气体限制。因此,我们的方法被证明是防止出现气体相关问题的好帮手,并为研究人员寻求改进性能测试实践奠定了基础。
本文章由计算机程序翻译,如有差异,请以英文原文为准。

Gas-centered mutation testing of Ethereum Smart Contracts

Gas-centered mutation testing of Ethereum Smart Contracts

Gas-centered mutation testing of Ethereum Smart Contracts

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.

求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
Journal of Software-Evolution and Process
Journal of Software-Evolution and Process COMPUTER SCIENCE, SOFTWARE ENGINEERING-
自引率
10.00%
发文量
109
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信