Skip to content

Instantly share code, notes, and snippets.

@donabrams
Created August 14, 2017 19:03
Show Gist options
  • Save donabrams/30eaa4b41dfd3ee3f32173c217c0a4bb to your computer and use it in GitHub Desktop.
Save donabrams/30eaa4b41dfd3ee3f32173c217c0a4bb to your computer and use it in GitHub Desktop.
Testing tips
1. Choose your boundary
2. Identify state
3. Test *just* the boundary
4. Any test that will be maintained (non-TDD) should have a positive and negative test
5. Unit tests can be thrown away at will
6. DRY/inheritance is usually bad in test code, especially if stateful
7. Try to colocate data and code as much as possible
8. Make randomness and time explicit
9. It’s best to write tests FIRST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment