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

Re: [XP] TDD and GUTs

Expand Messages
  • Massimo Manca
    ... Could be, not mandatory but could be ok - Should ... Hmmm... I think this could ìn t always possible. Also my opinion is that installation could be ready
    Message 1 of 5 , Mar 5, 2008
    • 0 Attachment
      Zhon Johansen ha scritto:
      >
      > Hi Alistair,
      >
      > aacockburn wrote:
      > > The punchline is we need a term for "I have good unit tests",
      > > distinct from when they got written.
      > >
      > The distraction of watching video and browsing the internet in my
      > bathtub/shower aside, I love the idea of GUT. If I had good unit
      > tests would I be good at unit testing (cover boundary conditions,
      > have good code coverage, test the pre, and post conditions, check the
      > invariants) or would I have tests that convey the intent of the class
      > clearly (short tests, single asserts, no iffs, well worded test
      > methods, a flow to the tests) or both?
      >
      > I have a little list that could be debated in a GUT context: - Should
      > our tests look like CDD (contract driven development) by specifying
      > tests for precondition, postconditions and the invariants?
      Could be, not mandatory but could be ok
      - Should
      > the setup be done inside the test?
      Hmmm... I think this could'ìn't always possible. Also my opinion is that
      installation could be ready as soon as possible and updated regularly.
      I think installation test have to be done at every compete build but it
      may have its own test set.
      - How many ideas should a test
      > cover?
      One simple test, one simple idea.
      - How many lines are acceptable in a tests?
      As low as necessary to do it. No one more.
      - Should we test
      > behavior or state?
      Behaviour may be expressed as the computation to change from state a to
      state b, so I prefer to say that a test has to check a simple condition
      to pass or fail.
      - How much of the class' internals should we
      > tests?
      We had a debate some time ago, my idea is to show only methods strictly
      necessary to interface the class with other classes hiding all other
      methods and data members so in this scenario I prefer to test also
      private members but a lot of engineers think that it is not necessary.
      It is mandatory to test public members.
      - How many tests should be examples of using the unit?
      >
      > cheers,
      >
      > Zhon Johansen Coach, Instructor, Consultant (pick any two)
      >



      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.