...

/

Making the Test Pass

Making the Test Pass

Learn TDD starting points and how to make the first test pass.

TDD starting points

Now it’s time to make the first test pass.

But how?

It seems like a straightforward question, but it has a few different answers.

  • The purist way: Do the simplest thing that could work. In this case, work means to minimally pass the test without regard to the larger context. Or it might even mean to “write the minimum amount of code to clear the current error without regard to the larger context.”
  • The practical way: Write the code we know we need to eventually write, effectively skipping steps that seem too small to be valuable.
TDD starting points
  • The teaching way: This method is somewhere between the other two and lets us best explain how and why test-driven development works without getting bogged down in details or skipping too many
...