- Unit tests : to test individually each smallest software component
- Integration tests : to test a bigger chunk of software components together
- Acceptance tests : to ensure business expectations are met ( as part of the acceptance test-driven development methodology )
- End-to-end tests : to ensure every software component in the chain is working as expected, in a production-like environment
- Performance tests : to ensure the performance is not degraded by a fix or a new feature
Writing test also helps you think the problem you're rying to solve and clarifies your thinking. With TDD, it simply goes one step further: you write the test first, then the code.