July 07, 2006
Wherein Hazim is dazed and confused, and then amazed, by test cases for an application that doesn't even have a UI yet
"This is great!" Hazim said. "Needing to name drawings was a good catch. I'll run this feature set past Marketing and see if they agree. Wait a minute - you said you have test cases already?"
"Well, a first draft of the Build Verification Test [BVT], at least" replied Daphne. "Here's what we're thinking." She switched the wall display to her code editor.
Logical.Application.Start()
Logical.ColoringBooks.OpenColoringBook("BasicBook")
Logical.ColoringBooks.ChoosePage(23)
Point topLeft = new Point(42, 24)
Point topRight = new Point(350, 50)
Point bottomRight = new Point(320,300)
Point bottomLeft = new Point(70,180)
Logical.Color.DrawLine(topLeft, topRight)
Logical.Color.DrawLine(topRight, bottomRight)
Logical.Color.DrawLine(bottomRight, bottomLeft)
Logical.Color.DrawLine(topLeft, bottomLeft)
Point insideShape = new Point(150, 150)
Point outsideShape = new Point(10, 10)
Logical.Color.FillArea(insideShape)
Logical.Color.UseColor(System.Color.Magenta)
Logical.Color.FillArea(outsideShape)
Logical.Color.UseColor(System.Color.NavyBlue)
for (int x = 25 to 400)
for (int y = 25 to 400)
Logical.Color.Stamp(Logical.Shape.FivePointedStar, new Point(x, y))
Logical.Application.Close()
"I can understand that!" Hazim exclaimed. "Is this an actual test case?"
"Yep!" Jason replied. "We simply write a function for each user action, and then write our test cases in terms of those actions. Test cases stay simple and easy to understand - their essence comes shining through!"
"But what about verification?" Hazim asked. "I guess the user action functions verify themselves?"
Lucas jumped in. "Yes, kind of. It's actually off in a separate verification model that isn't really connected to the user action functions - which, by the way, we call the Logical Functional Model [LFM] - but for now you can think of the verification as being inline to those LFM methods."
"How do you know which different way to perform an action to use?" queried Hazim. "Although I guess we only have one way to do each action in this application..."
"You're right that it seems that we don't have multiple implementations for any of our user actions right now", Daphne responded. "But even if we did, generally we don't want test cases to know that any options exist."
"Which caused a lot of discussion when we made that decision" interjected Bianca. "You might even say arguments. Especially for our BVTs - certain people were of the opinion that smoke tests should always do exactly the same thing, every time."
"Certain people still think that", muttered Lucas, with decided head-nodding from Oliver and Jason.
"But eventually we all agreed that a build is OK as long as one path works" Bianca continued.
Hazim looked troubled. "But what if the path that is picked isn't the one that works? What do you do then?"
Jason and Oliver pounced. "That's exactly what we still want to know!" they chorused.
"Well let's not get into that now" Bianca hurried along. "What other test cases did you two come up with?"
"We have a start on more test cases" Jason replied, shooting dark looks at Bianca. "But we'd rather have you all brainstorm them with us rather than doing it all ourselves."
Posted by The Braidy Tester at 07:30 AM Permalink
|