fragile tests, mocking and collaboration and contract tests

257 views
Skip to first unread message

Patrick Lahey

unread,
Jan 8, 2014, 5:43:57 PM1/8/14
to growing-object-o...@googlegroups.com
Hi all,

this is somewhat related to my last question on different schools of TDD thought and I am curious what other people's take is.  Let me apologize in advance since the links below represent a number of hours of video time.

The main thing I am curious about is that there seems to be a number of people talking about the fragility of test suites (which I have experienced in my own work) and, in some cases, putting some of the blame on over use of mocking.

Good examples of these are Ian Cooper's talk "TDD, where did it all go wrong":


and Roy Osherove's talk "Refactoring and Design Skills for test Driven Development SA2013":


(the relevant part starts at about 28:00 minutes).

On the other hand, there is an excellent talk by J. B. Rainsberger titled "Integration tests are a scam":


The second part of this talk discusses what he calls collaboration and contract tests which consist of mocking all "Service" collaborators which translates into very extensive use of mocking.

I find Rainsberger's presentation compelling but I am concerned that that approach would lead to lots of mocks and tests of implementation details as discussed by Cooper.

Has anyone tried the full on collaboration and contract test approach on a sizable project over an extended period of time?  How did it work out for you?  

Any thoughts on the fragile tests and implementation detail testing debate in general?

Thanks!



Daniel Wellman

unread,
Jan 8, 2014, 6:05:36 PM1/8/14
to growing-object-o...@googlegroups.com
Hello!

I don't have a lot of direct input to add on this because I've gotten a lot out of some of the discussions on the list on similar topics.  The "fragile tests" topic has had several discussions on this list; here are some that stood out for me:

There was a discussion on this list about the Cooper talk which may provide some answers to your question:

This one also had some discussion about use of mocks or not:

And this one too:


I don't have experience with a large project using contract tests; there was a discussion here on the topic:

I hope those are helpful starting points.

Cheers,
Dan





--
 
---
You received this message because you are subscribed to the Google Groups "Growing Object-Oriented Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriente...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Patrick Lahey

unread,
Jan 8, 2014, 7:32:51 PM1/8/14
to growing-object-o...@googlegroups.com
I should have know that this was discussed before.  Many thanks!
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriented-software+unsubscribe@googlegroups.com.

Steve Freeman

unread,
Jan 11, 2014, 5:12:26 AM1/11/14
to growing-object-o...@googlegroups.com
I have a talk of my own, "TDD, that's not what we meant"

What most people have missed is the feedback part of TDD, that brittle test suites are often a sign that the code isn't well factored enough. Ian's talk pretty much says that, I haven't seen the others. There is an awful lot of bad mocking out there (some of which I perpetrated myself). We now understand better that it's about thinking in terms of objects that provide and use services. There is no such thing as too much or too little use of mocks, just appropriate or not.

S
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "Growing Object-Oriented Software" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriente...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Steve Freeman

Winner of the Agile Alliance Gordon Pask award 2006
Book: http://www.growing-object-oriented-software.com

+44 797 179 4105
Twitter: @sf105
Higher Order Logic Limited
Registered office. 2 Church Street, Burnham, Bucks, SL1 7HZ.
Company registered in England & Wales. Number 7522677



Seb Rose

unread,
Jan 11, 2014, 10:49:33 AM1/11/14
to growing-object-o...@googlegroups.com
While I agree strongly with Steve's approach, I think Ian's talk was
more proscriptive than he recalls. Ian may have based his opinions on
experiences of poorly factored code, but he goes too far IMO with his
conclusions. I also disagree with his interpretation of "what Kent
really said".

Seb

philip schwarz

unread,
Jan 11, 2014, 4:02:35 PM1/11/14
to growing-object-o...@googlegroups.com
Hello Steve,

>I have a talk of my own, "TDD, that's not what we meant" 
That reminds me....I remember that just before Christmas I saw some tweets about you presenting it @BCS Edinburgh.
I resolved to look for your slides after Christmas, but forgot about it. Thank you for reminding me.
Found them on Edinburgh's BCS site: http://edinburgh.bcs.org/events/2012-13/131204.pdf
Please let me know if I am mistaken in assuming there is no video recording of the talk.

Philip.
> To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriented-software+unsubscribe@googlegroups.com.

philip schwarz

unread,
Jan 11, 2014, 4:08:06 PM1/11/14
to growing-object-o...@googlegroups.com
That slide deck has 4 slides on each page! The following one has just one slide per page: http://gotocon.com/dl/goto-berlin-2013/slides/SteveFreeman_TestDrivenDevelopmentThatsNotWhatWeMeant.pdf

Philip

philip schwarz

unread,
Jan 11, 2014, 4:19:20 PM1/11/14
to growing-object-o...@googlegroups.com
> I have a talk of my own, "TDD, that's not what we meant" 
That 10th birthday cake photo on slide 2 scared me: for a second I really thought 10 years had gone by since the publication of GOOS!
Thankfully only four candles were needed for the GOOS birthday cake last October.

Philip

On Saturday, 11 January 2014 10:12:26 UTC, Steve Freeman wrote:
> To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriented-software+unsubscribe@googlegroups.com.

Seb Rose

