This question already has an answer here:

What tools there exist to run automate test suite against Solidity contracts?

  • Set up scenarios how transactions are executed

  • Assert the contract state variables are valid after execution

marked as duplicate by galahad, eth Jul 7 '16 at 17:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.