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

Re: [XP] Story vs Unit (was: Aids to guiding acceptance test definition?)

Expand Messages
  • Ron Jeffries
    ... In summary, what problems do you see? ... To me, whoever that is, I think that the main point is the distinction of test owner. The story tests (Customer
    Message 1 of 32 , Feb 2, 2004
    • 0 Attachment
      On Monday, February 2, 2004, at 2:38:56 AM, Amir Kolsky wrote:

      > The question of what the exact roles of unit tests and acceptance test
      > are is constantly debated here. One could draw a continuum with story
      > tests on one end and unit tests on the other; any point on the continuum
      > defining a combination of tests that together provide the motivation for
      > deriving the code.

      > With story tests written in (say) FIT and translating to fixtures and
      > unit tests in xUnit, both have direct relationship to code and therefore
      > can be used *directly* to do TDD. Therefore one could take the approach
      > that all is needed are the story tests via the following route:

      > Test Script --> Test Fixtures --> Code

      > For example, in FIT:

      > HTML --> FIT --> Test Fixtures --> Code

      > I was trying to point out (rather miserably) that there are problems
      > with taking this route and forsaking the unit tests.

      In summary, what problems do you see?

      > So how would you guys define the roles of story vs. unit tests?

      To me, whoever that is, I think that the main point is the distinction of
      test owner. The story tests (Customer Acceptance Tests as I call them)
      "belong" to the customer and are part of expressing the "contract" between
      customer and programmer. The unit tests (Programmer Unit Tests) belong to
      the programmer and are part of working out the design and ensuring that
      things continue to work over time.

      As the story tests are rather high level, when they fail, it can happen
      that one has to do some debugging to find the problem. Unit tests tend to
      be closer to the problem. So if one were working just from story tests, and
      found oneself doing a lot of debugging, then one would perhaps start
      writing more unit tests.

      Ron Jeffries
      www.XProgramming.com
      We cannot solve our problems with the same thinking we used when we created them.
      -- Albert Einstein
    • J. B. Rainsberger
      ... I consider documentation to be pleasant side-effect of automated tests, in general. It is easy to write tests that are not good documentation, so I don t
      Message 32 of 32 , Feb 3, 2004
      • 0 Attachment
        Amir Kolsky wrote:

        > ]I don't know why.
        > ]
        > ]Customer Tests are meant to give the customer confidence that the
        > ]features he has requested are present in the product.
        > ]
        > ]Programmer Tests are meant to give the programmer confidence that the
        > ]code he has written does what he intended it to do.
        > ]
        > ]I honestly don't know what there is to debate here.
        > ]--
        > ]J. B. Rainsberger,

        > Not a single word on TDD and Documentation?

        I consider documentation to be pleasant side-effect of automated tests,
        in general. It is easy to write tests that are not good documentation,
        so I don't offer it as a key property of the practice.

        If one writes tests that can act as useful documentation, then so much
        the better. First, I'd like to focus on three key properties

        * PTs force the programmer to use the code they write, driving design
        decisions
        * PTs provide an executable specification, increasing confidence that
        code does the thing right
        * PTs provide a safety net for refactoring
        --
        J. B. Rainsberger,
        Diaspar Software Services
        http://www.diasparsoftware.com :: +1 416 791-8603
        Let's write software that people understand
      Your message has been successfully submitted and would be delivered to recipients shortly.