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

Master useEffect in a single afternoon - 50% off!
2 days 11 hours 1 mins 8 secs


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 more articles like this?

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.

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