2020Unpublished venueOpen access

Testing Smart Contracts Gets Smarter

Erfan Andesta, Fathiyeh Faghih, Mahdi Fooladgar

Open full text 6 citations

Abstract

Smart contracts are immutable, verifiable, and autonomous pieces of code that can be deployed and ran on blockchain networks like Ethereum. Due to the immutability nature of blockchain, no change is possible on a deployed smart contract or a verified transaction. On the other hand, there are millions of dollars carried by smart contracts in Ethereum blockchain, and hence, a faulty smart contract can lead to a huge monetary loss. Therefore, it is important for smart contract developers to fully test and check the correctness of their code before deploying it on the blockchain. In this paper, we propose a testing mechanism for smart contracts in the Solidity language, based on mutation testing. We analyzed a comprehensive list of known bugs in Solidity smart contracts and designed 10 classes of mutation operators inspired by the real faults. Our experimental results show that our proposed mutation operators can regenerate 10 out of 15 famous faulty smart contracts, which have resulted in millions of dollars loss. We also have extended the Universal Mutator tool with our mutation operators to generate mutants for smart contracts written in Solidity, automatically.

Open-access reader

About this research paper

What this paper is about

Smart contracts are immutable, verifiable, and autonomous pieces of code that can be deployed and ran on blockchain networks like Ethereum. Due to the immutability nature of blockchain, no change is possible on a deployed smart contract or a verified transaction. On the other hand, there are millions of dollars carried by smart contracts in Ethereum blockchain, and hence, a faulty smart contract can lead to a huge monetary loss. Therefore, it is important for smart contract developers to fully test and check the correctness of their code before deploying it on the blockchain. In this paper, we propose a testing mechanism for smart contracts in the Solidity language, based on mutation testing. We analyzed a comprehensive list of known bugs in Solidity smart contracts and designed 10 classes of mutation operators inspired by the real faults. Our experimental results show that our proposed mutation operators can regenerate 10 out of 15 famous faulty smart contracts, which have resulted in millions of dollars loss. We also have extended the Universal Mutator tool with our mutation operators to generate mutants for smart contracts written in Solidity, automatically.

Why it matters

OpenAlex reports 6 citations for this work. Citation counts describe recorded attention and do not establish research quality.

Key contribution

A contribution statement is not available in the OpenAlex record.

Method / approach

Method details are not available in the OpenAlex metadata.

Main findings

Findings are not separately available in the OpenAlex metadata.

Limitations

Limitations are not available in the OpenAlex metadata.

Applications

Application details are not available in the OpenAlex metadata.

Available abstract

Smart contracts are immutable, verifiable, and autonomous pieces of code that can be deployed and ran on blockchain networks like Ethereum. Due to the immutability nature of blockchain, no change is possible on a deployed smart contract or a verified transaction. On the other hand, there are millions of dollars carried by smart contracts in Ethereum blockchain, and hence, a faulty smart contract can lead to a huge monetary loss. Therefore, it is important for smart contract developers to fully test and check the correctness of their code before deploying it on the blockchain. In this paper, we propose a testing mechanism for smart contracts in the Solidity language, based on mutation testing. We analyzed a comprehensive list of known bugs in Solidity smart contracts and designed 10 classes of mutation operators inspired by the real faults. Our experimental results show that our proposed mutation operators can regenerate 10 out of 15 famous faulty smart contracts, which have resulted in millions of dollars loss. We also have extended the Universal Mutator tool with our mutation operators to generate mutants for smart contracts written in Solidity, automatically.

Key concepts: Solidity, Smart contract, Blockchain, Correctness, Computer science, Immutability, Computer security, Code (set theory)

Related papers

Back to paper searchBrowse research topicsOriginal source
Testing Smart Contracts Gets Smarter — Research Paper | ScholarLens