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

Re: Tolerating a red bar ?

Expand Messages
  • azami@speakeasy.net
    ... few ... understand I ... AT s don t have to always be at 100%. Unit tests should be giving you confidence in the code you are refactoring. If you are
    Message 1 of 2 , Mar 1, 2001
    • 0 Attachment
      --- In extremeprogramming@y..., "Laurent Bossavit"
      <laurent.bossavit@a...> wrote:
      > ...
      > can tell, but the test code grows a bit large and I split it into a
      few
      > different tests, so I can focus on passing them one at a time.
      > ...
      > The next step is to undertake the refactoring in small bites,
      > passing all tests all of the way, or at least that's how I
      understand I
      > should go. This is where anxiety steps in; it seems to me that I
      > need to run the ATs as I refactor, keeping them green to tell me
      > when I'm done. But the ATs are not passing, since I just put a
      > bunch of them in.

      AT's don't have to always be at 100%. Unit tests should be giving you
      confidence in the code you are refactoring. If you are refactoring
      code not covered by UT's, you ought to write more UT's.

      That said, the real reason I'm responding is because I think there is
      a different interesting issue at work here. It seems like writing a
      unit test when you think of it is a good idea, else it _could_ be
      forgotten. This may mean writing a slew of tests all at once, some of
      them pertinent perhaps to the next task in the story, but not the
      "current" task. Is the correct response to _not_ write the test and
      risk forgetting to write it later?

      Wasting time writing the test is not a good thing, but if I've done so
      already anyway, I leave it in and just don't hook it up to the
      harness. Whether the test is written or not, I write the hookup code
      but comment it out - this will remind me to hook it up later, and
      write it later if I still need to. When I figure out that I don't
      need the test after all, I delete it.

      Not extreme enough? Maybe...
    Your message has been successfully submitted and would be delivered to recipients shortly.