DEV Community

Discussion on: How I Learned to Stop Worrying and Love TDD

Collapse
 
nombrekeff profile image
Keff

Nice post, man.

I can confirm that TDD can be not very fun at times, I tried it back in the day but it never clicked.

I've recently started doing TDD and man, is it worth it... I really like the feeling of advancement, and micro-wins, It makes it a lot smoother as you said. It also makes me feel more confident about the code I deploy, knowing that there are no silly bugs or weird side effects.

TL;DR
I decided to start doing TDD after working on a legacy app I acquired, we made a rough tech-dept estimation when we started working on that system. We calculated it was around 3.6yrs for a project that was 1yr old... crazy stuff...

I've been working on this project for the last 2 years and made a couple of reworks and reactors, but even though I have improved it quite a bit, but deadlines and feature requests keep coming, and bugs keep arising because "If you polish a piece of shit, it will keep still be a piece of shit". And adding TDD or even unit tests is almost impossible at this stage.

After dealing with this for so long, I've been adding TDD to newer projects from the beginning. As to not make the same mistakes the previous devs did on that system... I sleep so much better since :P

Collapse
 
barakplasma profile image
Michael Salaverry

Thanks for reading my post! I'm glad it resonated with you.

Working on a legacy project without tests can be intimidating. I have personally done that too, and it requires great care. I feel you 💚

I think it's awesome you're using TDD for your greenfield projects. TDD for the win!

Collapse
 
nombrekeff profile image
Keff

It was worth the read!

Yea, definitely intimidating... and mentally demanding as well.