1. Chapters
  2. Should you use test-driven development (TDD)?


Should you use test-driven development (TDD)?

What I mean by TDD

To me, TDD means writing tests which fail before you start writing any code. Once the tests are written, you start writing the code that makes the tests pass.

All of the tools described in this book support both a TDD and a non-TDD approach.

It's not for me

I personally don't use TDD in my development workflow, as it doesn't fit with my mental model of how I code (I prefer rapidly iterating on a component, then at completion I write my tests).

If it works for you, great!

I'd highly recommend giving it a try, to see if you like it - but don't worry if you feel that it's not for you.

Don't feel forced to use TDD

I've rarely found companies require their frontend developers to use TDD (the ones that did also required quite a few other things, a huge red flag in my opinion).

Let's wrap this up with some Final Thoughts

Want to become a better React developer?

I send a single email every two weeks with an article like this one, to help you be a better React developer.

Lots of developers like them, and I'd love to hear what you think as well. You can always unsubscribe.

I'll even send you a free PDF copy of the book you're reading, The Beginner's Guide to React Testing, to start with.

The Beginner's Guide to React Testing book cover

Join 947 React developers that have signed up so far. See my privacy policy.