← Back to context

Comment by godelski

5 days ago

Sure, you work with some bad programmers. Don't we all?

The average driver thinks they're above average. The same is true about programmers.

I do disagree a bit with the post and think you should write tests while developing. Honestly, I don't think they'll disagree. I believe they're talking about a task rather than the whole program. Frankly, no program is ever finished so in that case you'd never write tests lol.

I believe this because they start off saying it wasn't much code.

But you are missing the point. From the first link

  > | when the tests all pass, you’re done
  > Every TDD advocate I have ever met has repeated this verbatim, with the same hollow-eyed conviction.

These aren't strawmen. These are questions you need to constantly be asking yourself. The only way to write good code is to doubt yourself. To second guess. Because that's what drives writing better tests.

I actually don't think you disagree. You seem to perfectly understand that tests (just like any other measure) are guides, not answers. That there's much more to this than passing tests.

But the second D in TDD is what's the problem. Tests shouldn't drive development, they are just part of development. The engineer writing tests at the end is inefficient, but the engineer that writes tests at the beginning is arrogant. To think you can figure it out before writing the code is laughable. Maybe some high level broad tests are feasible but that's only going to be a very small portion.

You can do hypothesis driven development, but people will call you a perfectionist and say you're going to slow. By HDD I mean you ask "what needs to happen, how would I know that is happening?" Which very well might involve creating tests. Any scientist is familiar with this but also familiar with its limits

TDD is not a panacea, it's an effective, pragmatic practice with several benefits and little to no downsides compared to test after.

Im not sure what you're saying, really but I dont think it disagrees with this central point in any specific way.