DEV Community

Discussion on: Why TDD?

Collapse
 
gypsydave5 profile image
David Wickes

I have found Unit Tests and TDD in general [...]

not the same thing - you can do TDD with end-to-end tests. It takes longer, it's more BDD, but you can do it. Anyway...

[...] compared to automated Functional tests based on requirements.

The assumption being that the unit test aren't based on requirements? I think if you read the author you'd see that what you think of as a functional test is more like a unit test for him: testing the 'business' (i.e. the really important what it ought to do) logic of a program. Not the incidental, one-test-per-function/method/object/class craziness.

As to Coplien's diatribe, it's pretty much 'bad tests are bad' and that coverage won't save you in the end. Well, nobody said it would. If you're testing at the wrong level 100% code coverage is actively harmful. If your test suite is more complicated than your code, you're doing it wrong. Doesn't mean you stop doing it and start driving everything through a web browser and testing your HTML got written right.

more assertions in code.

Doesn't that just give you runtime errors to tell you when things are wrong? You actually do this? I thought it went the way of the goto...