DEV Community

The best time to write tests

Sid on April 02, 2019

I wrote this post for my newsletter, sign up here to get emails like these every week. Me, from the past: "Writing tests for my code is pointles...
Collapse
 
brburzon profile image
Brandon Burzon

Thanks for sharing!

I have been bit by trying to force my new functionality into strongly coupled code before which caused me to introduce a non trivial bug when trying to save time (thankfully, it wasn't deployed to Production).

After reverting the commit, I restarted by refactoring the code first to make it easy to introduce my change and then adding my feature.

It turned out to be faster than my first attempt since TDD allowed me to catch potential bugs early and avoid spending most of my time debugging 😅

Collapse
 
siddharthkp profile image
Sid

nice!