DEV Community

ruthmoog
ruthmoog

Posted on

Book Club: "Test Driven Development: By Example" #12

Chapter 12: Addition, Finally

There's need of some thinking for this chapter, where we begin chipping away at addition.

Some things that stuck out for me, was our To Do list hygiene - as the list starts to get longer we can discard the 'done' items, and copy across the remaining tasks; this gives an opportunity to finish off items that are not worthy of being written onto the new list.

We also started to think about reduce as a bucket or wallet to collect Money. I first learned about reduction in programming in Ruby, and visualise the concept as a bucket and spade, processing each shovelful into the bucket. You're applying some function to elements in a list, and saving the result.

The next step will be refactoring our new green test to make the implementation real.

🔎 View my code-along repo at https://github.com/ruthmoog/test-driven-development-by-example


Book cover Kent Beck's "Test Driven Development: By Example" was released in 2002. The book aims to explain how to use TDD to write quality code that works.

Discussion (0)