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

Re: [XP] Re: Test execution speed

Expand Messages
  • Ron Jeffries
    ... As I understand the terminology, the word mock should be reserved for objects which, in addition to simulating the real thing for the client objects,
    Message 1 of 260 , Aug 2, 2004
    • 0 Attachment
      On Monday, August 2, 2004, at 9:30:42 AM, Steve Bate wrote:

      > You are using the term "stubbing" here in addition to mocking.
      > How do you define those terms? Our mocks have essentially
      > no behavior. A mocked method returns exactly what it is
      > explicitly told to return. They never generate any results.
      > For our functional tests, we sometimes use what we call
      > simulators. A simulator does have behavior and might
      > generate results. For example, our application is an
      > equities and derivative trading system. The functional tests
      > use a simulator that mimics the behavior of the external
      > equity and derivative exchanges.

      As I understand the terminology, the word "mock" should be reserved for
      objects which, in addition to simulating the real thing for the client
      objects, also record information and give it back to the tests.

      For example, an object that responds to Open, Read, and Close by
      conditioning what Read gets depending on what Open asked for, would be a
      stub. If the object also records whether Open, Read, and Close are done in
      that order, or which "files" are opened in which order, then that object
      would be called a mock.

      I could be wrong about the terms, but that's my understanding.

      Ron Jeffries
      www.XProgramming.com
      Do only what is necessary. Keep only what you need.
    • 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.