DEV Community

Discussion on: 7 Reasons You Should Be Using Test-Driven Development

Collapse
 
n_develop profile image
Lars Richter

Hi Hudson,

nice post. Thank you for your thoughts on that.

TDD is something most computer science students are taught, but are never actually required to use

In my experience it is pretty different. During my studies, nobody taught us TDD. Of course we had some courses that showed how unittests are used. But that's pretty much it. TDD is so much more than unittests.

And you can get away without doing it for most of your coursework. (I have some thoughts on that here.)

The link on "here" is broken. I would be very interested on your thoughts on that. What is the correct link?

I also have some feedback on your 7 reasons.

  1. You’ll code faster

I'm not sure about that. Especially when you start using TDD, it will slow you down. BUT: I agree with the description of the point. You have a clear target. And that's important.

  1. It provides a solid starting point for later work.

Another good point: Always leave work with a failing test. This will bring you right back into focus on the next morning.

Collapse
 
hudsonburgess7 profile image
Hudson Burgess

Fixed the link, thanks for the heads-up!

--

I can understand TDD slowing down folks that haven't used it before, but I actually didn't experience that. Writing and passing one test at a time forced me to think about my code in smaller, more obvious pieces (read: shorter functions) and move faster from day 1.

--

Always leave work with a failing test. This will bring you right back into focus on the next morning.

Genius; I hadn't considered that.