Isolation Framework, are you Mocking me?
Derik Whittaker - Changing Terms from Mocking Framework to Isolation Framework
“The other day on Twitter Roy Osherove made the statement that he was teaching a class on TDD and he was showing how to use the various Isolation Frameworks. When I read this I had to ask if he talking about Mocking frameworks when he said Isolation frameworks. And indeed he was.
As I sat back to reflect on the semantic differences between the terms Mocking and Isolation I had an 'ah-ha' moment.
…
However, when you tell someone you are working with an isolation framework the idea should click in their head as to what is going to take place and how it is going to be used. By using the term isolation framework we are telling our end users (developers) that what we are really trying to do with the framework is remove external dependencies from our test in order to make them more granular and reliable.
…”
Yes! Perfect! Names have power. Names mean and convey a great deal. “Isolation Framework” is a name that, in my mind, makes so much more sense. No Mocking for me anymore, now it’s Isolating!
I’ve been talking about Mocking with my team and others in the building and they give me that blank, deer in the head lights, stare. I explain that mocking is important to unit testing in that it will help isolate the code from its external dependences (which in our case is 99% of the time databases). But they can’t seem to get beyond the name, “mock”. And in my mind, “mock” has a negative cogitation (maybe because of childhood memories and being mocked as a “News Nerd” even today… ;)
Isolation Framework, IMHO, seems to be a great name and like Derik I think if start using it instead of “Mocking” we might great broader understanding and adoption…
1 comment:
Yes, yes, let's all call the process "isolating" and the tools "isolation frameworks"!
You've been suckered.
Don't forget for a moment that you've just adopted a term that is the key naming differentiator for Roy's employer.
I have mocks and stubs to set up. Can we all get back to work now?
Post a Comment