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

Re: [XP] Re: Test execution speed

Expand Messages
  • Edmund Schweppe
    ... [ ... ] ... Interesting. I haven t found myself using mocks that much. OTOH, the first place I found myself using them was in a situation where the need
    Message 1 of 260 , Aug 2, 2004
    • 0 Attachment
      Dominic Williams wrote:

      > However, TDD is also a design technique. I have
      > observed that mocking or stubbing make it possible to
      > unit test fragile, rigid, highly coupled designs. I
      > feel therefore that unit testing without mocks or stubs
      > has a more positive influence on the design.

      [ ... ]

      > Another concern I have with respect to your approach is
      > that although the application's classes have been
      > decoupled, the unit tests have become coupled with the
      > code's implementation.

      Interesting. I haven't found myself using mocks that much. OTOH, the
      first place I found myself using them was in a situation where the need
      for mocks grew out of a refactoring. I had a series of classes that took
      XML input and generated Active Server Page output; as the requirements
      morphed, I found it harder and harder to keep the classes (and their
      tests) readable. When I removed the XML-reading functionality from the
      page builders into separate classes, I found it much easier to tell what
      was going on. In particular, mocking the (refactored) page-builder
      classes dramatically improved the readability of the (refactored)
      XML-reader classes' tests.

      --
      Edmund Schweppe -- schweppe@... -- http://schweppe.home.tiac.net
      The opinions expressed herein are at best coincidentally related to
      those of any past, present or future employer.
    • 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
      • 0 Attachment
        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.