3 ms·
One thing to consider I think is that TDD isn't just about the tests. It's also about architecting the software into small functions and lightweight classes, wh
by simonh 7y ago
One thing to consider I think is that TDD isn't just about the tests. It's also about architecting the software into small functions and lightweight classes, which are easy to write concise tests for and then implement incrementally. To TDD advocates, this resulting characteristic of the code is a valuable goal in itself, even just as a side effect of TDD.
- blunte 7y agoRight, so as the author suggests, maybe TDD's real benefit is that it makes you think and plan a bit more before jumping into coding. Therefore, we should have MDD - miniplan-driven-development: make a mini plan for the feature being developed, not so dissimilarly from what you would do with the first pass of TDD. The difference is, once you start implementing that plan and realize the problem is much different, you don't have to go back and keep modifying your original miniplan. You just do what you would normally do. What you gain is probably a partial improvement in your development process without much cost.
- jacques_chester 7y agoYou may find A Discipline for Software Engineering by Watts Humphreys to be an interesting read.
- cc81 7y agoMy experience is that the resulting architecture will sometimes end up with characteristics that makes it easy to test but more complex, exposes things it should not and too many layers of indirection. DHH wrote some about it here: https://dhh.dk/2014/test-induced-design-damage.html https://dhh.dk/2014/test-induced-design-damage.html I do like automated tests (unit and integration) and often TDD is appropriate. However tests are not the end goal of an architecture. The code should be maintainable, easy to follow and simple to reduce number of bugs. If TDD starts to change that by adding layers of indirection or changing the purpose of something just so you can do a fast unit test then something is wrong.