This chapter covers
- What test-driven development (TDD) is and how to apply it
- Reasons to adopt TDD
- How TDD fosters intrateam and extrateam collaboration
- Different approaches to applying TDD
- When to apply TDD and when not to
- How to create an adequate environment for TDD to succeed
- What behavior-driven development is, how it relates to TDD, and why to adopt it
Imagine that today is one of those days you woke up inspired to bake the best banoffee pies the east side of London has ever tasted. You’ve already bought all the biscuits, the bananas, tons of sugar, and the tastiest condensed milk one can find. Your industrial oven is preheated and ready for some serious baking.
After preparing quite a few pies, you put them in the oven, and, when the timer rings, you run straight back to the kitchen to try one. The smell is so delightful it makes your eyes gleam, but, when you try a slice, it’s not nearly as good as you expected.
Unfortunately, it looks like you’ve bought the wrong kinds of bananas. Besides being the wrong species, they were just like your tests should be: too green.