Exploring Solution Spaces © Copyright 2003-2006, by C. Keith Ray
   


About
Exploring Solution Spaces, Keith Ray's blog on Software development and other topics.

Send comments to:
keithray@mac.com

For Agile Training, eLearning, or Coaching contact:
Industrial Logic, Inc.
866-540-8336 (toll free)
510-540-8336 (Berkeley, California)

Links
xpminifaq
Résumé
“Adopting XP” Article 2002 (pdf)
“ Refactoring” Article 2006
AYE Conference
Lucien W. Dupont
Elisabeth Hendrickson
Johanna Rothman's Managing Product Development
Brian Marick's Exploration Through Example
Esther Derby's Insights You Can Use
Laurent Bossavit's Incipient(thoughts)
Dale Emery's Conversations with Dale
Martin Fowler's Bliki
Creating Passionate Users

Archives

  • 2003
  • 2004
  • 2005
  • 2006
  • 2007
  • 2008
  • Subscribe
    RSS Exploring Solution Spaces XML


           
    2005.Nov.28 Mon

    Story Card to FIT tests

    This is an partial example of how a story-card might be 'translated' into FIT tests -- this example is paraphrased from the middle chapters of "FIT for developing software" by Mugridge & Cunningham.

    Here's a story card:

    +--------------------------------------------------------+
    |  CreateRentalTemplate                                  |
    |                                                        |
    |  A rental template defines a list of rental items. The |
    |  template specifies the proportion of each item per    |
    |  person. The user can select a template and specify the|
    |  number of people to rent those items.                 |
    |                                                        |
    +--------------------------------------------------------+
    

    To accompany the story, there is discussion (verbal, spoken) between the programmers, testers, and the person that understands the requirements: the "Customer" in XP terminology, "Product Owner", "Domain Expert", etc. I'll leave out estimation and scheduling of stories, which are taken care of by Release Planning and Iteration Planning.

    In the case of this story, there is discussion of how rounding-up will occur when the number of people specified doesn't exactly match the proportions in the Rental Template, so the test is written to use numbers that test the rounding-up.

    Using FIT or Fitnesse, one acceptance test for CreateRentalTemplate would look something more or less like this:

    --------------------------------------------------
    | Create rental template | Coffee break          |
    --------------------------------------------------
    | one | coffee dispenser    | for | 20  | people |
    --------------------------------------------------
    | one | coffee table        | for | 40  | people |
    --------------------------------------------------
    | one | cup                 | for | 0.9 | people |
    --------------------------------------------------
    
    --------------------------------------------------------
    | begin transaction for client | Joanna                |
    --------------------------------------------------------
    | fill template | Coffee break | for | 21 | people     |
    --------------------------------------------------------
    | pay cash | 65.00                                     |
    --------------------------------------------------------
    | end transaction                                      |
    --------------------------------------------------------
    | rentals of client | Joanna  |
    -------------------------------
    | rental item         | count |
    -------------------------------
    | coffee dispenser    | 2     |
    -------------------------------
    | coffee table        | 1     |
    -------------------------------
    | cup                 | 24    |
    -------------------------------
    

    The code to make this work would involve implementation various kinds of fixture classes, that will be instantiated by the FIT framework, and which in turn call the model objects to exercise the application. Initially the FIT tests will fail because the model objects do not exist or do not yet have required functionality. Use test-driven-development to create the model objects with the required behaviors. Then the FIT tests should pass.

    See http://fit.c2.com/ for info about FIT, see http://fitnesse.org/ for info about Fitnesse.

    [/docs] permanent link