by HeyLaughingBoy · 11y ago · 0 comments
I am a big believer in unit tests, but don't like TDD much. I think it fosters the belief that you can test quality into a product. Testing should be a verification that the rest of your process has resulted in a high quality product. It shouldn't be the means of getting quality into the product.
FWIW, most people shouldn't be unit testing at all. They should be writing high level automated integration tests.
I find where it works poorly it tends to just mean you have poor testing tools at your disposal.
Plus, people have a tendency to test things at far too low a level.
That's usually what drives people away from TDD. A very good approach for this is described at this article by Dave Hunt: https://medium.com/@davidihunt/tdd-and-complexity-1bbd5ca51e...
One of the problems I've seen ith TDD is that the team decides on a metric of minimum code coverage of x%. Now, in order to achieve x, a large number of basically useless tests end up being written simply for the sake of getting the coverage number up regardless of how poorly thought out those tests are.
That's not an inherent fault of TDD, of course. My point is that the mindset that seems to follow it leads to dumb things like that happening.