What my Milk Thermometer Taught me About TDD
Last christmas (yeah I know long time ago, bear with me) I got a Milk Thermometer as a Christmas Present from my In-Laws. Even though they have probably spoken to my wife about that - it still amazes me how awesome they are at picking gifts for that I end up loving.
Surprisingly getting this thermometer was an eye opener on several fronts. After having had a Espresso Machine for several years, and have made my share of Cappucinos and Lattes without a thermometer - what it gave me in quality was crazy.
Instant feedback on what must be correct (temperature / business logic) lets you focus on what is important and fun (frothing / design). After making my coffee drinks a couple of days with my new thermometer I was amazed how much better I had gotten at frothing the milk. It was a bit baffling for me - until I related it to my day job.
By letting me no longer use creative energy to guess/feel what temperature the milk had (it was measured instead), my focus could now be 100% on the techniques necessary for making froth. This was exactly the epiphany I had when I started doing TDD.
A lot of people advocates testing first because it will ensure that you write correct code. In my opinion it is not completely right. I have not written more correct code because of testing - correctness is about the same. However the quality of the code has improved - since what has to be correct is measured, what can change is easier to do.
The instant feedback of exact measurements makes you work in a kind of flow, that allows you to do more, better and more creative work.