Key takeaways from my TDD training sessions

Recently I had the chance to participate to a Test Driven Development session. Until now I never tried TDD I just simply used the TFP (Test First Programming), so let’s see what are the differences between Waterfall model, TDD and TFP. After that I’ll list some key points about doing TDD.

Waterfall processProgrammers’ headache started in 1970 when Winston Royce published the Waterfall model. This model was based on a set of sequential steps: Analysis, Design, Code, Test, Maintain. The big assumption made was that the design precedes the coding phase and the testing phase comes after the coding. A very structured approach. This is a description of a well defined process which works great on other industries but the practice proved that software development is an empiric process rather than a very well defined one and for such process you need a short feedback loop. This assumption is the foundation of the agile methodologies which are surfacing the project problems since the beginning.

Test first modelTest Driven Development and Test First Programming are reducing the gap between testing and design allowing you to adapt your design as you go. The Test First Programming assumes that you have a design upfront and you start your coding by writing tests to validate your design. The loop is only between code and tests but no for design. This is in fact a longer development cycle because the design is corrected at the later time.

Test Driven Development CycleTDD assumes that you don’t have design upfront, your design emerges with the code and you have a loop between all three key elements: Test, Design, Code. Now you can incorporate testing feedback into design and code as you go. Such a cycle should take around 30 minutes.

The four golden rules of TDD:

Read more