|
From: Michael S. <mi...@sc...> - 2005-03-21 23:45:51
|
On Tuesday 22 March 2005 00:07, Keith Donald wrote: > I mean what I'm about to create I would consider a Stub (no need for > dynamic mocks or anything), but we don't really use that term > anywhere for any classes in spring-test that I'm aware of. What do > you guys think, when should we use the term "Stub" and when should we > use "Mock"? For those who haven't seen the article before or don't remember the=20 details: http://www.martinfowler.com/articles/mocksArentStubs.html <quote> In the view of the mock community, the key difference with mocks is the=20 expectation setting mechanism where you test which methods were called=20 on the mock. Mockists often refer to a mock object that just returns=20 values as 'just a stub'. </quote> Also, as Fowler notes, the common mock object libraries do a good job at=20 creating stubs, too. Thus, whether an object is a mock or a stub isn't so much a matter of=20 its class, but rather of how it is used. Some objects are too dumb to=20 be used as mocks, therefore it's straightforward to name their classes=20 WhateverStub. A class whose instances can be used for interaction-based=20 testing -- but don't have to -- deserves a Mock name. Just my 2=A2, Michael --=20 Michael Schuerig All good people read good books mailto:mi...@sc... Now your conscience is clear http://www.schuerig.de/michael/ --Tanita Tikaram, Twist In My Sobriety |