Live data from Hacker News

Test-Driven Development Bypasses Your Brain

stoneship.org

1–10 of 67 posts

Re: Test-Driven Development Bypasses Your Brain

#4
TDD is good for verifying that your code handles the set of requirements given by the customer - including any edge cases that matter to them. I probably agree that 100% test passes doesn't equal no bugs.

Nonetheless, it's still useful! You can still write TD code and use your brain - it is only slightly easier to be lazy (and specifically, lazy in a way you're not supposed to care about, yet.)

In the end, production use crash reports will reveal any bugs that matter in the system (if any), and you can write new tests for those extra cases and make the code pass again. Combined with the rest of Agile (sorry,) i.e. fast release cycles and so on, this isn't a road block.

Re: Test-Driven Development Bypasses Your Brain

#5
I've always viewed TDD as a process that works for some people. It's always important to remember that people learn, develop and think differently. If TDD works for you, great. But do not force it upon other people, as it may not work for them.

(This isn't to say that unit tests are bad, but rather writing tests first may not benefit all people)

Re: Test-Driven Development Bypasses Your Brain

#6
I'm inclined to agree that it is hard to create an algorithm using tdd (for example Dijkstra's algorithm). But "the example" mentioned in the post is not grounded. It would be nice if someone had a real-world example to back up this claim or else it is very easy to bring up the argument that the author is not applying tdd correcly

Re: Test-Driven Development Bypasses Your Brain

#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.

Re: Test-Driven Development Bypasses Your Brain

#9
Personally I completely disagree with this, I've never found myself randomly changing code in a desperate attempt to get a test to pass.

Maybe it's because I'd been coding for years before I ever tried TDD, but when a test fails, I logically debug the code the same way I would if I wasn't using TDD.

As far as I'm concerned having tests just flags possible errors much quicker, and also gives me more piece of mind that my code isn't gonna be riddled with hidden bugs.

Re: Test-Driven Development Bypasses Your Brain

#10

Personally I completely disagree with this, I've never found myself randomly changing code in a desperate attempt to get a test to pass. Maybe it's because I'd been coding for years before I ever tried TDD, but when a test fails, I logically debug the code the same way I would if I wasn't using TDD. As far as I'm concerned having tests just flags possible errors much quicker, and also gives me more piece of mind that…

The other thing to consider is that if you don't know what changed between code change and test running, you aren't running your tests often enough. When you make a change, you test that change. That change should be small enough that it makes it clear where the problem lies.
Post reply on HN