Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Is TDD dead?

In all the older Treehouse projects, there was a major focus on TDD, maybe to the extreme. Jim Hoskins and Jason Seifer use TDD extensively in Treebook and Odot, though moving from unit testing to Rspec.

Then Hampton Catlin (side note: how are there so many Hamptons at Treehouse???) seems to abandon testing entirely with Biller, and he's previously said he wrote the course with a mind toward real-world development. I also know there's some controversy surrounding this issue in the Rails community. So which would be the more practiced/accepted form in true development?

5 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

TDD is definitely not dead. In fact, many companies still list TDD and testing as a requirement for getting a job. The position DHH takes with "TDD is dead" is said with the nuances of a very experienced and very skilled programmer. One should be familiar with and have experience with this kind of process in order to decide whether or not it works for them. TDD is very much not dead in the workplace and many companies still practice it.

With that said, I will be introducing it later on in the Ruby and Rails courses as they are being refreshed. Testing in any form can be overwhelming to introduce along with other concepts. Student feedback has indicated that as well.

In summary: TDD is not dead and still learn to do it :)

Jason Seifer you guys are doing an awesome job updating the courses. A while ago it was easy to get bogged down debugging errors caused by newer versions of Ruby, Rails, and everything else. Now I can't keep up with the pace you're releasing new courses.

I feel like a lot of testing done for Treebook and Odot was purposeful overkill to really nail down the different test scenarios. And I think it's important to give students and idea of where to draw the line between necessary testing and overtesting, if there is one.

DHH gave a really interesting keynote at Rails Conf this year declaring that TDD is "dead," but there's still a lot of debate and disagreement on the matter, kind of a matter of personal preference :) Here's a link to his write-up on it.

Justin Horner
STAFF
Justin Horner
Treehouse Guest Teacher

Hello Adam,

The short answer is no: TDD is not dead by any means. It doesn't matter what technique is stated to be "dead" by any one person. It's simply a technique of which you can decide whether it makes sense or not for your project.

Always keep in mind the big picture over the small details. The big picture is that you are indeed including testing in your development workflow in some way. How and what technique used comes down to what makes sense for a given project.

The question of is TDD dead is for you to answer personally, as it can only be answered for an individual, not an entire industry.

I hope that helps.

Chase Lee
Chase Lee
29,275 Points

I agree with Jason, TDD is not dead. I'm personally on the fence for wether I will be using it or not - I currently do - the reason is because I like how specific TDD is and how you can easily test out everything. But what I don't really like about it is the interface as it's really hard to look at 500 words that seem to be in random order - stereotype programmer - in the end, I am probably leaning towards TDD as it is way more efficient.

Hope that helps.

-Chase

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

I talked to a senior Rails developer some time ago and he said simply that pure TDD in the form described in most places does not work, because you often don't have a strict plan on how the app will look like and work exactly, so in most cases they write tests afterwards to track regressions when the code is refactored and to document the application. Like DHH said - as long as you end up with a working application that has passing tests that document it at the same time, then it's fine and you don't have to force pure TDD on yourself or treat it as a religion. I believe he's right. I don't see any real advantage in writing the test before I write the feature. Just to see a red failure?