# How to unit test smart contracts

How are Ethereum contracts tested? I've seen Truffle which referrers to itself as an Ethereum development framework. Are there any other frameworks and what is their level of maturity? Is there a de facto standard framework used by most contract developers?

How would one go about testing the Greeter contract (https://chriseth.github.io/browser-solidity/) for example?

# Via a Framework

There are currently four primary frameworks available that can facilitate writing unit tests for your contracts. Listed in order of Github stars as of 2016-01-25.

Disclaimer: I'm the author of the Populus testing library.

## Embark

This is the framework with the widest adoption.

## Populus

• "Do any of these frameworks allow systematic testing of the effect of out of Gas exceptions?" I'm not exactly sure what you mean by this. I know that with Populus you can test this by seeing that a TransactionError exception is raised as well as verifying that the gasUsed value from the transaction receipt is 100% of the provided gas. – Piper Merriam Feb 27 '16 at 2:37