Test writing best practices

  1. Unit test structure:
  • Setup
  • Execution
  • Validation
  • Cleanup
  1. Avoid anti-patterns:
  • test case depending on the system state from the previous test
  • dependencies between test cases
  • don't inspect more than necessary
  • slow running tests