You don't need to think about what to do next

When practising test-driven development, you don't need to think about what to do next.

If you have a failing test, the objective is to get that test to pass as quickly and simply as possible, and you rely on the error from the failing test to tell you the next step.

It could be a failing assertion, an undefined variable or function, or a yet-to-be-implemented service.

Once you've fixed that error, the test will either pass or fail. If it fails, you'll have a new error and know the next step.

When working in this way, it's like being on autopilot. You can focus only on fixing each error until the feature or fix is complete and the test is passing.

- Oliver

P.S. Need help or want another pair of eyes on your code? Book a 1-on-1 consulting call or an online pair programming session with a 100% money-back guarantee.,

Was this useful?

Sign up here and get more like this delivered straight to your inbox every day.

About me

Picture of Oliver

I'm an Acquia-certified Drupal Triple Expert with 17 years of experience, an open-source software maintainer and Drupal core contributor, public speaker, live streamer, and host of the Beyond Blocks podcast.