Scenarios
For each business event, there is a response: the business use case, or BUC. In this chapter, we will discuss recording the functionality of the BUC, and by doing so, discovering its requirements. Here, we’ll look at using scenarios to record this functionality. We looked at workshops earlier. A scenario is often used in workshops to capture the thoughts of the participants as you’re discussing the desired functionality for a BUC .
A scenario is a limited series of functional steps that are needed to complete the work of the BUC. They are written in plain text; they describe the business needs rather than the technological ones and can be understood by business stakeholders with no technical training .
The scenario starts out as a requirements discovery tool. Later, it is used to show the developers how the atomic requirements hang together. We should mention that you can add exceptions and alternatives into your scenarios to make this tool quite utilitarian. We’ll look at these as we go along .
In short, scenarios are easy to understand, are useful and flexible, and make a valuable requirements tool for your Trawling activity .
What Is a Scenario?
The scenario describes the actions of a business use case.
A scenario, to give it its proper meaning, is an outline of a plot, or a postulated sequence of steps. In requirements work, we use this term to mean the plot of a section of the work you are studying. The use of “plot” in its literary sense is intended to imply that you break the work into a series of steps or scenes, and by explaining these steps, you explain the work .
Previously, we discussed how to partition the problem space using business events. Each business event has a functional response: the business use case. You write a scenario for most, if not all, of the BUCs.
Consider the following scenario, which is the response to the business event A movie fan wants to go to the movies :
-
The moviegoer asks for movies based on her previously recorded preferences.
-
The moviegoer filters the movies based on the time of the screening and the location of the cinema.
-
Reviews of the shortlisted movies are provided on demand.
-
The moviegoer selects a movie.
-
The moviegoer buys a ticket online.
-
Ticket details and a QR code are sent to the moviegoer’s phone.
-
The moviegoer can elect to send messages to selected friends with details of the movie and an invitation to join her at the movies.
-
The moviegoer checks parking availability and public transport options for the cinema.
-
The moviegoer sets an alarm to remind her when it is time to leave for the movies.
How would you use this? In several ways.
If you need to record the current way that your customer does her work, then you can interrogate and record the results in a scenario format. Ask “What do you do next?” and “What comes after that?” and add the responses to your growing scenario. This is the How-Now view from the Brown Cow model discussed in Chapter 18 , The Brown Cow Model . You don’t always need to do this, but it can be a useful way to arrive at a consensus on the work.
Or, probably more usefully, you could use the scenario to elicit what the customer wants to do in the future. At the same time that your customer is telling you what she thinks she wants, you are looking for the essence of it, and trying not to simply record her presumed solution.
When you are in a workshop, the scenario can be used to record a consensus of the participants’ views and ideas. Just like the individual customer, you are always suggesting and shaping and innovating to arrive at the optimal flow of the work.
For the moviegoer’s scenario, you would go back over it looking for improvements. You are looking to see if any of the steps can be replaced with a more essential version. There is still some technology in the scenario—buying the ticket online; receiving the ticket on a cellphone—but as these are mandated by external entities, which means there is no feasible alternative, it is okay to include these technological items. In fact, you are treating them as agreed constraints.
Scenarios with Ready-Mades
If your project intends to use a ready-made (off-the-shelf, open-source, legacy, etc.) solution, then your scenario is used to show the customization steps and any additional steps to make the ready-made work in the customer’s environment. For example, let’s have a business event where an existing bank customer wants to set up an additional special-purpose account. The BUC scenario would be as follows:
-
Perform in-house security check on the application.
-
Ready-made account solution (with configuration) opens the account.
-
New account routed to existing ready-made customer resource management (CRM) solution.
-
Generate app page for the new account.
-
Send acknowledgment message to the customer.
Step 1 is there because the bank’s policy is to do its own security checking and not rely on an outside service. The security checking can be done immediately with no break to consult with a human, so it is considered to be a single step.
Step 2 is done by the ready-made (you would give it its real name). The functionality of the ready-made does not have to be documented by your scenario; it’s all hidden inside and you don’t have to worry about it. This is, after all, the reason you’re buying the ready-made. As long as you know the data in and data out, you can ignore its internal functionality. However, the scenario mentions “configuration.” Most ready-mades need some kind of configuration to work as desired. You have to tell it the rules for accounts and prices, what exception handling you want, and so on. We suggest that you specify the required configuration using a separate but linked document.
Step 3 is the way this bank operates and is not part of the accounts ready-made. However, the bank has an existing CRM ready-made. In this case, the communication between the accounts solution and the CRM is already established, and there is no need for any special implementation.
Steps 4 and 5 are things the bank wants to do when its customers open a new account. These will need to be developed in the usual way.
Using Scenarios
You need to reach a consensus on your scenarios. Often, the most expedient way is to write the scenario and then present it to the customer and the stakeholders. You invite criticism; you invite changes. You make changes to help everybody reach an agreement that this is what the solution will do whenever this business event occurs.
Write your scenarios using from three to ten steps.
Write your scenarios by breaking the functionality of the business use case into a series of steps, with each step being some meaningful and recognizable activity. Ideally, you should aim for between three and ten steps. These numbers are not carved in stone, and nothing untoward will happen to you if you use more than ten steps. However, if you end up with dozens of steps, either you have a gigantic business use case (impossible for normal commercial work) or you are writing your scenario with an unnecessarily meticulous level of granularity. The aim is to keep the scenario simple enough to be readily understandable. Three to ten steps usually achieves this goal.
The next example is the business use case for checking a passenger onto an international flight (see Figure 20.1 ). This business event happens when the passenger arrives at the check-in desk. Either he has not checked in online, or for some other reason—like dropping off bags—he needs to go to a check-in desk. Here’s Sherri, one of the agents describing the check-in process. Keep in mind that she is describing the current way of working—the How-Now view of the work—which you are using to start your investigation:
Figure 20.1
An airline check-in for an international flight. As we go through the scenario for this case, see if it matches your experience of checking in for a flight.
“I call the next customer in line. When he gets to my desk, I ask for some kind of identification of his flight. I can get the record locator (that’s the six alphanumeric characters code) from the QR code on the passenger’s phone, or if they have not checked in online, I ask for their name and the flight they are on. Most people don’t know the flight number, so I usually ask for their destination. They must know that!
“I make sure I have the right passenger and the right flight. It would be pretty embarrassing to give away someone else’s seat or to send a passenger to the wrong destination. Anyway, I locate the passenger’s flight record in the computer. If he has not already given it to me, I ask for the passenger’s passport. I check that the picture looks like the passenger and that the passport is still valid.
“If the computer has not already assigned a seat, I find one. This usually means I ask whether the passenger prefers a window or an aisle seat, or, if the plane is already almost full, I tell him what I have available. Of course, if the computer has assigned a seat, I always ask if it is okay. One way or another we settle on a seat, and I confirm it with the computer system. If needed, I can print a paper boarding pass at this stage, but I usually do the bags first.
“I ask how many bags the passenger is checking and, at the same time, verify that he is not exceeding the carry-on limit. Some people are unbelievable with what they want to carry into a fairly space-restricted aircraft cabin. I ask the security questions about the bags and get the passenger’s responses. I print out the bag tags and securely attach them to the bags, and then I send the bags on their way down the conveyor belt.
“Next, if the passenger does not have a boarding pass on his phone, I print one. This means that I have done everything as far as the computer is concerned. But there is one more thing to do: I have to make sure that everything agrees with the passenger’s understanding. I read from the computer screen where he is going, what time the flight is, and what time it will board, and if a gate has been assigned I tell him that too. I also read out how many bags have been checked and confirm that their destination matches the passenger’s destination. I hand over any documents and wish the passenger a good flight.”
Now, sketch out the scenario. Break the story down to the steps that you consider to be the best ones to capture the normal path through the story. There are no hard-and-fast rules about how you accomplish this—just write whatever seems logical to you. After all, you are the person who is going to use the scenario; it might as well fit with your view of the work. Later you will adjust it with your subsequent activities, but for the moment let us suppose that this is your first draft:
-
Find the passenger-booking record using the QR code from the passenger’s phone or ask for the passenger’s name and flight.
-
Check that this is the right passenger, flight, and destination.
-
Check that the passport is valid and belongs to the passenger.
-
If the passenger is not checked in, allocate a seat.
-
Ask the security questions.
-
Check the baggage onto the flight and print and attach the bag tags.
-
Print the boarding pass (if needed).
-
Do a final check of the flight details and tell the passenger to “Have a nice flight.”
In a workshop, stakeholders are invited to participate and revise the scenario until it represents a consensus of what the work should be.
Confirm this scenario with the interested stakeholders. It is in plain English (or whatever language you’re using) so that the stakeholders can participate and revise this scenario until it represents a consensus view of what the work should be . Once a consensus is reached on the work, start to formalize the scenario. Along the way, you will learn more about the work.
The first part of the formalized scenario identifies it and gives it a meaningful name.
Business Use Case Name: Check passenger onto flight.
Next, you add the start-up mechanism—the trigger—for the business use case. It usually consists of some data or request (often both) arriving from outside your work area. There are also time-triggered business use cases, in which case you state the time condition (an hour or a date is reached, an amount of time has passed since another business use case, and so on) that initiates the use case.
Trigger: Passenger arrives at the desk with passport and flight ID or destination.
Now add any preconditions that must exist when the business use case is triggered. Preconditions indicate the state of the work at initiation. Usually, this means certain other business events must have occurred before this business use case makes any sense.
Preconditions: The passenger must have a reservation.
The check-in desk is not the place to be if you do not already have a reservation. While it may seem like good customer service to allow passengers to make a reservation at the check-in desk, the amount of time needed for this transaction would no doubt annoy the other passengers standing in line.
Actors are the people or systems that connect to or do the work of the business use case. Usually, one actor triggers the business use case, and then one or more others participate in the work.
Actors: Passenger (trigger), check-in agent.
The passenger triggers the business use case by arriving at the check-in desk; he is also the recipient of the business use case’s output. The passenger interacts with the agent to carry out the work of the business use case. Although the agent manipulates any automated product being used, that action should be thought of as simply the current implementation; it has no binding significance. The essential business is triggered by the passenger, who, in some future incarnation, might be more closely involved. Self-check-in seems obvious, but don’t leap to the first solution that comes along. The point of the requirements investigation is to make sure you understand the work before choosing a solution.
The Essence of the Business
The scenario now represents the current incarnation of the work. If you think back to the Brown Cow model from earlier, this scenario belongs to the first quadrant of the model: the How-Now view of the work.
To move above the line and look at the What-Now and Future-What views, you must consider the essence of the problem. To do so, go back over the scenario and eliminate any technological bias while simultaneously asking the question: “What does the business really need to do?”
The essence is not a better solution to the problem. It is the real problem.
The essence is not a better solution to the problem. It is the real problem. You find the real business problem when you eliminate all the technological camouflage that normally makes up a description of some work.
Assume for the normal case that everything works perfectly.
Also, for the moment, consider only the normal case scenario. The normal case (sometimes called the happy path) is when everything works perfectly. Of course, everything does not always work perfectly, so later you go back over the same scenario and explore the exceptions and alternatives.
Let’s revisit the check-in scenario, and this time change the language to be technologically neutral. The How-Now version is:
- Find the passenger-booking record using the QR code from the passenger’s phone, or ask for the passenger’s name and flight.
The passenger and the record locator are both constraints on the work. The passenger comes from outside the work. The record locator is a constraint imposed by the current computer system. In this case it is a real constraint, not because a computer system uses it (the computer system belongs to the airline and therefore can be changed), but rather because it is used by travel agents and other bodies outside the scope of the organization. For this reason, we accept that it is a constraint. However, the record locator is merely a means to an end. The essence of the work is to find the passenger’s reservation. Let’s rewrite step 1 to reflect this understanding:
- Locate the passenger’s reservation.
Stating it in the essential manner, without the technological artifacts, allows us to think of better ways to implement it. If you want to rush ahead, you can see that there are several possibilities for the future solution. Machine-reading the passport or face recognition spring to mind as a way for passengers to identify themselves.
But for now, put those ideas for future technology aside and consider that the essence of the problem is to connect the passenger with his reservation. The How-Now scenario reads:
- Check that this is the right passenger, flight, and destination.
This step focuses on ensuring that the passenger is who he says he is and that the reservation matches his expectations for the flight. Let’s write the essential step 2:
- Ensure that the passenger matches the reservation.
Next, the How-Now scenario checks the passport:
- Check that the passport is valid and belongs to the passenger.
The passport step contains no technology (apart from the passport, which is a constraint); therefore, we can consider it to be the essence and we do not change it. However, you need to specify what is meant by valid, so this warrants a few words of explanation. We suggest enhancing this step by adding the appropriate business rules:
-
Check that the passport is valid and belongs to the passenger.
3.1 The passport must be current.
3.2 The passport must not expire within three months of the end of the complete trip.
3.3 The passport must be valid for travel to the destination country.
3.4 Visas (where needed) must be current.
3.5 There must be no “refused entry” stamps from the destination country.
Alternatively, you might simply leave this step as it was and refer to notes to complete the business rules for step 3.
-
Check that the passport is valid and belongs to the passenger.
See procedure guideline CAA-175.
This is the essence of the problem. There is an unyielding constraint that the passenger has a passport—this is international travel you are dealing with. Ignore for the moment countries within the Schengen Agreement; that is, countries that allow travel between them using an identity card only. These are alternatives and you’ll come back to them later. The airline’s management needs to enforce the rules on passports because the airline is responsible for returning any passengers who are refused entry at the destination country. All in all, this seems like a mandatory constraint, so keep it as part of the essence.
The same technique of scrubbing away the technology and getting to the essence is employed for later steps in the scenario. Keep working through it until you and your interested stakeholders agree that it is an accurate, but not yet detailed, portrayal of the essence of the work. When you are finished, it should look something like this:
Business Event: Passenger decides to check in.
Business Use Case Name: Check passenger onto flight.
Trigger: Passenger arrives at the desk with passport and flight ID or destination.
Precondition: Passenger must have a reservation.
Actors: Passenger (trigger), check-in agent.
-
Locate the passenger’s reservation.
-
Ensure that the passenger matches the reservation.
-
Check that the passport is valid and belongs to the passenger.
See procedure guideline CAA-175.
-
Allocate a seat if not previously allocated.
-
Get the correct responses to the security questions.
-
Check the baggage onto the flight.
-
Give the passenger the boarding pass and proof that the bags have been checked in.
-
Wish the passenger a pleasant flight.
You should add an outcome to the scenario—that is, the desired situation at the successful conclusion of the business use case. Think of it as the stakeholder’s objectives at the time he triggered the business use case.
Outcome: The passenger is recorded as checked onto the flight, the bags are assigned to the flight, a seat is allocated, and the passenger is in possession of a boarding pass and bag reclaim information.
We have left the outcome of the BUC until the end. We have done that for symbolic reasons. That is, you get to the end of the processes for the BUC, and this is the outcome you have achieved. You could, however, put the outcome at the beginning of the scenario and call it the desired outcome. Think of it as the process steps you are about to read are all aimed at achieving this desired outcome. Whether you put the outcome at the beginning or the end, you should think of it as the center of interest for the business use case.
Alternatives
Alternatives arise when you offer an intentional choice of user actions.
Alternatives arise when you wish the user to have a choice of possible actions. These choices are intentional; they are wanted and defined by the business. They usually exist to make the work of the business use case more attractive and convenient to the actors. When you buy things online, for example, you can decide whether to place your selected goods in a shopping cart awaiting checkout or bypass the shopping cart and have them shipped right away by clicking “Buy now.” These deliberate choices offered by the vendor are alternatives.
In the airline check-in commentary above, for some countries, passengers did not need passports and could use an identity card. Treat that as an alternative.
The work reacts differently depending on which alternative is selected. Suppose that you are sending a small package to someone and want to use the postal service. You buy the postage online through the postal service’s website, but before you print the shipping label showing the postage paid, you have a choice of how to get your package into the post. One option is to take it to the post office. In this case, you will be offered the location of the nearest post office and several others nearby. You could elect to drop it in one of the drop-off boxes scattered around the city, in which case the site tells you the nearby ones. You could elect to have your mail carrier collect it; in which case you book a pickup day and pay a small fee. The following is part of a scenario. Let’s say that you are up to step 5.
-
Arrange getting your package into the postal system.
Alt 5.1 Take the package to the post office.
Alt 5.1.1 Provide nearby post offices.
Alt 5.1.2 Include post office QR code on mailing label.
Alt 5.2 Use a drop-off box.
Alt 5.2.1. Warn the customer about the maximum size of parcels for drop boxes.
Alt 5.2.2 Provide nearby drop boxes.
Alt 5.2.3 Include drop-off QR code on mailing label.
Alt 5.3. Collection.
Alt 5.3.1 Select a collection day from those available.
Alt 5.3.2 Inform the customer of the fee and add it to the postage.
Alt 5.3.3 Add collection instructions and QR code to the mailing label.
- Print mailing label.
You find alternatives by examining each step of the normal case. Look for instances where the step may be carried out differently, or the user or customer can be given a choice. These choices are sometimes interesting from the point of view of improving the work or providing a better service.
Exceptions
Exceptions are unwanted but inevitable deviations from the normal case.
Exceptions are unwanted but inevitable deviations from the normal case. They are unwanted in the sense that the owner of the work would rather that they did not happen, because they have the potential of preventing the actors from achieving the desired outcome of the BUC. Nevertheless, we know that they will happen from time to time, so we have to cater to them. For example, a passenger might have a dead battery on his phone and cannot retrieve his boarding pass, an online customer might forget his password, or a passenger could arrive at the airport having left his passport behind.
We must pause here to urge you to delay looking for exceptions until you are satisfied with the normal case (or happy path) scenario. It is far too easy for stakeholders to get carried away with exceptions, and your workshop can be quickly derailed by needlessly chasing exceptions that might never happen. It is only when you have agreed to the normal case that you can methodically work through it by looking for the exceptions and deciding what to do about them.
The goal of the exception scenario is to show how the work handles the exception: in other words, which steps must be taken to rejoin the path of the normal case (if possible). You can write a separate scenario to show the exceptions, but in most cases, it is more convenient to add the exception steps to your normal scenario.
You find the exceptions by examining each step of the normal case and asking questions such as the following.
-
● What happens if this step cannot be completed, or does not go to completion, or comes up with a wrong or unacceptable result?
-
● What can go wrong at this step?
-
● What could happen to prevent the work from reaching this step?
-
● Could any external entity disrupt or prevent this step?
-
● Could any technology used to implement this step fail or become unavailable?
-
● Could the end user fail to understand what is required of him, or misunderstand the information presented by the product?
-
● Could the end user take the wrong action—intentionally or unintentionally—or fail to respond?
There are many questions you can ask, each of which seeks to find a different potential error. We suggest that you make a checklist of the questions pertinent to your particular situation and add to it each time a new project discovers new questions.
We have also seen some successful attempts to use automation to help with this task. Our colleague Neil Maiden at City University in London developed a scenario presenter that works with a normal case scenario to automatically generate a list of potential exceptions. It also uses rich-media scenarios where additional information in the form of photographs, movies, sound, and so on is integrated into the scenario.
We know from experience that the exceptions have the potential to necessitate a great amount of remedial rework if they are not found at requirements time, so look carefully for things that could go wrong. You can ignore the scenario in which the work is struck by a meteor, or giant flying squids eat the internet, but almost anything else is possible.
Misuse Cases and Negative Scenarios
Misuse cases show negative or harmful possibilities, such as someone abusing the work or attempting to defraud it. Examples include users deliberately entering incorrect data, customers using stolen credit cards, and pranksters making fictitious calls or transactions, planting a virus or other malware, or engaging in any of the myriad other things that can be done to harm the work.
“ Maybe ‘abuse cases’ sounds like a bad pun, but the idea of the Negative Scenario (Burglar impersonates householder, Alarm Call Center Operator colludes with Burglar, etc.) is important. ”
—Ian Alexander, Scenarios, Stories, Use Cases: Through the Systems Development Life-Cycle
It may be helpful here to think in terms used by novelists and to use the idea of the protagonist and the antagonist. The protagonist is the hero or main character of the story : the good guy, the user, the person using your solution as shown in your normal use case scenario. While you want your protagonist to win, you should also think of your protagonist as someone who is forgetful, slow, distracted, or not paying attention. Go through the normal case scenario, and for each step, ask what could be done incorrectly. It may be simpler to write a new scenario for each misuse, as the ramifications of a misstep may be complex enough to warrant their own separate story.
Examine all the steps for the normal case and ask if there is a possibility of someone opposing or misusing that action.
So much for the protagonist. The antagonist is the person who opposes the work , seeks to harm it, or wants to defraud it. Hackers and fraudsters are the most commonly thought-of examples of antagonists. Examine all the steps for the normal case and ask if there is a possibility of someone opposing or misusing that action. In this case, the ramifications upon discovering an antagonist’s misuse may be to simply stop the execution of the business use case.
Whether you annotate the normal case with the misuse steps or write a separate misuse scenario depends on the complexity of the situation and the comfort level of the stakeholders.
Review
We have been discussing how to write a scenario; a natural language tool for describing a business use case. The intention of the scenario is to help you and your stakeholders come to a mutual understanding of the functionality of a business use case. Writing the BUC scenario tests whether sufficient study has been done or whether the business analyst needs to investigate further.
You can, if it is helpful, write a scenario for each Brown Cow segment. The How-Now segment gives you a view of how the work is done at the moment. This is useful as a starting point, as it gives your stakeholders a recognizable snapshot of part of their work. The What-Now segment shows the essence of that work, and you use it to ensure that the problem it solves is indeed the real business problem.
The Future-What scenario describes the desired essential activity. This view shows what the solution must do to achieve the goal of the project. It improves on the What-Now by incorporating the improvements desired by the customer.
The Future-How view brings the abstract essence into the real, technological world. It shows how the physical processors (computers, humans, devices, etc.) implement the essence. It is this view that forms the basis for writing your detailed requirements.
Your scenarios start out as a trawling tool and eventually morph into a specification tool.
Resources
Scenarios, Stories, Use Cases: Through the Systems Development Life-Cycle by Ian Alexander and Neil Maiden (Wiley, 2004). This book explores the use of scenarios and provides techniques for effective scenario writing.
Writing Effective Use Cases by Alistair Cockburn (Addison-Wesley, 2000). Although primarily focused on use cases, this book provides valuable insights into writing effective scenarios for business analysis.