4 ms·
I never was a fan of TDD, until I saw this talk by Ian Cooper: https://www.infoq.com/presentations/tdd-original https://www.infoq.com/presentations/tdd-original
by JoeNr76 9y ago
I never was a fan of TDD, until I saw this talk by Ian Cooper: https://www.infoq.com/presentations/tdd-original https://www.infoq.com/presentations/tdd-original
The whole idea of testing functions and/or classes separately means tightly coupling your test code to the implementation of the real code, while you should only care about testing the functionality.
Nowadays, I try to write tests that test a unit of functionality. And the tests should only change when the functionality changes, not after every refactoring.
That said, code coverage is a metric with no inherit value (well, unless it's 0, of course)
- marsrover 9y agoNot a word for word quote, but I heard this: > How many of you have a code base that if you refactored, test would break? > Most people raise hand and it made me realize maybe I'm not as stupid as I think I am. I've been trying to understand how to create unit tests that allow me to refactor for years, and have been completely unsuccessful. The only way I can achieve this is using the "classicist" viewpoint of creating many "unit test" and only isolating the architecturally significant boundaries. That doesn't make me happy either, though. But, yeah, good to know (or bad to know) that I'm not the only one that struggles with this. Back to the video I go.