Re: What I hate about *Unit frameworks.

Adam Sroka <[email protected]>
Newsgroups gmane.comp.programming.test-driven-development
Message-ID <CALaPUVfPX1Cj0E2=KQp5-teKO06LXvwBuUgAn0yksRMiNx2cKg@mail.gmail.com>
Hi George:

That makes sense, but you can do the same thing to yourself with mocks.
That's why you have to make sure you write microtests for both sides of the
relationship and cover the same conditions (I think J.B. calls them
"contract tests.")

I only think monkey patching is bad when you violate the implied interface,
or when you go way down in the inheritance hierarchy and muck with things
that could have wide ranging effects (Both of which are smells in dynamic
languages anyway.) But, if you were actually doing TDD something would go
red when you did either of those things, right?


On Thu, May 2, 2013 at 7:46 AM, George Dinwiddie <[email protected]>wrote:

> **
>
>
> Adam,
>
>
> On 5/1/13 11:25 PM, Adam Sroka wrote:
> > Maybe I'm just dense, but: what is it about this that is particular to
> TDD?
> > Seems to me that monkey patching without tests is *fuck all* more
> dangerous
> > than writing a test, making it pass in the simplest way possible, and
> then
> > improving the design. What am I missing???
>
> Monkey patching is a common method to create testing seams, even by
> people who would not use monkey patching in the deliverable system code.
> It's a quick-and-dirty way of mocking using the real objects.
>
> - George
>
>
> > On May 1, 2013 8:12 PM, "John Roth" <[email protected]> wrote:
> >
> >> **
>
> >>
> >>
> >> On 5/1/13 7:12 AM, David Stanek wrote:
> >>>
> >>> On Wed, May 1, 2013 at 6:27 AM, Angel Java Lopez
> >>> <[email protected] <mailto:ajlopez2000%40gmail.com>>wrote:
> >>>
> >>>>
> >>>> John, usually I don't find the case "this test corrupts that test",
> >>> and I
> >>>> wrote thousands of tests.
> >>>>
> >>>> Any example/case?
> >>>
> >>> I've seen this in Python tests where developers monkey-patch things and
> >>> forget to set them back or otherwise muck with global state. This has
> >> been
> >>> the result of design issues.
> >>>
> >>
> >> Snort. This is a continuing issue for the Python developers as well.
> >>
> >> John Roth
> >>
> >> [Non-text portions of this message have been removed]
> >>
> >>
> >>
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>
> --
> ----------------------------------------------------------
> * George Dinwiddie * http://blog.gdinwiddie.com
> Software Development http://www.idiacomputing.com
> Consultant and Coach http://www.agilemaryland.org
> ----------------------------------------------------------
>
>  
>


[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/testdrivendevelopment/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/testdrivendevelopment/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.