An Introductory Acceptance Test

[article]

of this table to directly drive the tests. I’m not going to get into the details of them at this time. I think the author is going to have references to them later on in this book.”

“What I would like give is how we use one of these frameworks. The one we use is the Framework for Integrated Test or known as Fit. It was developed by Ward Cunningham. (Footnote: See http://fit.c2.com and R Mugridge amp; W Cunningham, Fit for Developing Software: Framework for Integrated Tests, Prentice Hall PTR (2005)). The program is now coordinated by James Shore.). “

“With Fit, you describe the tests with a table similar to the one we used with Betty. I’m not going to get into the syntactic details. So as to not confuse you, I’m going to use the same table that we started with. And besides, we’re not trying to push a particular test framework. So getting into the minute details is beyond the scope of this book.”

“So here’s the test. It looks just like the table that Betty presented to the stakeholder.”

Discount

 

 

Item Total

Customer Rating

Discount percentage?

10.00

Good

0.0

10.01

Good

1.0

50.01

Good

1.0

.01

Excellent

1.0

50.00

Excellent

1.0

50.01

Excellent

5.0

“Now when we run this table as a test, Fit executes code that connects up to the Discount Calculator. It gives the Discount Calculator the values in Item Total and Customer Rating. The Discount Calculator returns the Discount Percentage. Fit compares the returned value to the value in the table. If it agrees, the column shows up in green. If it does not, it shows up as red. You can’t see the colors in the black and white that this book is printed in. The first time I ran the test, I got the following table as the output of Fit.”

Discount

 

 

Item Total

Customer Rating

Discount percentage?

10.00

Good

0.0

10.01

Good

1.0

50.01

Good

Expected 1.0 Actual 5.0

.01

Excellent

1.0

50.00

Excellent

1.0

50.01

Excellent

5.0

Tom winks and says, “With this table as the results, it was clear that Debbie had an issue with the Discount Calculator. That avoided my wasting time telling her something she already knew. Like how I’m going to beat her in the next tennis tournament.” Debbie glances back and saw a grin on Tom’s face. She continues, “Tom didn’t even see this. Like my last serve against him. I saw that there was mis-coding on my part. I fixed it. When all the tests passed, I turned it over to Tom. Betty saw the passing tests as confirmation that the calculation was working as desired.”

Recap

  • Examples of requirements clarify the requirements
  • The examples can be used as tests for the implementation of the requirements
  • Tests for business rules can be executed in many ways
    • Creation through GUI of transaction that invokes business rule
    • Development of a GUI that invokes the business rule directly
    • A unit test implemented in a language’s unit testing framework
    • A test using an acceptance test framework, such as Fit, that talks to the business rule module
Tags: 

About the author

Ken Pugh's picture Ken Pugh

A fellow consultant with Net Objectives, Ken Pugh has more than two-fifths of a century of experience in software development—from gathering requirements for stock market analysis to testing real-time radar systems. Ken consults, trains, testifies, and mentors from London to Sydney on lean/agile processes and technology topics ranging from object-oriented design and test-driven development to Linux/Unix. He has written several programming books, including the Jolt Award winner Prefactoring and Interface Oriented Design. He is currently writing Lean-Agile Acceptance Test-Driven Development. When not computing, Ken enjoys snowboarding, windsurfing, biking, and hiking the Appalachian Trail. Ken can be reached at ken.pugh@netobjectives.com.

AgileConnection is one of the growing communities of the TechWell network.

Featuring fresh, insightful stories, TechWell.com is the place to go for what is happening in software development and delivery.  Join the conversation now!

Upcoming Events

Oct 12
Oct 15
Nov 09
Nov 09