TDD, Refactoring
Using Gilded Rose Kata
http://blog.cleancoder.com/uncle-bob/2014/12/17/TheCyclesOfTDD.html
Focus
Confidence Progress
Simple Design Rules
- Passes the tests
- Reveals intention
- No duplication
- Fewest elements
Warm up?
TDD Rules
- You can’t write production code without a failing test
- You can’t have more than one failing test at a time
- You can’t write a new test until your code is properly
refactored
Simple Design
- Passes the tests
- Reveals intention
- No duplication
- Fewest elements
Gilded Rose Kata
bit.ly/gilded_rose_kata
Learnings/Feedback
Existing code?
Lets Start with refactoring
Learnings/Feedback
Extreme OOP
OOP Rules
- Use only one level of indentation per method
- Don’t use the else keyword
- Wrap all primitives and strings
- Use only one dot per line
- Don’t abbreviate
OOP Rules
- Keep all entities small.
- Don’t use any classes with more than two instance
variables.
- Use first-class collections.
- Don’t use any getters/setters/properties
Thank you!!!
@leenasn / leena@continuousdelivery.in
https://medium.com/@leenasn
https://medium.com/continuousdelivery
References
All the Little Things - Sandi Metz
Gilded Rose Kata - Emily Bache
Extreme OOP
Why getters and setters are evil?
I Pity The Fool Who Doesn't Write Unit Tests - Jeff Atwood
Why TDD - Naresh Jain

TDD, Refactoring - Workshop