A big part of writing good automated tests is understanding why to write each test. While this seems obvious, people rarely think about it. When I write a test, I make sure that it achieves at least one of the following goals:
- Verify that the product meets the business requirements
- Give cover for future change
- Document intent