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

87224Re: [XP] re: XP, unit testing and accepted failures

Expand Messages
  • yahoogroups@jhrothjr.com
    Dec 31, 2003
    • 0 Attachment
      From: "smogallstar" <smogallstar.at.yahoo.com@...>
      Sent: Wednesday, December 31, 2003 6:02 PM
      Subject: [XP] re: XP, unit testing and accepted failures


      > Hello all,
      >
      > I'm just getting into XP and unit testing, and I like what I see
      > (particularly the book "Agile Software Development"),

      I presume you mean Alistair Cockburn's book by that name?

      > however I have a
      > question: How does unit testing view acceptable failures, such as a
      > class being unable to connect to a remote host? I can tell that some
      > things are assumed to work (i.e., not running out of memory), but how
      > far does this extend? Should I make judgement calls? I have some
      > reservations about assuming disk writes will go as planned, and I'm
      > hesitant to the point of immobility to accept that network connections
      > will be peachy.

      This is the point where you split the tests into several categories.
      In the tests you run all the time, you mock out things like network
      connections so that you can concentrate on the program logic.
      Of course, your mocks should simulate network failures, etc., if
      dealing sanely with them is part of the application specs.

      Another category of tests will deal with the real world network.

      There are a number of reasons for the split, one of which is the
      real world concern you just expressed. Other reasons are that
      the bulk of the tests must run fast enough to insure that they will,
      in fact, get run. Also you don't want the mainline tests dependent
      on anything that behaves in a non-deterministic manner. You need
      to simulate error handling in the mainline tests, but you can reserve
      the longer tests against the complete environment for times when
      you can afford it, such as overnight.

      HTH
      John Roth

      >
      > Thanks for any comments,
      > Sean
    • Show all 10 messages in this topic