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

Re: [XP] How do you program a change which breaks a lot of unit tests?

Expand Messages
  • Phlip
    ... There are not; tests should always pass. ... If the test has not yet passed, it is exempt. Once it passes, it latches, and we keep it turned on. ... Shared
    Message 1 of 87 , Oct 6, 2007
    • 0 Attachment
      Cédric Beust ♔ wrote:

      > Failed tests are a reality, you just can't avoid them. There are multiple
      > reasons why sometimes, you just have to live with a broken test for a few
      > days:

      There are not; tests should always pass.

      > - The feature is being worked on.

      If the test has not yet passed, it is exempt. Once it passes, it latches,
      and we keep it turned on.

      > - It was broken and the developer is not available.

      Shared code ownership is supposed to take care of this. That developer
      should not have committed a broken test. If they did, then there's something
      wrong with the checkin system. And if test broke after checking in, then
      whoever broke it should fix it, even if they are not the authoring
      developer.

      > - The developer in charge has more important things to do (deadline,
      > etc...).

      Then why were they working on a low-priority feature before a high one??

      > The feature has a dependency that is currently broken.

      This moves the goalpost to the dependency itself. The test correctly
      identified it's broken, so fix it.

      I leave tests commented out all the time, for only one reason: The target
      code works, but the test code is too fragile and complicated. That happens
      when you retrofit tests onto a platform, such as the WWW, which was not
      designed for testing.

      --
      Phlip
    • J. B. Rainsberger
      ... I suppose so, since isolated is a relative term. -- J. B. (Joe) Rainsberger :: http://www.jbrains.ca Your guide to software craftsmanship JUnit Recipes:
      Message 87 of 87 , Nov 12, 2007
      • 0 Attachment
        Ron Jeffries wrote:

        > Hello, J.. On Friday, November 9, 2007, at 3:54:43 AM, you wrote:
        >
        > >> Toward the end of the presentation, I make a public appeal to replace
        > >> the term "Interaction Based Testing" with "Isolation Based Design."
        >
        > > Oh hey, I like that. Specifically, I think it's isolation-based object
        > > interaction design, but the extra words can be dropped when the
        > > appropriate context is understood.
        >
        > Wouldn't both unit testing with Mocks, and without, be properly
        > called "Isolation-Based"?

        I suppose so, since "isolated" is a relative term.
        --
        J. B. (Joe) Rainsberger :: http://www.jbrains.ca
        Your guide to software craftsmanship
        JUnit Recipes: Practical Methods for Programmer Testing
        2005 Gordon Pask Award for contribution Agile Software Practice
      Your message has been successfully submitted and would be delivered to recipients shortly.