Test-driven Development Cycle
- Write tests first
- Run all tests, the new tests should fail for expected reasons
- Write the simplest code that passes the new test (All tests should pass now)
- Refactor as needed, using tests after each refactor to ensure that functionality is preserved
- Repeat
- TDD is primarily a developer’s tool to help create well-written unit of code (function, class, or module) that correctly performs a set of operations.
Links
See also: