Having covered the basics in part 1, I’ll now introduce the core testing and refactoring techniques necessary for writing tests in the real world.
In chapter 3, we’ll examine stubs and how they help break dependencies. We’ll go over refactoring techniques that make code more testable, and you’ll learn about seams in the process.
In chapter 4, we’ll move on to mock objects and interaction testing, we’ll look at how mock objects differ from stubs, and we’ll explore the concept of fakes.
In chapter 5, we’ll look at isolation frameworks, also known as mocking frameworks, and at how they solve some of the repetitive coding involved in handwritten mocks and stubs. Chapter 6 deals with asynchronous code, such as promises, timers, and events, and various approaches to testing such code.