Where to Start?

Let’s get started with the TDD process.

Good options for starting a TDD cycle are:

  • To specify the objects’ initialization state or methods under test
  • Happy path: A single representative example of the error-free version of the algorithm

Which starting point we choose depends on how complicated the feature is.

TDD starting points

In this course, we’ll start with the initial state and will later move to the happy path. As a rule of thumb, if it takes more than a couple of steps to define an application’s instance, we’ll only start with initialization. Here’s some pointers to begin with:

  • Instead of thinking about what will make a test pass, think about making it fail. If there’s no way to make even a new test fail, ...