Alternatives of Alternatives

Author: Geri Schneider Winters

Another great question came from Adesh Sharma about whether or not he could write alternatives to alternatives in use cases.

There is no actual standard for the formatting of a use case, just guidelines and best practices. Your primary goal in writing use cases is communication. No matter how you structure a use case, if the readers do not understand it, then you need to change the use case.

In some cases, you will find that describing an alternative of an alternative makes a lot of sense, and actually improves the readability of the use case. In other cases, the use case will be more confusing.

Here is an example I created specifically to show the use of an alternative to an alternative. I think in this case it reads OK, and may be a reasonable way to document this use case.

Place Order Use Case
Basic Flow of Events
=====================

1. The use case begins when the customer selects Place Order in the order processing software.

2. The order processing software displays an order form to the customer.

3. The customer enters his or her customer id into the order form. If the customer does not have a customer id, go to the alternative “The Customer does not have a customer id”, which is shown below.

4. The system uses the customer id to get the customer’s account information from the customer database.

5. The system displays the customer’s name and shipping address on the order form.

6. The customer enters a product code into the order form.

7. The system uses the product code to get the product description and price from the product database.

8. The system displays a description and price for the product on the order form.

9. The order form adds the price to the order total.

10. The customer enters credit card payment information into the order form.

11. The customer selects the Submit button on the order form.

12. The order form sends the information entered by the customer to the order processing software.

13. The order processing software verifies the information from the order form.

14. The order processing software saves the order as pending in the database.

15. The order processing software forwards credit card payment information to the accounting system.

16. The accounting system sends a confirmation to the order processing software.

17. The order processing software marks the order confirmed in the database.

18. The order processing software displays an order ID to the customer, and the use case ends.

Alternative: The Customer does not have a customer id
======================================================

1. The customer selects create account.

2. The system displays an account creation form.

3. The customer completes the name and shipping address fields.

4. If the customer is a corporate customer, include the alternative “Add Corporate Payment Information”, which is shown below.

5. Otherwise, the customer enters his or her credit card information into the payment fields, and a billing address (if different from the shipping address), into the billing address field.

6. The alternative ends.

Alternative: Add Corporate Payment Information
===============================================

1. The customer selects enter corporate payment information.

2. The system displays a corporate payment information form.

3. The customer selects the pay period, one of Net in 15 days, Net in 30 days, or Net in 45 days.

4. The customer enters the accounts receivable address.

5. The customer enters a contact person for the account.

6. The customer enters the PO number for the invoice.

7. The customer uses the note field to enter any additional information that may be required on the invoice.

8. The alternative ends.

If my customer has trouble understanding this use case, I would rewrite it to incorporate the steps of “Add Corporate Payment Information” into the alternative “The Customer does not have a customer id” in this manner:

Alternative: The Customer does not have a customer id
======================================================

1. The customer selects create account.

2. The system displays an account creation form.

3. The customer completes the name and shipping address fields.

4. If the customer is a corporate customer, do these steps:

4.1. The customer selects enter corporate payment information.

4.2. The system displays a corporate payment information form.

4.3. The customer selects the pay period, one of Net in 15 days, Net in 30 days, or Net in 45 days.

4.4. The customer enters the accounts receivable address.

4.5. The customer enters a contact person for the account.

4.6. The customer enters the PO number for the invoice.

4.7. The customer uses the note field to enter any additional information that may be required on the invoice.

5. Otherwise, the customer enters his or her credit card information into the payment fields, and a billing address (if different from the shipping address), into the billing address field.

6. The alternative ends.

 

Do you have a situation where you need to describe alternatives of alternatives? What approach do you use to structure your use cases in that situation?

One thought on “Alternatives of Alternatives

  1. Andrew

    An addition to this technique that can help is to use the numbering of the alternate flows to indicate from where in the basic flow you begin to deviate.

    For example: Alternative: The Customer does not have a customer id
    would be numbers “3.1: The Customer does not have a customer id” Any othe alternate flow off of step 3 would then become 3.2 and 3.3, etc…

    A flow that can happen at any step is given the number 0.x, e.g. “0.1: The Customer Cancels the transaction”

    The advantage of this technique is that you can see from your list of alternate flows which ones are alternates of the same step, and your alternate flows are listed in the order in which they fall out of the basic flow.

    The “problem” with this approach is that there’s extra overhead to manage numbers of your alternate flows when your basic flow numbering changes. (e.g. forgot a step)

    I find that unless you have just a couple of very simple alternate flows, that calling out the alternates as seperate flows makes the basic flow much easier to read. Since I almost never have simple use cases, I always pull my alternates out in this manner.

Comments are closed.