4 ms·
Many developers attempting to practice TDD don't write the tests well enough to cover every possibly argument/configuration for the various methods they were te
by alextgordon 16y ago
Many developers attempting to practice TDD don't write the tests well enough to cover every possibly argument/configuration for the various methods they were testing. That's not TDD.
That's ridiculous and impractical. What if my function fails for values of t >= 946684800?
- devmonk 16y agoIf you have a conditional or some other piece of code that would act differently for t >= 946684800, then per TDD, you'd need a test for it to be true TDD. If you don't have a conditional or different behavior that would occur with a value that large then you don't need a test, per TDD. However, if you find that values of t >= 946684800 cause a bug, then per TDD you'd write a test for it, then write the logic to handle it. I'm not promoting real TDD, btw. Real TDD is fine as a ideal, and is achievable in many circumstances and even may make perfect sense even in an ongoing basis in some environments, but it isn't practiced to the percentage overall that the OP (in the linked post) stated, and developers that heartily promote TDD usually don't fully understand its implications when practiced fully, or what doing true TDD really involves. I'm not against writing tests, but at some point, you need to relax.