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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.