4 ms·
TDD is a subset of automated testing as a whole. You'll find proponents of testing who might not actually like TDD. It's more of an opinion about the best appro
by logn 12y ago
TDD is a subset of automated testing as a whole. You'll find proponents of testing who might not actually like TDD. It's more of an opinion about the best approach. Anyhow TDD is essentially writing the APIs, interfaces, and function signatures first, then writing tests, then implementing things under the hood, then getting tests to pass.
Automated testing (unit or integration tests) is an extension of taking those little one-off things we do during development to make sure things work, and formalizing them to be a permanent part of the code base. Some people go further then and try to add tests for every feature or (gasp) every single line and sub-line of code.
It's easy to get carried away with testing. And some people have valid arguments against testing. But it's nothing too hard or unapproachable. The point really is that everyone does testing already, but not everyone keeps all their tests and makes them nice.
- Bahamut 12y agoCase in point: I'm big on testing (I have pushed testing hard at three companies I have been at), but I dislike TDD strongly. I have often found that I am not sure how I would like to design components until I start implementing, and TDD is too rigid for arriving at an optimal implementation. I prefer to figure out the implementation, then write a thorough set of tests.
- metasean 12y ago> You'll find proponents of testing who might not actually like TDD. One alternative I've heard about is bug-driven testing. Whenever the code doesn't work as expected, write a test verifying the desired behavior. The reasoning was that the functionality was clearly fragile or complex, and therefore more likely to be accidentally broken in the future.