Chapter 6: Truffle: Testing Smart Contracts

by Mislav Javor

In our introduction to Truffle, we discussed what Truffle is and how it can help you automate the job of compiling, testing and deploying smart contracts.

In this article, we’ll explore how to test smart contracts. Testing is the most important aspect of quality smart contract development.

Why test extensively? So you can avoid stuff like this, or this. Smart contracts handle value, sometimes a huge amount of value — which makes them very interesting prey for people with the time and the skills to attack them.

You wouldn’t want your project to end up on the Blockchain graveyard, would you?

Getting Started

We’re going to be making HashMarket, a simple, smart-contract based used goods ...

Get Ethereum: Tools & Skills 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.