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 language | English |
|---|---|
| Pages | 264-273 |
| Number of pages | 10 |
| State | Published - 2020 |
| Externally published | Yes |
| Event | Conference 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 2019 → 6 Nov 2019 |
Conference
| Conference | Conference of the Centre for Advanced Studies on Collaborative Research - 29th Annual International Conference on Computer Science and Software Engineering, CASCON 2019 |
|---|---|
| Country/Territory | Canada |
| City | Markham |
| Period | 4/11/19 → 6/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
- APA
- Author
- BIBTEX
- Harvard
- Standard
- RIS
- Vancouver