Before you write any code, you write a failing test and then write enough code to get it to pass.
But implementing test-driven development is harder.
As well as overcoming the initial reluctance to write the tests first, it takes time to learn how to use it well.
Code katas are great for practising TDD, but it can take time to progress from that to using it in a full application with more pieces.
As with many things, practice and perseverance are key.
- Oliver
Was this interesting?
About me
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.