Skip to main navigation Skip to search Skip to main content

SolUnit: A framework for reducing execution time of smart contract unit tests

  • Federal University of Santa Catarina
  • University of Ottawa
  • University of Toronto

Research output: Contribution to conferencePaperpeer-review

8 Scopus citations

Abstract

Smart contracts are software programs implemented on a blockchain platform that monitor and automate the execution of contracts to ensure compliance with the terms and conditions of a contract. As such, smart contracts represent a new kind of software that poses its own engineering challenges and requires novel software engineering techniques. In particular, smart contracts require thorough testing before they are deployed because they can't be changed after deployment. This paper proposes a novel approach for executing unit tests for smart contracts intended to reduce test execution time. This reduction is achieved through the reuse of the deployment execution of the smart contract in each test and also the reuse of the setup execution of each test. We implemented the framework SolUnit that uses this approach to execute tests written in Java for Ethereum Solidity smart contracts. We also evaluated the framework SolUnit in five projects. The results show that our approach achieves a meaningful reduction of the time to execute the tests, without breaking the principle of independent tests. The experiments were performed in two environments: an in-memory simulated blockchain and a private Ethereum-based blockchain. Overall, our approach was able to reduce the test execution time by up to 70%.

Original languageEnglish
Pages264-273
Number of pages10
StatePublished - 2020
Externally publishedYes
EventConference of the Centre for Advanced Studies on Collaborative Research - 29th Annual International Conference on Computer Science and Software Engineering, CASCON 2019 - Markham, Canada
Duration: 4 Nov 20196 Nov 2019

Conference

ConferenceConference of the Centre for Advanced Studies on Collaborative Research - 29th Annual International Conference on Computer Science and Software Engineering, CASCON 2019
Country/TerritoryCanada
CityMarkham
Period4/11/196/11/19

Keywords

  • Blockchain
  • Ethereum
  • Smart Contract
  • Software Testing
  • SolUnit
  • Solidity
  • Test Automation
  • Testing Framework
  • Unit Testing

Fingerprint

Dive into the research topics of 'SolUnit: A framework for reducing execution time of smart contract unit tests'. Together they form a unique fingerprint.

Cite this