Live data from Hacker News

TDD is dead. Long live testing.

david.heinemeierhansson.com

41–50 of 166 posts

Re: TDD is dead. Long live testing.

#41

> Over the years, the test-first rhetoric got louder and angrier, though. More mean-spirited. Where are those mean TDD zealots? Can you point me at blog posts or mailing list messages displaying such behavior? I've never seen it personally. On the other hand, now and again a blog post like this comes up that's full of disdain towards the practice of testing first. I do TDD because it helps me get my work done. I'm ha…

If you were developing rails apps in the mid-late 2000s then you'd have known too many to count. There was a period in time between 2005-2008 in Boston where if you didn't practice TDD you were persona non-grata. I think interestingly enough, a good number of those people now have 10+ years experience programming and now understand what those of us who had 10 years experience at that point in time were trying to tell…

The irony is that that attitude is something you see from rails people about anything that's currently fashionable in the rails world. And I think they picked it up from DHH himself. You didn't get the same kind of TDD zealotry among e.g. Django people.

Re: TDD is dead. Long live testing.

#42

I think he's conflating the separate concepts of Test Driven Development and Unit Testing. They can be done independently of each other. I agree that many other people also conflate them, and are zealots for (or against) them together, but they are still separate concepts. He does make some good arguments against Unit Testing, but he makes none against TDD.

Interesting. I agree with everything you wrote until the last sentence. I think he made some great arguments against TDD, but none against unit testing.

Re: TDD is dead. Long live testing.

#43
Yes let's move towards more coarse grained tests so we can lets the fine grained subtle bugs slip through. You know stuff like heartbleed. Theres a good idea.

To be fair a lot of unit test regimes wouldn't have caught something like heartbleed. Specifically cause it's a security issue and not necessarily a functional issue. But the point is software is damn complex and easy to screw up.

Maybe rather than doing ultimately less test (system instead of unit). We should be slowing down doing even more test at ALL levels (unit, system, GUI, security, performance, whatever) and building something to the best of our abilities. Or does that even matter anymore in the MVP build and sell quick software world?

Re: TDD is dead. Long live testing.

#44
While the idea of testing is good, TDD is so full of stupid quirks and BS disguised as "best practices" it's not even funny

These often result in slow (and sometimes useless) tests. If you want to use TDD to have more time at the foosball table, great

Tests that only test one thing? So I have 30% tests/condition check (or less) and the rest as boilerplate?

"and I do not write software test-first"

Me neither. It's idiotic

Also, TDD fanatics have a tendency of building software that has great coverage and thousands of tests, but fail the simplest of smoke tests.

The world has not had TDD for a long time, and software got delivered. (And sometimes much more stable and durable than today's "one update per week" software)

Re: TDD is dead. Long live testing.

#45
Whilst I'm generally pro-TDD (and personally haven't seen or experienced any snobbery against folks who are not), I can see how test-first can seem grating to people. However, I would say TDD, a long with a more decoupled architecture, has a primary advantage over system-test only; division of labour. By not relying on databases or web-services to be implemented, we can work more in parallel, as long as the interfaces to these external systems are stable. If you only have system tests, you have to work in sequence.

Re: TDD is dead. Long live testing.

#47
Hear, hear. Dogmatic adherence to any system is dangerous. It goes along with being dogmatic. It's important for developers to read what others have done, see how others have solved problems and stand on the shoulders of giants before thinking for themselves, instead of just blindly accepting "best practice" as the best practice.

What I like to do with TDD is use it whenever it's the quickest way to develop something with a level of confidence that is appropriate to the situation.

If I'm creating an HTTP API and someone else is writing the front-end, I'll create unit tests that spin up my API and make requests to it to ensure I get the correct responses.

If I'm in the middle of a codebase somewhere and there's a function which is only ever hit after a bunch of others things, I'll probably write a few tests for that, too.

Just like religious dogma, we are free to pick-and-choose what we do with TDD, when we feel it's most appropriate. Of course, don't overdo it to the point where the code suffers for it.

Re: TDD is dead. Long live testing.

#48
The problem is that people think test driven design leads to good design. It does not. It does not even lead to design at all. All it does is create testable code. This code might have good design, or it might not.

Re: TDD is dead. Long live testing.

#49
I've been slowly coming to this realization myself lately, I thought our situation was just outside the mainstream of what most people work on, but maybe not.

Our team builds data-intensive biomedical web applications (open source project for it all here: http://harvest.research.chop.edu). Much of our UI is data-driven, so many of the bugs we encounter are at the intersection of code, config, and unique data circumstances. While a lot of the low-level components can be unit tested, individual apps as a whole need functional testing with real (or real enough) data for us to consider them sufficiently tested. The effort required to mock out things is often higher than just cloning production and running new code on top of existing data. This gets complicated in a hurry when you also have to introduce schema migrations before you can test. It's almost like we need to be doing integration testing, far, far earlier than you would normally.

Furthermore, the reality is that what started out as a Django app now has almost as much client-side JavaScript as it does Python code. This complicates the testing picture further, and I suspect many teams pushing things further in the direction of true web applications are starting to bump into this more and more.

Re: TDD is dead. Long live testing.

#50

While the idea of testing is good, TDD is so full of stupid quirks and BS disguised as "best practices" it's not even funny These often result in slow (and sometimes useless) tests. If you want to use TDD to have more time at the foosball table, great Tests that only test one thing? So I have 30% tests/condition check (or less) and the rest as boilerplate? "and I do not write software test-first" Me neither. It's idi…

The world has not had TDD for a long time, and software got delivered.

That's an argument against any kind of improvement; you can replace "TDD" with anything introduced since people started writing software.

Post reply on HN