Live data from Hacker News

Test-Driven Development is Stupid

geometrian.com

1–10 of 154 posts

Re: Test-Driven Development is Stupid

#4
A while back I described the benefits I think unit tests give you:

1. Well-tested parts

2. Decoupled design

3. Rapid feedback

4. Local context to test in.

At the same time, there are many cases where they don't help much. More here: http://henrikwarne.com/2014/09/04/a-response-to-why-most-uni...

Re: Test-Driven Development is Stupid

#5
post #3

I genuinely wanted a good critique (It's nice to get dissenting viewpoints) but reading text so charged with anger and so scant in information is stressing me out.

agreed - there are certainly some disadvantages to TDD, and I was hoping for an discussion raising some ideas I'm yet to formulate fully.

Instead there were lots of parallels that I don't recognise.

It was disappointing the author didn't seem to try and find the advantages in TDD and discuss a counter argument or alternative, such as modifying a foreign code base.

Re: Test-Driven Development is Stupid

#6
> I am against writing unit tests in general, since experience shows that they actually prevent high-quality code from emerging from development

And he's lost me in his first sentence.

Unit testing, good unit testing at least, is not just about developing as it is about preventing regressions. A unit test that runs on every build ensure that something is true and that it stays true forever.

Re: Test-Driven Development is Stupid

#8
post #6

> I am against writing unit tests in general, since experience shows that they actually prevent high-quality code from emerging from development And he's lost me in his first sentence. Unit testing, good unit testing at least, is not just about developing as it is about preventing regressions. A unit test that runs on every build ensure that something is true and that it stays true forever.

This. I agree TDD can cause more harm than good in software design, but my test suite saves me from shipping several regressions per day that I would have otherwise not noticed.

Obviously if you are against testing in general you are against TDD (it's just testing taken to the extreme).

I thought he at least was going to say that he preferred higher level testing, to low level unit tests (which can be a fair point, you can find 90% of the issues with 10% of the test code if you accept that you can't always isolate the failure based on the test report). But no. He is against testing.

Re: Test-Driven Development is Stupid

#9
post #6

> I am against writing unit tests in general, since experience shows that they actually prevent high-quality code from emerging from development And he's lost me in his first sentence. Unit testing, good unit testing at least, is not just about developing as it is about preventing regressions. A unit test that runs on every build ensure that something is true and that it stays true forever.

It depends what you're developing, and who you're developing with.

If you're developing something which must work 100% every time or else someone will die, then unit tests are a must.

If you're developing with people who break the build all the time, then unit tests are useful.

Unit tests that aren't 100% up to date with the code are worse than no unit tests.

Re: Test-Driven Development is Stupid

#10
post #6

> I am against writing unit tests in general, since experience shows that they actually prevent high-quality code from emerging from development And he's lost me in his first sentence. Unit testing, good unit testing at least, is not just about developing as it is about preventing regressions. A unit test that runs on every build ensure that something is true and that it stays true forever.

Indeed. I was ready to hear a rant about TDD with an open mind since I have some issues with it myself, but the opening line completely ruined it. He might as well rally against refactoring because unit tests are essential part of that too.
Post reply on HN