background image
<< precondition and Post-condition | Acceptance Criteria >>
<< precondition and Post-condition | Acceptance Criteria >>

Example of a Test Design

76
Chapter 3 - Designing Tests
Example of a Test Design
This section gives an example of a design for a test case. Because the test design is
based on test inputs, it can be developed before any code is written.
In this example, you are testing an automated teller system (ATM). Your
requirements include a use case for withdrawing money from a specified account
type. Another requirement specifies that to perform any transactions with the ATM,
the user must be identified and validated. From these requirements, you have defined
a test case to ensure that you can withdraw a sum of money from a checking account
when the account contains more money at the start of the transaction than the amount
withdrawn.
The first iteration of the test design might be as follows:
Preconditions
s
Ensure that we have a valid account set up and know the user ID and validation
information (password or PIN).
s
Verify that a checking account exists for the user and that we know the current
balance.
s
The current balance must be greater than zero.
Design
s
Step ­ Identify the user to the ATM and validate.
s
Verification Point ­ Make sure that we are logged on.
s
Step ­ Select "Checking" as the account type and "Withdraw" as the transaction.
s
Step ­ Specify the amount to withdraw where the amount is less than the current
balance.
s
Verification Point ­ Ensure that the amount dispensed matches the amount
specified.
s
Verification Point ­ Run the account balance transaction to ensure that the new
balance equals the old balance minus the amount withdrawn.
Post-Conditions
s
Make sure that the user has logged out of the ATM.