Live data from Hacker News

Test-Driven Development Bypasses Your Brain

stoneship.org

31–40 of 67 posts

Re: Test-Driven Development Bypasses Your Brain

#31

Earlier quoted context omitted.

> I probably agree that 100% test passes doesn't equal no bugs. TDD never promised that, and practitioners of TDD understand that 100% coverage doesn't mean you won't have bugs. This doesn't invalidate the TDD or testing (as you are obviously aware of =)).

Sure you will still have bugs. The question is whether the reduction in bugs due to TDD outweighs the increased investment in developer and tester time. Because for those of us who do TDD every day the blowout in time is at minimum 2-3x longer than without it. Not to mention the detrimental impact on build times. All of that aside. Have you noticed how there are no decent metrics available for TDD's effectiveness ?

> Because for those of us who do TDD every day the blowout in time is at minimum 2-3x longer than without it.

I do not know your environment, but TDD does not add 2-3x longer for most everyone I know that practice it. This is especially true when you factor in total development time. Most estimates I see place TDD making the project take 15-30% longer.

> All of that aside. Have you noticed how there are no decent metrics available for TDD's effectiveness ?

Not sure what you mean by that. There are metrics you can use (how else could they do studies on this?). It's been proven time and time again in studies (some are linked in these threads here).

Re: Test-Driven Development Bypasses Your Brain

#32

TDD in theory is a great idea. In practice it is dreadful. Because what has happened is that the obsession with code coverage has meant that developers create a whole raft of tests that serve no real purpose. Which due to TDD then gets translated into unworkable, unwieldy spaghetti like mess of code. Throw in IOC and UI testing e.g. Cucumber and very quickly the simplest feature takes 5x as long to develop and is bor…

You're supposed to refactor your code. Layering tests on top of tests means that you end up spending more time maintaining tests than writing code. Also, don't test stuff that isn't going to break, and avoid writing system and UI tests unless you absolutely have to.

People always ignore the refactoring. They also look at the time TDD adds merely in terms of individual sessions. They don't look at the project as a whole.

> Also, don't test stuff that isn't going to break

Hah! =) But how will I prove that i++; is actually incrementing i!

Re: Test-Driven Development Bypasses Your Brain

#33
post #8
post #2

I don't recall ever reading that just because you have tests, you should no longer understand the processes by which your code functions. Was this something that they've seen happen, or experienced personally?

I suspect the linked article is a straw-man built to provoke responses, and thereby create page views for the blog.

Yes, it's all a big conspiracy. Maybe there are some aliens involved too.

Why do some people always assume bait/trolling when no such thing appears even remotely possible (as is this case, which is a well reasoned and argued post), is beyond be.

You might disagree with the author, but we tries and provides arguments for what he writes.

Re: Test-Driven Development Bypasses Your Brain

#34
The "bold statement" is a little too bold. It goes from:

  |  writing code in a test-driven way bypasses
  | your brain and makes you not think properly
  | about what you are doing.
(Test Driven Development makes you not think properly and bypasses your brain) to:

  | no matter which software development methods
  | you use, do not forget to use your brain
"Just don't mindlessly program."

Re: Test-Driven Development Bypasses Your Brain

#35

The author made one slight mistake: he wrote "there is a tendency to mindlessly modify code" instead of " I have a tendency to mindlessly modify code". Also, it's not like this we haven't seen this kind of behavior decades before the invention of TDD. This is just another example of a craftsman blaming his tools. TDD is not a silver bullet, but no method or tool can serve as an excuse for mindlessly poking around unt…

I admit I did fall into that trap once, long ago. I’m very aware of the consequences now.

The reason for writing the article, however, is because I have seen the same mindless behaviour with other people as well.

Re: Test-Driven Development Bypasses Your Brain

#36

TDD in theory is a great idea. In practice it is dreadful. Because what has happened is that the obsession with code coverage has meant that developers create a whole raft of tests that serve no real purpose. Which due to TDD then gets translated into unworkable, unwieldy spaghetti like mess of code. Throw in IOC and UI testing e.g. Cucumber and very quickly the simplest feature takes 5x as long to develop and is bor…

It sounds like you've had some bad experiences. I'm not sure that you could attribute unwieldy spaghetti code to the use of TDD though. Do you believe the projects you've worked on with TDD would have been in better shape without TDD?

Re: Test-Driven Development Bypasses Your Brain

#38

TDD in theory is a great idea. In practice it is dreadful. Because what has happened is that the obsession with code coverage has meant that developers create a whole raft of tests that serve no real purpose. Which due to TDD then gets translated into unworkable, unwieldy spaghetti like mess of code. Throw in IOC and UI testing e.g. Cucumber and very quickly the simplest feature takes 5x as long to develop and is bor…

You're supposed to refactor your code. Layering tests on top of tests means that you end up spending more time maintaining tests than writing code. Also, don't test stuff that isn't going to break, and avoid writing system and UI tests unless you absolutely have to.

The problem is that that right now in the software industry:

TDD, Agile, Scrum, XP etc are a religion.

And a lot of people have managed to make their lives easier by making the teachings of this religion mandatory. So what I've been witnessing the last few years is that saying "no I don't think we need a test for this" is a position that will get you no where. So instead every one just puts up with longer and longer build times and spending more time each day fixing broken tests.

Re: Test-Driven Development Bypasses Your Brain

#39

The author made one slight mistake: he wrote "there is a tendency to mindlessly modify code" instead of " I have a tendency to mindlessly modify code". Also, it's not like this we haven't seen this kind of behavior decades before the invention of TDD. This is just another example of a craftsman blaming his tools. TDD is not a silver bullet, but no method or tool can serve as an excuse for mindlessly poking around unt…

I also have the same problem the author has sometimes: If I know that there are a lot of tests covering a particular piece of code, I tend to be less diligent making modifications
Post reply on HN