0
Upcoming SlideShare
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Standard text messaging rates apply

# Test, transform, refactor

3,276

Published on

Let's have a close look into the Red-Green-Refactor cycle and understand the subtleties of each step. When we go down the rabbit hole of Test Driven Design we sometimes take too big steps leading us …

Let's have a close look into the Red-Green-Refactor cycle and understand the subtleties of each step. When we go down the rabbit hole of Test Driven Design we sometimes take too big steps leading us to many failed tests we just can bring back to green without writing a lot of code. We need to take a step back and take the shrinking potion of baby steps again. This very illustrative talk, full of test and code examples, will dig into each of the steps of TDD to help you understand how to keep a sustainable pace that will lead you in the right track.

Published in: Technology
10 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total Views
3,276
On Slideshare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
27
0
Likes
10
Embeds 0
No embeds

No notes for slide

### Transcript

• 1. TEST, Test, Test, Test, Test, TRANSFORM, Transform, Transform, Transform, REFACTOR Refactor Refactor Refactor Refactor PHPUK 2014 by @_md
• 2. Learning @_md Marcello Duarte Lead developer Head of Training Kata sensei
• 4. Kata form movement practice deliberate
• 5. 20 minutes throw away TDD refactor Kata
• 6. Test Refactor Code
• 7. no code without test TDD 3Rules enough to go red enough to go green
• 8. no code without test Test enough to go red Code enough to go green
• 9. Refactor tests run and pass dry sign remove opacity De ple Sim simplify 4Rules
• 10. The Roman Numerals Kata
• 11. Converting arabic numbers into their roman equivalent ! e.g. 2149 => MMCXLIX
• 12. Test Make it red Code Make it green Refactor Make it right
• 13. The Roman Numerals Kata gone wrong demo
• 14. Introducing TPP
• 15. Test Make it more specific Transform Make it more generic Refactor Put on the design hat
• 16. null to constant constant to constant+ constant to scalar statement to statements unconditional to if if to while Transformations (just the most basic ones)
• 17. * in PHP http://www.ﬂickr.com/photos/jorendegroof/4471189540/ Jim Weirich’s Roman Numeral Kata*
• 18. Walking skeleton [Cockburn 94]
• 19. Transformation null -> constant
• 20. Transformation unconditional -> if
• 21. Transformation statement -> statements
• 22. Transformation unconditional -> if
• 23. Refactor time?
• 24. Transformation if -> while
• 25. Condition to loop transformation ! is a great indicator you are in the right track of solving the algorithm [Martin 13]
• 26. Katas and Learning
• 27. Kata Deliberate Practice Koan Deliberate Learning • Optimising for performance • Optimising for discovery • Minimising variance • Maximising variance [North 12]
• 28. Learning TDD is learning all that TDD does for you
• 29. “The beauty of a move lies not in its' appearance but in the thought behind it.”
• 30. My System elements of chess positional play illustrative games
• 31. First learn the elements of design Then learn how to drive it with test
• 32. Marcello Duarte we are hiring try phpspec! follow @_md
• 33. inviqa.com/tdd-immersion-day/
• 34. Thank you !