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

Re: [XP] Re: TDD - Test Passes before code was wrote...

Expand Messages
  • Otis Bricker
    I think that PDF versions of some Mr Beck s manuscripts for TDD: By Example are still in the files section of that Yahoo group.
    Message 1 of 31 , Nov 1, 2005
    • 0 Attachment
      I think that PDF versions of some Mr Beck's manuscripts for TDD: By
      Example are still in the files section of that Yahoo group.

      http://groups.yahoo.com/group/testdrivendevelopment/

      Otis

      jgo456 wrote:
      >>In extremeprogramming@yahoogroups.com, Steven Gordon <
      >
      > sgordonphd@g...> wrote:
      >
      >>I have experienced this once in a while.
      >> I have more often experienced writing a test
      >>that I expect to pass (and have it pass).
      >>Because I think of the tests as an executable
      >>specification, if I have the following tests:
      >>
      >> - TestFooWorksForOxygen
      >> - TestFooWorksForHydrogen
      >> - TestBarWorksForOxygen
      >
      > ...
      >
      > What are these tests testing before the code exists?
      >
      > What do TDD tests look like? I've seen only extremely limited
      > examples in one of the eXtreme Programming books.
      >
      >
      >
      >
      >
      > To Post a message, send it to: extremeprogramming@...
      >
      > To Unsubscribe, send a blank message to: extremeprogramming-unsubscribe@...
      >
      > ad-free courtesy of objectmentor.com
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
    • J. B. Rainsberger
      ... Yes. My underlying assumption was that, when running the test, I didn t expect it to pass. Sometimes I write tests that I expect to pass -- or at least
      Message 31 of 31 , Nov 7, 2005
      • 0 Attachment
        Chris Wheeler wrote:

        >>I've had this happen a number of times. When it does happen, either:
        >>
        >>1. My test is wrong, or
        >>2. I had written speculative production code, or
        >>3. I'm having a very bad day
        >
        > You frame this happenstance in a negative light. I've experienced cases
        > where I was asked to see if the system did something, and because the design
        > was simple and effective and correct, it passed the test immediately.
        >
        > It's a great feeling, it doesn't happen often, but it does. One should
        > expect that their systems and designs behave like this once in while because
        > good designs are about discovery, and sometimes we discover that our design
        > actually does a little extra - including working under a condition that we
        > didn't expect it to work under.

        Yes. My underlying assumption was that, when running the test, I didn't
        expect it to pass. Sometimes I write tests that I expect to pass -- or
        at least have reason to believe might pass -- for exactly the reason you
        cite.

        In general, though, I expect the new test to fail. When it doesn't, I
        start out suspicious, then try to rule out the negative cases I cited
        above. If none of those explanations work, then I must simply have
        (happily) accidentally got it right. I'm just not ready to let that be
        my default reaction.

        --
        J. B. (Joe) Rainsberger
        Diaspar Software Services
        http://www.diasparsoftware.com
        2005 Gordon Pask Award Winner for contribution to Agile practice
        Author, JUnit Recipes: Practical Methods for Programmer Testing
      Your message has been successfully submitted and would be delivered to recipients shortly.