Test-Driven development (TDD) is a process of repetition of a short development cycles. The developer writes automated test cases with the minimum amount of code to pass testing. Little by little, with testing along the way, in other words.
- Write test
- The benefit of TDD over Unit testing: the developer focuses on the requirements before writing the code.
- Run All Tests, see if new ones fail
- Test the Test
- Write code that is designed to pass the test.
- Run Tests
- Code must pass test requirements & not break or degrade existing features.
- Refactor Code
- Growing code must be cleaned.
- Remove duplication
- Object, Class, modules, variables, and method naming must be Clear
- Improve Readability, Maintainability
1. Setup 2. Execute 3. Validate 4. Cleanup