After all the buzz around #isTDDDead on twitter, reading post from dhh, listening to RailsConf 2014 keynote, watching live streaming debate, I'm back coding. And I wonder...
After quite a few years spent in the trenches of XP, working with PowerMock/EasyMock/Mockito and all *Mock* pattern libraries, strong advocate of isolation testing, following test pyramid approach, automate testing at all layers as guide, what is this #isTDDDead all about?
It's not about automating test, it's not about unit test, both still seeing as a useful tool for developers. It's more about test first approach whatever your do, it's about 80% coverage criteria, it's about management measurement to make you feel sorry about your "dirty dirty code" (quoting dhh here).
Wanting to unit test whatever it costs ie: overuse of mocks, dependency injection or single responsibility principle, refactoring code to make it testable. Test first approach and mockc overuse can lead to too-much layered design. Code where a class is doing just one single little thing and you need to dig deeper to eventually know what's it's all about. Cleaner code? Not so sure...
Back to code, today writing objective-C (I wish I can write french poetry too), I want to unit test my OAuth2 flow, guess what? I need to use mock. And you know what, I'll use OCMock, it might be in a different way though.
I can sleep happy, TDD is not dead or maybe it is but it's more like a Phoenix.
Back to code.
Sculpte, lime, cisèle;
Que ton rêve flottant
Dans le bloc résistant !