3 ms·
I find the thread starter and the highest ranking comments to be seriously deluded, and here's why: I find that TDD almost 99% of the time speeds me up, lets me
by wfaler 16y ago
I find the thread starter and the highest ranking comments to be seriously deluded, and here's why:
I find that TDD almost 99% of the time speeds me up, lets me iterate and test my thesis much faster than without, and for this very reason, I almost always write my code with good test coverage.
The times I have omitted tests, I have always come to regret it, having to re-write the code from scratch for it to be up to par.
A few reasons for this:
- Yes, TDD is belated gratification - the first few cycles of write-deploy-open browser and test are quicker than writing a test. But as your functionality grows, instead of linearly incremental effort to write new test code, your manual regression testing grows exponentially.
- TDD actually HELPS dealing with change: when you refactor functionality, you have instant feedback as to what still works and what doesn't. Though features change the whole system and code base rarely do. See previous point.
- TDD helps writing minimal, flexible architectures that are adept at change, as systems are de-composed into, well, testable units!
- the "prototype" code almost always ends up being the production system. What is easier once that is the case without tests: trying to write tests for code that isn't very testable, rewrite the system, or just live with testing costs that are much higher than that of the competition?
I have actually seen startups slowly die due to the first two points that I raise.
But if you think it's still a good idea to skimp on testing for the sake of expedience, good luck to you, you're going to need it..