Hacker News new | past | comments | ask | show | jobs | submit login

I hate TDD because I have to actually debug them, sometime more so than the actual app themselves. Also, there's the issue of slow TDD suite, which means you have to optimize them or otherwise it will slow down your development pace.

TDD is only good when it provide more benefits than its negative(debugging time, time waiting for it to run, time spent ripping out code).

That being said, it's better than 0 test. Just don't get crazy in writing testcase for every minute scenarios.




Unless of course you are writing software that goes into a pacemaker, in which case I would want that tested like crazy for every possible scenario you can imagine including automated fuzz testing. Same goes for databases and quite a few other classes of software.

In short, use common sense.

Personally I love TDD. Not because of the tests, but because the resulting code IS testable, and generally testable code is maintainable and easy to read.


If I knew one pacemaker was developed with TDD and one without it I would probably go for the one without it. Most programs are fine on the Happy Path, and TDD seems like it's focused on expanding the Happy Path vs actually writing correct software.

This could just be internal bias, but without TDD programmers more focused on the possible error conditions. I would rather see:

  If ((a/2-1) + (b/2-1)) > (largestInt/2-5)) 
  ... do something
  vs.
  A large try catch block.
Arguably the second is just as safe, but it's the test's you don't think to run that tend to end up as production bugs and good tests require a level of paranoia which is more important than methodology IMO.


YMMV, while I don't do TDD, my unit-tests are fast because I use mock (I don't need to optimize by the way... it's just .. habits).

YMMV, while people disagree with the use of mocking, I find it to be valuable to write unit-tests. Does it represent the real-life production grade environment? no, so does the UAT/TEST environment.

It is meant to be that way, nobody able to test in real-life production grade environment (real data, real performance measure). Tests are always done in a more controlled situation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: