10 Testing smart contracts

This chapter covers

  • Seeing the importance of testing smart contracts

  • Writing test scripts in JavaScript

  • Using Truffle frameworks to support smart contract testing

  • Interpreting outputs from running test scripts

  • Developing test scripts for the counter, ballot, and blind auction smart contracts

This chapter introduces you to a systematic approach for writing test scripts for the smart contracts of your Dapps. Testing is an essential step in any system development process: hardware or software. It is all the more critical for decentralized blockchain applications with unknown peer participants. In chapters 2-9, you tested the integrated Dapp consisting of the smart contract (Dapp-contract) and the app (Dapp-app) ...

Get Blockchain in Action now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.