Chapter 4. Concepts and patterns for TDD

 

I remember growing up with television, from the time it was just a test pattern, with maybe a little bit of programming once in a while.

Francis Ford Coppola

In chapters 2 and 3, we saw test-driven development being used for developing a template engine. That example was intentionally what many would consider a trivial case—a sort of “ideal” scenario with no tough cookies to crack. In this chapter, we’ll study different patterns and techniques that a seasoned test-driven developer can pull out from their toolbox when the going gets tough. These patterns range from design patterns that we can apply to our production code for making it more testable to different ways of organizing and implementing our tests. I’m about to reveal some heavily guarded secrets of the guild. Don’t tell anyone.

4.1. How to write tests and make them pass

 
 
 
 

4.2. Essential testing concepts

 
 
 

4.3. Closer look into test doubles

 

4.4. Guidelines for testable designs

 
 

4.5. Unit-testing patterns

 
 
 
 

4.6. Working with legacy code

 
 
 
 

4.7. Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest