3 ms·
My experience: TDD is awesome for writing certain types of code... and it's terrible for writing other types of code. Simple as that. The same is true for ma
by williamstein 10y ago
My experience: TDD is awesome for writing certain types of code... and it's terrible for writing other types of code. Simple as that. The same is true for many programming languages: good for somethings and terrible for others.
- pmarreck 10y agoWhat is it terrible for? I've encountered situations where someone believed it was bad for something and were wrong. Such as user interface code. The solution in that case for example is to make as much of the code testable as possible leaving just a thin layer of untestable stuff (which can still be tested via an integration test of some sort). This idea generally follows the principles of http://alistair.cockburn.us/Hexagonal+architecture http://alistair.cockburn.us/Hexagonal+architecture or "functional core, procedural IO". Gary Bernhardt expounds on this brilliantly in his https://www.destroyallsoftware.com/talks/boundaries https://www.destroyallsoftware.com/talks/boundaries talk, btw.
- wvenable 10y agoIt might also be good for certain types of programmers and worse for others. I tried to do TDD on an appropriate project but it hampered my creativity too much. I slowly started writing code ahead of the tests and ended up back to regular unit testing.