Loading ...
Sorry, an error occurred while loading the content.

Isolation and Mocks

Expand Messages
  • heusserm
    ... I see a lot of good reasons and benefits that test isolation has in many cases. I just don t see it in -all- cases. If someone on this list believes that
    Message 1 of 184 , May 31, 2007
    • 0 Attachment
      Dave wrote:

      >I don't know if that's just a poor choice of words, but just
      >in case let me suggest that the /reason/ to use a test
      >double for ClassA with TestClassA is test isolation.
      >Even if ClassB were very fast, you wouldn't want
      >TestClassA to have a dependency on it.
      >

      I see a lot of good reasons and benefits that test isolation has in
      many cases. I just don't see it in -all- cases.

      If someone on this list believes that true test isolation is always
      valuable, could you do me a favor and post a logical proof?

      Failing that, I'll stick with my old standby of "use mocks to isolate
      code when the benefits outweigh the costs and risks" statement. :-)

      Regards,

      --heusser
      xndev.blogspot.com
    • Steve Freeman
      ... Now I m lost. I have a test that exercises a feature. Inside that test, some things are there for infrastructure and some things are there because they
      Message 184 of 184 , Jun 28, 2007
      • 0 Attachment
        On 25 Jun 2007, at 10:40, Paul Campbell wrote:
        > --- In extremeprogramming@yahoogroups.com, Steve Freeman
        > <smgfreeman@...> wrote:
        >>
        >> The issue for me is the intent I'm trying to express.
        >>
        >> I set expectations (a.k.a. mock) where I want to assert something
        >> about the behaviour. I stub where I just want the test to get through
        >> the code to the interesting stuff.
        >
        > I get that distinction and it seems a useful one BUT I still dont like
        > the terminology. It would make more sense to me to categorise the type
        > of test being done rather than the type of object being used as the
        > "double" or whatever.

        Now I'm lost. I have a test that exercises a feature. Inside that
        test, some things are there for infrastructure and some things are
        there because they show that the feature works. What would different
        types of test look like?

        S.

        Steve Freeman
        http://www.mockobjects.com

        Winner of the Agile Alliance Gordon Pask award 2006
      Your message has been successfully submitted and would be delivered to recipients shortly.