subclass-and-override vs partial mocking vs refactoring | monkey island
Attention all noble mockers and evil partial mockers. Actually… both styles are evil :) Spy, don't mock… or better: do whatever you like just keep writing beautiful, clean and non-brittle tests.
Let's get to the point: partial mocking smelled funny to me for a long time. I thought I didn't need because frankly, I haven't found a situation where I could use it.
Until few days ago when I found a place for it. Did I just come to terms with partial mocks? Maybe. Interestingly, partial mock scenario seems to be related with working with code that we don't have full control of…
I've been hacking a new feature for mockito, an experiment which suppose to enhance the feedback from a failing test. On the way, I encountered a spot where partial mocking appeared handy. I decided to code the problem in few different ways and convince myself that partial mocking is a true blessing.
Read full article from subclass-and-override vs partial mocking vs refactoring | monkey island
No comments:
Post a Comment