unread,
Jan 11, 2014, 5:42:04 PM1/11/14
to growing-object-o...@googlegroups.com
There was no video of that talk. There was no space for oxygen in the
room, let alone a camera.
>> growing-object-oriente...@googlegroups.com<javascript:>.
>>
>>
>> > For more options, visit https://groups.google.com/groups/opt_out.
>>
>> Steve Freeman
>>
>> Winner of the Agile Alliance Gordon Pask award 2006
>> Book: http://www.growing-object-oriented-software.com
>>
>> +44 797 179 4105
>> Twitter: @sf105
>> Higher Order Logic Limited
>> Registered office. 2 Church Street, Burnham, Bucks, SL1 7HZ.
>> Company registered in England & Wales. Number 7522677
>>
>>
>>
>>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Growing Object-Oriented Software" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to growing-object-oriente...@googlegroups.com.

Steve Freeman

unread,
Jan 11, 2014, 6:20:31 PM1/11/14
to growing-object-o...@googlegroups.com
There might be one from goto. 

S. 

Sent from a device without a keyboard. Please excuse brevity, errors, and embarrassing autocorrections. 
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriente...@googlegroups.com.

philip schwarz

unread,
Jan 11, 2014, 7:01:37 PM1/11/14
to growing-object-o...@googlegroups.com
Searched for a few keywords using http://www.youtube.com/user/GotoConferences/search , but no luck so far.

Steve Freeman

unread,
Jan 12, 2014, 5:31:09 AM1/12/14
to growing-object-o...@googlegroups.com
Ok. It might be up later then. 

S. 

Sent from a device without a keyboard. Please excuse brevity, errors, and embarrassing autocorrections. 
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriente...@googlegroups.com.

Björn Rasmusson

unread,
Jan 12, 2014, 1:12:42 PM1/12/14
to growing-object-o...@googlegroups.com
Hi everyone,

Steve Freeman Wrote:
Ok. It might be up later then. 

S. 

Sent from a device without a keyboard. Please excuse brevity, errors, and embarrassing autocorrections. 

On 12 Jan 2014, at 00:01, philip schwarz <philip.joh...@googlemail.com> wrote:

Searched for a few keywords using http://www.youtube.com/user/GotoConferences/search , but no luck so far.

On Saturday, 11 January 2014 23:20:31 UTC, Steve Freeman wrote:
There might be one from goto. 

S. 

Sent from a device without a keyboard. Please excuse brevity, errors, and embarrassing autocorrections. 

On 11 Jan 2014, at 21:02, philip schwarz <philip.joh...@googlemail.com> wrote:

Hello Steve,

>I have a talk of my own, "TDD, that's not what we meant" 
That reminds me....I remember that just before Christmas I saw some tweets about you presenting it @BCS Edinburgh.
I resolved to look for your slides after Christmas, but forgot about it. Thank you for reminding me.
Found them on Edinburgh's BCS site: http://edinburgh.bcs.org/events/2012-13/131204.pdf
Please let me know if I am mistaken in assuming there is no video recording of the talk.

Philip.

On Saturday, 11 January 2014 10:12:26 UTC, Steve Freeman wrote:
I have a talk of my own, "TDD, that's not what we meant"

What most people have missed is the feedback part of TDD, that brittle test suites are often a sign that the code isn't well factored enough.
Or the test suite is not well factored enough.
When I describe the "Red" - "Green" - "Refactor" cycle, I always put two things under "Refactor":
 - Make code clean
 - Make tests clean

I do not expect to write clean, expressive code with no duplication, without regularly refactoring it as it evolve.
Nor do I expect to write expressive, readable tests, without refactoring them as the test suite evolve. 
Ian's talk pretty much says that, I haven't seen the others. There is an awful lot of bad mocking out there (some of which I perpetrated myself). We now understand better that it's about thinking in terms of objects that provide and use services. There is no such thing as too much or too little use of mocks, just appropriate or not.
+1 for appropriate of not

Björn.

pasku

unread,
Jan 12, 2014, 4:04:31 PM1/12/14
to growing-object-o...@googlegroups.com
I found the video of the same talk at Scan Agile 2013http://vimeo.com/83960706

Donaldson, John

unread,
Jan 13, 2014, 5:19:58 AM1/13/14
to growing-object-o...@googlegroups.com

Well, this is a reasonable and competent presentation, but I was sometimes frustrated not to see the slides!

So, note to the film crew: film the slide as well as the presenter – or make a link to the slides.

(Or ideally do as InfoQ does – show both sync’d).

 

John D.

> To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriente...@googlegroups.com.

> For more options, visit https://groups.google.com/groups/opt_out.

Steve Freeman

Winner of the Agile Alliance Gordon Pask award 2006
Book: http://www.growing-object-oriented-software.com

+44 797 179 4105
Twitter: @sf105
Higher Order Logic Limited
Registered office. 2 Church Street, Burnham, Bucks, SL1 7HZ.
Company registered in England & Wales. Number 7522677


--
 
---
You received this message because you are subscribed to the Google Groups "Growing Object-Oriented Software" group.

To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriente...@googlegroups.com.

--

 
---
You received this message because you are subscribed to the Google Groups "Growing Object-Oriented Software" group.

To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriente...@googlegroups.com.

philip schwarz

unread,
Jan 13, 2014, 4:26:39 PM1/13/14
to growing-object-o...@googlegroups.com
Thanks!
Reply all
Reply to author
Forward
0 new messages