The acceptance tests for a story are used to determine whether the story is completed to the point where the customer can accept that part of the software as complete. This means that the customer is responsible for specifying the tests. Often, though, the customer will have some help from a tester who is assigned to the project. Since this project is small and without a dedicated tester, Lori enlists the help of Maria and Rafe. An additional benefit of this is that, beyond generating a list of acceptance tests, it leads to further conversations between Lori and the programmers.
The Search Tests
The search features that Lori prioritized into the first release are shown in 21.1 and 21.2 . The tests for 21.1 are:
- Search for a word that is known to be part of a title but unlikely to be an author; for example, “navigation.”
- Search for a word that is likely to be an author but unlikely to be a title; for example, “John.”
- Search for a word that is unlikely to be in either; for example, “wookie.”
Story Card 21.1.
The tests for 21.2 are:
- Use values for author and title that match at least one book.
- Use values for author and title that match no books.
- Try an ISBN search.
Story Card 21.2.
Shopping Cart Tests
21.3 and 21.4 cover the use of the shopping cart.
Story Card 21.3.
Story Card 21.4.
Lori and the programmers talk about these stories and realize they have a few open questions: Can users put out-of-stock books into shopping carts? What about books that are not yet in print? Additionally, the team realizes that 21.4 covers changing the quantity of an item to 0, but there is no explicit story for increasing the quantity of an item. They could write this as a separate story but decide instead to rip up 21.4 and replaces it with 21.5 .
Story Card 21.5.
An important result of this discussion is that the system has been simplified. By deciding they do not need a separate story deleting an item from a shopping cart the team has both improved the usabilility of the system and avoided potential future work.
The tests for 21.3 are:
- Put an out-of-stock book into the cart. Verify that the user is told that the book will be shipped when it becomes available.
- Put a book that hasn’t been published yet into the cart. Verify that the user is told that the book will ship when available.
- Put a book that is in stock into the cart.
- Put a second copy of a book into the cart. Verify that the count goes up.
The tests for 21.5 are
- Change the quantity of a book from one to ten.
- Change the quantity from ten to one.
- Remove a book by changing the quantity to zero.
Buying Books
21.6 covers the actual purchasing of books. In discussing this story, the programmers clarify a few aspects of it with Lori the customer. Lori wants users to be able to enter separate shipping and billing addresses or indicate that the addresses are the same. The site will accept only Visa and MasterCard.
Story Card 21.6.
The tests for 21.6 are:
- Enter a billing address and indicate that the shipping address is the same.
- Enter separate billing and shipping addresses.
- Test with a state and a postal code that is from another state and verify the inconsistency is caught.
- Verify that the address the books will ship to is the shipping address, not the billing address.
- Test with a valid Visa card.
- Test with a valid MasterCard.
- Test with a valid American Express card (fail).
- Test with an expired Visa.
- Test with a MasterCard that is over its credit limit.
- Test with a Visa that is missing digits.
- Test with a Visa with transposed digts.
- Test with a Visa with a completely invalid number.
User Accounts
21.7 covers the creation of user accounts. Tests for this card are:
- Users can order without creating an account.
- Create an account then recall it and see if the information has been saved.
Story Card 21.7.
21.8 and 21.9 allow users to modify the information stored in their accounts. Tests for 21.8 are:
- Edit the card number to make it an invalid number. Verify that the user is warned.
- Edit the expiration date to one in the past. Verify that the change isn’t saved.
- Change the credit card number to a new valid number and make sure the change is saved.
- Change the expiration date to a date in the future and make sure the change is saved.
Story Card 21.8.
Test for 21.9 are
- Change various parts of the shipping address and verify that the changes are saved.
- Change various parts of the billing address and verify that the changes are saved.
Story Card 21.9.
Administration
21.10 allows an administrator to add new books to the site. Tests for this story are:
- Test that an administrator can add a book to the site.
- Test that a non-administrator cannot add a book.
- Test that a book can only be added if required data is present.
Story Card 21.10.
21.11 allows an administrator to delete a book. Tests for this story are:
- Verify that an administrator can delete a book.
- Verify that a non-administrator cannot delete a book.
- Delete a book and then verify that outstanding orders for the book will still ship.
Story Card 21.11.
21.12 allows an administrator to change information about a book. When the programmers and Lori discuss 21.12 they discuss how to handle unshipped orders that include a book for which the price changes. This becomes one of the tests for the story:
- Verify that items like name, author, number of pages, and so on,. can be changed.
- Verify that price can be changed but that price changes do not affect previously placed (but unbilled and unshipped orders).
Story Card 21.12.
Testing the Constraints
Among the stories Lori has prioritized into the release there are two constraints, which are shown as 21.13 and 21.14 .
Story Card 21.13.
Story Card 21.14.
The only test for 21.13 is to examine the database and verify that an order submitted from the website gets stored in the database:
- Place an order. Open up the telephone order entry database and verify that the order was stored in that database.
Lori takes 21.14 , turns over the story card and writes:
- Test with fifty simulated users doing a variety of searches and placing orders. Ensure that no screen takes more than four seconds to display and that no orders are lost.
A Final Story
The only story left is shown on 21.15 .
Story Card 21.15.
Lori and the developers talk about 21.15 and decide it will be a simple static page that includes a list of recommendations for a variety of topics. They write these tests:
- Select a topic (for example, navigation or cruising) and view the recommendations for that topic. Make sure they make sense.
- Click on an item in the list to verify that the browser goes to a page of information on that book.