[Esug-list] Fwd: Re: Proposal for Mock Objects at ESUG 2011

Niall Ross nfr at bigwig.net
Fri May 27 09:16:05 EDT 2011


Dear Dennis,

 > I'd like to explore interest to Mock Object in Smalltalk society. I'm
 > currently working on the topic, preparing a paper and presentation
 > targeting at ESUG 2011.

Sounds interesting.

Steve Freeman (via Joseph Pelrine) wrote:

> You should talk to Tim, he wrote a mocks library in about 3 classes 
> (which is what it should take). He also has some interesting 
> experience from the Kapital project that doesn't have unit tests.


Tim Mackinnon mentions mock objects in his talk 'Expressive Testing and 
Code for Free' at ESUG 2007 (report reachable from 
http://www.esug.org/Conferences).

You remark

 > Apparently, Mocks technique is not popular tool among Smalltalkers.

and Steve, noting that, says

>
> I hadn't realised that the ST world was behind in this respect.

I note that one or two who replied to your earlier post said they had 
not needed Mocks, or found them brittle, but I don't think the technique 
is _unpopular_ in Smalltalk.  My own take is

1) Smalltalk's power means mocks are not needed as often.  Many a time, 
you can get at what you need directly, or by use method wrappers to make 
the real objects (or the routes to them) act momentarily as mocks.

Here, I may be saying the same as you:

>> Yes, Smalltalk is great language and it has great tools.
>> This damps some aspects of the problems TDD and Mocks address, but for
>> sure does not remove them totally.
>

2) Another dynamic language feature is that you can more easily 
structure tests so the same test can be run against both the mock and 
the real object when the latter is available.  (The approach is the same 
as in my talk "eXtreme UI Testing" at Smalltalk Solutions 2007, also 
reachable from the http://www.esug.org/Conferences page.)

These features may sometimes make people less thorough in setting up a 
full mocks framework for their application's tests.
 

>> It even seems (to me), TDD is not as widely used as it could and should
>> be (despite the fact it was born in Smalltalk).
>
I don't think TDD is in the least unpopular or unrespected in 
Smalltalk.  However I'm sure you are right when you say it "is not as 
widely used as it could and should be", though I'd be surprised if that 
were more true of Smalltalk than of other languages.

>> I have been using TDD and
>> Mocks for many years in different projects with Smalltalk and other
>> languages. Sometimes it was hard, sometimes I was even giving it up, but
>> by now I think I have sufficient experience to state that TDD in general
>> and Mock Objects specifically do deserve (at least) more attention by
>> Smalltalkers.  ... I was most productive in Smalltalk when I used
>>  "classic TDD" and mocks in conjunction. 
>
If your talk uses your experience to illuminate why what we "could and 
should be" doing was "sometimes ... hard ... even giving it up", but 
"most productive", that might be very useful to others.

             Yours faithfully
                   Niall Ross


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________




More information about the Esug-list mailing list