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


           
    2008.Jun.09 Mon

    Don't Let Your Programmer Tests Turn Into Fairy Tales

    Maybe you start out with:

    void testLittleRedRidingHood()
    {
        LittleGirl child = new LittleRedRidingHood();
        assertTrue(child.hasHood());
    }
    

    but then you add something more

    void testLittleRedRidingHood()
    {
        LittleGirl child = new LittleRedRidingHood();
        assertTrue(child.hasHood());
        assertTrue(child.hasBasket());
        Basket basket = child.getBasket();
        assertTrue(basket.hasGoodies()); 
            // we're kind of drifting away from LittleRedRidingHood now...
    }
    

    and more

    void testLittleRedRidingHood()
    {
        LittleGirl child = new LittleRedRidingHood();
        assertTrue(child.hasHood());
        assertTrue(child.hasBasket());
        Basket basket = child.getBasket();
        assertTrue(basket.hasGoodies());
        Wolf wolf = new BigBadWolf(); 
            // now we're really going astray...
        assertTrue(wolf.hasBigTeeth());
    }
    

    If your programmer test (a.k.a. "unit test") is telling a long story, it's probably is too long, not focused enough.

    Step Into Your Agile Groove With Industrial Logic’s Greatest Hits

    [/docs] permanent link