3 ms·
> it's interesting to see that testable code and good design kind of line up They can line up, but I'm not sure there's a causation. There are many different
by tieTYT 12y ago
> it's interesting to see that testable code and good design kind of line up
They can line up, but I'm not sure there's a causation. There are many different ways to write tests the wrong way. It's taken a lot of trail and error for me to get better at it (I can't even say I'm "great" yet). I'd have given up long ago if I wasn't a passionate developer. A less passionate developer would think the whole concept is BS and give up long ago if he took my path.
One of the first mistakes I made was using a mocking framework to test my implementation. The test read like, "first call this method, then call this, then call this". Needless to say it was worthless. I was just writing my code twice.
Then you can use mocks inside-out and end up writing code you don't even need to call, etc.
I'm sure there's many ways to do TDD right, but from in my personal experience, there's more ways to do it wrong.