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

[XP] Re: Test execution speed

Expand Messages
  • Dominic Williams
    ... See below. ... Yes, I share that fear, because I have seen it borne out in practice, but it has not been such a big issue as the other ones. ... I didn t
    Message 1 of 260 , Aug 2, 2004
      Ron Jeffries wrote:

      > I'm not seeing why this might be true.

      See below.

      > (I do have my own fear that without integrating the
      > code it won't work, but that seems to me to be a
      > separate issue.)

      Yes, I share that fear, because I have seen it borne
      out in practice, but it has not been such a big issue
      as the other ones.

      > Could you say more about how mocks and stubs
      > interfere with the design?

      I didn't really say they /interfered/. They won't
      prevent a good designer from doing his stuff.

      Mocks and stubs are staple diet for people working on
      legacy code. Why? Because they make it possible to add
      unit tests to a bad, highly coupled design.

      So what I actually said is that, on a team where
      everyone doesn't spontaneously produce high cohesion
      and low coupling, working without mocks is more likely
      to encourage these caracteristics in the design.

      > If a class A is tested in situ, using its real
      > collaborators B and C, the tests for A only talk to A
      > and know about A. (There are quite likely tests for B
      > and C somewhere else.)
      >
      > If we test with mocks as JB describes, then A's tests
      > will include references to (or implementations of)
      > BMock and CMock.
      >
      > When the design of A changes, It may no longer need B
      > and C, but D and E instead. If this happens, the
      > tests have to change to create and use DMock and
      > EMock.
      >
      > Is that the concern?

      Precisely. It doesn't even take such a drastic change
      in A's design for the tests or their mocks (which are
      often specific to a test, not to mention the case where
      self-shunt is being used) to need to be changed: just
      changing the way B and C are being used, or the moment
      when they are called (e.g. at construction or on demand)
      could be enough.

      Regards,

      Dominic Williams
      http://www.dominicwilliams.net

      For a software-patent-free Europe:
      http://www.noepatents.org

      ----
    • Ilja Preuss
      ... Yes, but I thought that we were talking about a test that was wrong. Not sure wether that matters, though... Cheers, Ilja
      Message 260 of 260 , Aug 18, 2004
        Adrian Howard wrote:
        > On 17 Aug 2004, at 12:22, Ilja Preuss wrote:
        > [snip]
        >> It's certainly the case that without pairing/reviews I am more
        >> likely to
        >> *miss* tests - but I don't think that I get more *wrong* tests that
        >> cancel out with wrong implementation...
        >
        > I think it could happen over time.
        >
        > - Lack of pairing might mean I miss duplication so a bit
        > of business logic gets into foo and bar.
        >
        > - My acceptance test for the business logic only uses foo.
        >
        > - Later I change bar incorrectly, but the foo test still passes.
        >
        > False-pass for that bit of business logic.

        Yes, but I thought that we were talking about a test that was wrong. Not
        sure wether that matters, though...

        Cheers, Ilja
      Your message has been successfully submitted and would be delivered to recipients shortly.