URL
Cycle of TDD
- Decide Next Target
- Write Test Code To Achieve The Target
- Make The Test Fail To Run(RED)
- Write Objective Code
- Make It Success That The Test Code At Step3(Green)
- Do Refactoring Keeping Test Case Success(Refactor)
- Go Back Step1
Golden Cycle
- Red(Beautiful/Not Work -> Durty/Not Work)
- Green(Durty/Not Work -> Durty/Work)
- Refactoring(Durty/Work -> Beautiful/Work)
Merit of TDD
Physiological Thing!
- To Get Feedback Immediately
- To Get Confidence For Your Code
- To Get Confidence For Your Code In The Future
Fragile Test
- It Takes Too Much Time For Developing
- It’s Too Detail
- Other Test Depends On It
Fake it
- Implementation For Test
- To Use For First Implementation
- Return Const Value At First
- After Success The Test Case, Change Case From Const Value To Expressionく
Book