10 Testing smart contracts

 

This chapter covers

  • Importance of testing smart contracts
  • Writing test scripts in JavaScript
  • Truffle frameworks to support smart contract testing
  • Interpreting the outputs from executing test scripts
  • Developing test scripts for the counter, ballot, and blind auction smart contracts
 

10.1       Importance of testing smart contracts

 
 
 
 

10.1.1   Types of testing

 
 

10.1.2   Language choice for test programs

 
 

10.2       Testing counter smart contract

 
 
 

10.2.1   Writing counter test script

 
 

10.2.2   Positive and negative tests

 

10.2.3   Running the test script

 
 
 

10.3       Testing ballot smart contract

 
 
 
 

10.3.1   Writing the ballot test script

 
 
 
 

10.3.2   Executing the ballot test script

 
 
 

10.3.3   Describe() and it() test functions

 
 

10.4       Recap writing of test script

 
 
 

10.5       The blindAuction test script

 

10.5.1   Analysis of describe() and it() code

 
 
 

10.5.2   Executing the blind auction test script

 
 
 

10.6       Wrapping it up

 
 
 

10.7       Best practices

 
 
 
 

10.8       Summary

 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest