Tim yes that what I'm saying
I see 2 thread-off here
1) having interaction-based tests with mocks that are sensitive enough
to catch errors/bugs and insensitive enough not to break at every
small refactoring
2) having mock framework powerful enough to easily mocks objects and
basic enough to let the developer fill the code design smells
from the TDD point of view , the #2 is by far the most important.
I would say that 8 times out of 10 when an interaction-based test is
fragile it is a smell that
- in the object under test there is inappropriate responsibility
coupling , or
- the object under test is interacting with too low-level objects or
it is exposing internal low-level implementation details
the other 2 times, once mocks where used for input or state testing
instead of stabs and the other a hand coded mocks will do the job
(better then complicated mock tool features)
for #1, there are objects (like simulation objects or math/statistic
objects) that change their global state from every single methods,
because of this a dynamic mock will be too insensitive of bugs. since
you cannot predict the evolution of your objects I feel a little
dangerous the use of dynamic mocks
On Mar 23, 1:36 am, Tim Barcz <
timba...@gmail.com> wrote:
> If I may summarize...I believe you are saying that the dynamic mocks create
> more brittle tests than tests where strict mocks are used (CreateMock in
> previous versions of RhinoMocks).
> I resonate with what you are saying. I held this view for some time as I
> felt that strict mocks were more "correct". As someone who has used
> RhinoMocks for a few years I can say that I understand the move to deprecate
> CreateMock. I found through our experience that our tests were far more
> brittle using strict mocks. You mention agile and feedback loops and
> failing fast. What I found is that our use of strict mocks did now allow
> for easy refactoring, another highly held agile principle. The issue I see
> with "failing fast" and strict mocks is that often the failing tests are
> really just false positives.
>
> If you're concerned something might be called that shouldn't be...you can
> always test for specific scenarios...ie. say AssertWasNotCalled or
> Expect().Times.Never
>
> Very interested in hearing your thoughts and others.
>
> Timhttp://
www.twitter.com/timbarcz
>
> On Sun, Mar 22, 2009 at 6:52 PM, (luKa) <
luca.minu...@gmail.com> wrote:
>
> > Ciao from Stockholm,
>
> > I'm reading this
>
> >
http://ayende.com/wiki/Rhino+Mocks+3.5.ashx#CreateMockisdeprecated,re...