I agree that people don't need mocks, stubs, spys, doubles, etc but I
strongly believe that they need to understand the difference between showing
that an interaction is important vs providing a piece of required
information.

I've been down the road you are talking about and it was a very painful bad
road.  CreateMock was my best friend because I didn't understand what it
really meant.  In fact we ended up having quite a few very bad tests because
I didn't understand the difference testing an interaction occurred vs
providing a piece of information to a class.

My preference is that as part of teaching others we also take a few minutes
to explain state vs interaction based testing.  I've started doing a
presentation specifically on State vs Interaction based testing because I
believe very strongly that if people at least know about the difference it
will save them a considerable amount of grief down the road.

Shane

On Fri, Nov 7, 2008 at 7:52 AM, Tim Barcz <[EMAIL PROTECTED]> wrote:

> So, if I may summarize (which get's back to Oren's post):
>
> "Use a stub when you don't care about interaction, use a mock when you do."
>
> While I agree the distinction should be made, I'm wondering if it is more
> of an advanced topic.  I don't want to dumb down mocking, but I do want to
> make it accessible.  I would say that most people don't need the overhead of
> the mocks, stubs, test doubles, spys, ect when testing.  If we can get them
> started writing tests then we've succeeded.  If they write poor or brittle
> tests (as I did when I started) they will seek out a better solution and
> increase knowledge.
>
> In general I'm trying to lower the barrier to entry for the people I will
> be speaking to.
>
> Tim
>
>
>
> On Fri, Nov 7, 2008 at 8:45 AM, Shane Courtrille <
> [EMAIL PROTECTED]> wrote:
>
>> I personally think that hiding the decision to use a stub vs a mock is a
>> very dangerous idea.
>>
>> Testing is something that we should be helping others understand.  Not
>> trying to down down.  A stub vs a mock is a very important decision.  In
>> fact I would suggest that it's one of the best ways for a developer to
>> provide information on their intent.
>>
>> If I see a stub I know they were just trying to fulfill some requirement.
>> If I see a mock I know that they considered that call important enough that
>> it needed to be verified.
>>
>>
>> On Fri, Nov 7, 2008 at 7:34 AM, mike <[EMAIL PROTECTED]> wrote:
>>
>>> I think they are redundant and that is what causes confusion. I've been
>>> working on a framework that hides the decisions of to Stub or to Mock behind
>>> the BDD intentions of Given and Should. It might be interesting to look at.
>>> There are a lot of examples @ http://fluentspec.com.
>>> Oren, the implementation also uses Castle's dynamic proxy, therefore it
>>> could be easy to have that kind of syntax in RhinoMocks.
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to