Analysis

After collecting the overall requirements, an analysis phase takes place. During that part, not only the identified requirements will be elaborated but this is the stage when some preliminary modeling also takes place. The goal of the analysis activities is to establish a deep(er) understanding of the problem domain. It includes finding the details of the outline requirements and developing some system models that descibe the system's context, structure, behavior and interactions. These models develop in parallel as newer and newer parts of the system are understood.

Now, let us return to the role of the BA and translate the former outline into a real system requirements specification that will be an important phase in system development before system modeling and designing the architecture. Documents describing the requirements and design are not text-only documents but the natural language description of the system is supplemented by some figures. In the context of our case study, UML diagrams will predominantly be used for system descriptions.

As it has been discussed above, use case diagram of the UML can portray different types of system users and the ways that they interact with the system. This type of diagram is typically used in conjunction with the textual use case and will often be accompanied by other types of diagrams as well. It covers functional requirements against the system almost entirely. Previously, we have identified three main user types: customer, administrator, and manager. They will emerge as actors in the use case diagram. We can also define relationships between actors. In most of the cases, these are generalization/specialization relationships. In our example, the most general actor is the user whose descendants are the customer and the administrator. Since the manager owns all attributes like an administrator but also additional ones, the manager actor specializes the administrator (i.e., the manager is descendant of the administrator).

After creating the specification, stakeholders should be consulted again in order to validate its contents. In our case, we make a revision of the diagram(s) ourselves. If it is finished, we obtain an overview of the structure of the system. Now, we know what the system should do for its users.

The following table shows a generic structure of documenting a single use case. This is what is called a structured natural language description of scenarios. We will use it as a template for documenting use cases in Sections the section called “Customer use cases”the section called “Manager use cases”.

Use case IDEnter a unique numeric identifier for the Use Case. e.g. UC-1.2.1
Use case nameEnter a short name for the Use Case using an active verb phrase. e.g. Withdraw Cash
Actors[An actor is a person or other entity external to the software system being specified who interacts with the system and performs use cases to accomplish tasks. Different actors often correspond to different user classes, or roles, identified from the customer community that will use the product. Name the actor that will be initiating this use case (primary) and any other actors who will participate in completing the use case (secondary).]
Description[Provide a brief description of the reason for and outcome of this use case.]
Trigger[Identify the event that initiates the use case. This could be an external business event or system event that causes the use case to begin, or it could be the first step in the normal flow.]
Precondition

[List any activities that must take place, or any conditions that must be true, before the use case can be started. Number each pre-condition. e.g.

  1. Customer has active deposit account with ATM privileges

  2. Customer has an activated ATM card.]

Postcondition

[Describe the state of the system at the conclusion of the use case execution. Should include both minimal guarantees (what must happen even if the actor’s goal is not achieved) and the success guarantees (what happens when the actor’s goal is achieved. Number each post-condition. e.g.

  1. Customer receives cash

  2. Customer account balance is reduced by the amount of the withdrawal and transaction fees]

Normal flow[Provide a detailed description of the user actions and system responses that will take place during execution of the use case under normal, expected conditions. This dialog sequence will ultimately lead to accomplishing the goal stated in the use case name and description

  1. Customer inserts ATM card

  2. Customer enters PIN

  3. System prompts customer to enter language performance English or Spanish

  4. System validates if customer is in the bank network

  5. System prompts user to select transaction type

  6. Customer selects Withdrawal From Checking

  7. System prompts user to enter withdrawal amount

  8. ...

  9. System ejects ATM card]

Alternative flows

[Document legitimate branches from the main flow to handle special conditions (also known as extensions). For each alternative flow reference the branching step number of the normal flow and the condition which must be true in order for this extension to be executed. e.g. Alternative flows in the Withdraw Cash transaction:

4a. In step 4 of the normal flow, if the customer is not in the bank network

  1. System will prompt customer to accept network fee

  2. Customer accepts

  3. Use Case resumes on step 5

4b. In step 4 of the normal flow, if the customer is not in the bank network

  1. System will prompt customer to accept network fee

  2. Customer declines

  3. Transaction is terminated

  4. Use Case resumes on step 9 of normal flow

Note: Insert a new row for each distinctive alternative flow. ]
Exceptions

[Describe any anticipated error conditions that could occur during execution of the use case, and define how the system is to respond to those conditions.

e.g. Exceptions to the Withdraw Case transaction

2a. In step 2 of the normal flow, if the customer enters and invalid PIN

  1. Transaction is disapproved

  2. Message to customer to re-enter PIN

  3. Customer enters correct PIN

Use Case resumes on step 3 of normal flow]
Includes[List any other use cases that are included (“called") by this use case. Common functionality that appears in multiple use cases can be split out into a separate use case that is included by the ones that need that common functionality. e.g. steps 1-4 in the normal flow would be required for all types of ATM transactions- a Use Case could be written for these steps and “included" in all ATM Use Cases.]
Frequency of use[How often will this Use Case be executed. This information is primarily useful for designers. e.g. enter values such as 50 per hour, 200 per day, once a week, once a year, on demand etc.]
Special requirements[Identify any additional requirements, such as nonfunctional requirements, for the use case that may need to be addressed during design or implementation. These may include performance requirements or other quality attributes.]
Assumptions

[List any assumptions that were made in the analysis that led to accepting this use case into the product description and writing the use case description.

e.g. For the Withdraw Cash Use Case, an assumption could be: The Bank Customer understands either English or Spanish language.]
Notes and issues

[List any additional comments about this use case or any remaining open issues or TBDs (To Be Determined) that must be resolved. e.g.

  1. What is the maximum size of the PIN that a use can have?]

Use cases are separated into three packages based on the primary actors. Packagas are used to group related elements together. The contents of each package will be detailed later.

Figure 2.13. Overview of use case packages.

Overview of use case packages.


A "big picture" of all use cases are shown in Figure 2.14, “All identified use cases on a single diagram.”. However, due to the relatively high number of scenarios this is a bit hard to capture therefore it is very common to have them separated on several smaller diagrams that show only a few use cases at a time.

Figure 2.14. All identified use cases on a single diagram.

All identified use cases on a single diagram.


The detailed description of the use cases with their tabular representation are given in the following 3 subsections that are followed by a short description of the non-functional requirements of the system.

Customer use cases

Figure 2.15. Overview of customer use cases.

Overview of customer use cases.

Browse/search

Figure 2.16. Use case UC001

Use case UC001

Use case IDUC001
Use case nameBrowse/Search
ActorsCustomer
DescriptionBrowse and/or search among products (books, DVDs).
Trigger

The customer wants to browse among products or the customer would like to search for certain products.

PreconditionThe customer opens a browser on his/her machine.
PostconditionThe system presents a result list of products (which meets with the given search conditions in case of searching) to the customer.
Normal flow
  1. The customer opens a browser on his/her machine.

  2. The customer types a keyword in the search field and presses the "OK" button.

  3. The system finds products which meets with the search conditions and presents the result to the customer.

Alternative flows

Perform Advanced Search

Steps 2 is replaced with:

  1. The customer performs an advanced search operation. (S)He fills the input fields belonging to different attributes of products, then presses the "OK" button.

Refine Search Result

The following steps are added:

  1. The customer refines the result by typing new keywords into the search fields.

  2. The system executes a new search operation on the previous result list and presents a new result list to the customer.

View Product Details

Steps 2-4 are replaced with the following:

  1. The customer selects a product from the presented list.

  2. The customer presses the "Details" button.

  3. A new popup window opens containing some more information about the selected product.

Exceptions

The format or number of the search keywords is incorrect.

The system cannot load products (the database is not available).
IncludesNone
Notes and issuesIf none of the products meets the given search conditions, the system returns an empty list.

Manage bookshelf

Figure 2.17. Use case UC002

Use case UC002

Use case IDUC002
Use case nameManage bookshelf
ActorsCustomer
DescriptionHandling content of a customer’s bookshelf.
TriggerThe customer wants to save some products for a future order.
Precondition
  1. The customer executes a browsing or a searching operation.

  2. The customer must be logged in.

PostconditionThe system saves products chosen by the customer to his/her bookshelf.
Normal flow
  1. The customer selects one or more products from the list.

  2. The customer moves the selected product(s) to the bookshelf.

Alternative flows
  1. The customer creates item group(s) or, with another expression, own categories inside the bookshelf which categories can be also hierarchical.

  2. The customer selects one or more products from the list.

  3. Product(s) will be added to or removed from the own categories by the customer. Each item on the shelf belongs to a certain category which items can be managed together this way.

ExceptionsThe system is not able to save the items due to a database failure.
Includes
  1. Browse/Search

  2. Manage Item Groups (Own Categories)

Notes and issuesIn case of deleting a category, all included items will also be deleted.

Move items to cart

Figure 2.18. Use case UC003

Use case UC003

Use case IDUC003
Use case nameMove items to cart
ActorsCustomer
DescriptionMove certain items from the bookshelf to the customer’s shopping cart.
TriggerThe customer decides to move selected items to the shopping cart.
Precondition
  1. The customer’s bookshelf contains at least one item.

  2. The customer must be logged in.

Postcondition
  1. Selected items are removed from the bookshelf.

  2. The customer’s shopping cart will contain these items from now on.

Normal flow
  1. The customer selects one or more items from the bookshelf.

  2. The customer moves the selected item(s) to the shopping cart.

Alternative flowsNone
ExceptionsThe system cannot delete the selected items from the bookshelf due to a database failure.
Includes
  1. Browse/Search

  2. Manage Item Groups (Own Categories)

Notes and issuesIn case of moving a complete category to the shopping cart, the bookshelf will not contain this category from now on. The items moved into the shopping cart will lose their category-marker attribute.

Manage Shopping Cart

Figure 2.19. Use case UC004

Use case UC004

Use case IDUC004
Use case nameManage Shopping Cart
ActorsCustomer
DescriptionPreparation to an ordering process with adding items to or removing items from the shopping cart.
TriggerThe customer wants to perform an order and therefore chooses items for it.
Precondition
  1. The customer executes a browsing or a searching operation.

  2. The customer must be logged in.

PostconditionNone
Normal flow
  1. The customer picks up one or more products from the list.

  2. The customer clicks the "Show Shopping Cart" button.

  3. The customer adds products to or removes products from the shopping cart.

Alternative flows
  1. The customer changes the amount of the products. The system re-calculates the total price in this case.

ExceptionsNone
IncludesBrowse/Search
Notes and issuesThe contents of the shopping cart are not saved. There is no possibility to permanently store the customer's shopping cart (but he/she can use the bookshelf in order to permanently store items).

Move items to shelf

Figure 2.20. Use case UC005

Use case UC005

Use case IDUC005
Use case nameMove items to shelf
ActorsCustomer
DescriptionMove certain items from the shopping cart to the customer’s bookshelf.
TriggerThe customer decides to move selected items to the bookshelf.
Precondition
  1. The customer’s shopping cart contains at least one item.

  2. The customer must be logged in.

Postcondition
  1. Selected items are removed from the shopping cart.

  2. The customer’s bookshelf will contain these items from now on.

Normal flow
  1. The customer selects one or more items from the shopping cart.

  2. The customer moves the selected item(s) to the bookshelf.

Alternative flowsNone
ExceptionsThe system cannot insert the selected items to the bookshelf due to a database failure.
IncludesBrowse/Search
Notes and issuesThe items that are moved onto the bookshelf will own a default category-marker attribute from now on.

Place Order

Figure 2.21. Use case UC006

Use case UC006

Use case IDUC006
Use case namePlace Order
ActorsCustomer
DescriptionThe customer creates an order to purchase certain products from the shop.
TriggerThe customer wants to order certain products from the shop.
Precondition
  1. The customer must be logged in.

  2. The customer’s shopping cart contains at least one item.

PostconditionThe system saves the new order and performs further processing on it. (Obtaining items from the inventory; packing them together; handing the package over to an external delivery system.)
Normal flow
  1. The customer selects one or more items from the shopping cart.

  2. The customer clicks the "Buy" button.

  3. The customer fills in the required personal data (name, phone number, email, shipping address, billing address, etc.) on the "Order" dialog.

  4. The customer chooses the payment method.

  5. The customer confirms the order.

Alternative flowsNone
Exceptions
  1. The system cannot save the order due to a database failure.

  2. The customer can cancel the order at any time before confirming it.

IncludesManage Shopping Cart
Notes and issues
  1. The customer is unable to move items back into the shopping cart.

  2. If the order is cancelled, its items will also be lost.

  3. The system calculates and re-calculates the total price for the order according to the amount changes. This price includes not only the value of the price attribute of each item but also the discounts for certain products and for special customers.

Feed Back

Figure 2.22. Use case UC007

Use case UC007

Use case IDUC007
Use case nameFeed Back
ActorsCustomer
DescriptionThe customer sends a feedback about products or the ordering process.
TriggerThe customer wants to provide feedback about products or processes.
Precondition
  1. The customer must be logged in.

  2. The customer must own at least one order for which he/she wants to provide a feedback.

PostconditionThe system saves and forwards feedback for further processing.
Normal flow
  1. The customer types in a message on the "Feedback" dialog.

  2. The customer sends the feedback.

Alternative flowsInstead of sending, it can be cancelled.
ExceptionsThe system cannot save the feedback due to a database failure.
IncludesPlace Order
Notes and issuesThe feedback will not be available by the customer, only by the administrator.

Visit forums

Figure 2.23. Use case UC008

Use case UC008

Use case IDUC008
Use case nameVisit forums
ActorsCustomer
DescriptionThe customer visits forums to share his/her opinion about the products or the system.
TriggerThe customer wants to get a line on the products and share his/her opinion or experiences.
PreconditionNone
PostconditionThe system saves the newly created comments.
Normal flow
  1. The customer visits the forum site.

  2. The customer reads or writes comments about products.

Alternative flows1a. The customer can create a new topic.
ExceptionsThe system cannot save comments due to a database failure.
IncludesNone
Notes and issuesA new comment will not automatically be visible to other users, only after moderation.

Administrator use cases

Figure 2.24. Overview of administrator use cases.

Overview of administrator use cases.

Manage Products

Figure 2.25. Use case UC009

Use case UC009

Use case IDUC009
Use case nameManage Products
ActorsAdministrator
DescriptionAdding new products to the system, modifying attributes of products, and removing products from the system.
TriggerThe use case is activated when there is a need for adding, modifying, or removing some products in the system.
Precondition
  1. The administrator must be logged in.

  2. There must be some products present either in external files (in case of addition) or in the system (in case of modification or deletion).

PostconditionProduct changes will be saved in the system.
Normal flow
  1. The administrator opens the "Manage Products" dialog.

  2. The administrator clicks the "Import Products from File" button.

  3. He/she chooses one or more files on the dialog.

  4. The "Open" button is pressed. The system imports products from the selected files and present them in a list to the administrator.

  5. The administrator selects one or more products from the list.

  6. The administrator clicks the "Save" button. The system saves the selected products in the database.

  7. [[adds new products to the system. He fills in a form with attributes of new products. ]]

  8. The administrator selects one product from the list.

  9. The "Modify" button is clicked. A dialog window opens.

  10. Administrator edits the details of the selected product.

  11. Upon pressing the "Save" button, changes will be saved into the database.

  12. Administrator selects one or more products from the list.

  13. He/she clicks the "Delete" button. The system will remove the selected products from the database.

Alternative flowsSteps 1—4 might be replaced with:
  1. Administrator opens the "Manage Products" dialog.

  2. Administrator clicks the "Record New Product" button. A dialog window opens.

  3. Administrator fills in the attributes of the new product on the form.

  4. He/she presses the "Save" button. The system saves the newly created product in the database.

ExceptionsThe changes cannot be saved permanently due to a database failure.
IncludesNone
Notes and issuesAdding, deleting and updating operations cannot be undone.

Update Order Status

Figure 2.26. Use case UC011

Use case UC011

Use case IDUC011
Use case nameUpdate Order Status
ActorsAdministrator
DescriptionThe administrator updates the status of pending orders.
TriggerThe status of an order needs manual intervention.
Precondition
  1. The administrator must be logged in.

  2. There must be orders recorded in the system.

PostconditionNew order status will be saved in the system.
Normal flow
  1. Administrator opens the "Update Order Status" dialog.

  2. He/she selects the order which needs to be updated from the list.

  3. The new status to be set is chosen.

  4. Administrator saves the changes to make them permanent.

Alternative flowsNone
ExceptionsThe system cannot save the new states due to a database failure.
IncludesNone
Notes and issuesChanges after saving cannot be made undone.

Process Feedback

Figure 2.27. Use case UC012

Use case UC012

Use case IDUC012
Use case nameProcess Feedback
ActorsAdministrator
DescriptionThe administrator processes incoming feedbacks from customers.
TriggerAdministrator wants to evaluate the feedbacks given by the customers.
PreconditionAdministrator must be logged in.
PostconditionNone
Normal flow
  1. The administrator opens the "Process Feedbacks" dialog.

  2. He/she reads the feedbacks.

Alternative flowsNone
ExceptionsNone
IncludesNone
Notes and issuesNone

Compose/Send Newsletter

Figure 2.28. Use case UC013

Use case UC013

Use case IDUC013
Use case nameCompose/Send Newsletter
ActorsAdministrator
DescriptionThe administrator composes and sends newsletters to customers signed up for newsletters.
TriggerThere is a new action offer created by the management.
Precondition
  1. Administrator must be logged in.

  2. Action offers must be set in the system by the manager.

PostconditionThe newsletter is sent to the customers.
Normal flow
  1. The administrator obtains descriptions of the newest action offers.

  2. He/she composes a newsletter holding information about action offers mentioned previously.

  3. The newsletter is sent to the customers signed up.

Alternative flowsNone
ExceptionsThe mailing system is not available.
IncludesSet Action Offers
Notes and issuesNone

Moderate Forums

Figure 2.29. Use case UC014

Use case UC014

Use case IDUC014
Use case nameModerate Forums
ActorsAdministrator
DescriptionAdministrator moderates comments before they become available to other customers.
TriggerAdministrator wants to moderate comments arrived since the last review.
Precondition
  1. Administrator must be logged in.

  2. There is a comment to be moderated.

PostconditionThe moderated comment will be saved and presented to the other customers.
Normal flow
  1. The administrator opens the "Moderating Comments" dialog.

  2. He/she reads a new comment.

  3. A decision is made by the administrator whether the comment is acceptable.

    1. If it is acceptable then the message will be updated with this information so it will become readable by anyone else.

    2. Otherwise, the comment will be rejected.

Alternative flowsNone
ExceptionsNone
IncludesNone
Notes and issuesNone

Manager use cases

Figure 2.30. Overview of manager use cases.

Overview of manager use cases.

Set Action Offers

Figure 2.31. Use case UC015

Use case UC015

Use case IDUC015
Use case nameSet Action Offers
ActorsManager
DescriptionThe manager sets action offers in the system.
TriggerA management decision about a new action is made.
PreconditionManager must be logged in
PostconditionThe newly created action offers and rules are saved.
Normal flow
  1. The manager sets rules on the form for certain products. During the order process, these rules will be applied together with the customer discounts at calculating the total price for a given order.

  2. The manager saves the rules.

  3. He/she creates descriptions about the new action offers for the administration.

Alternative flowsNone
ExceptionsThe rules cannot be saved in the system due to a database failure.
IncludesNone
Notes and issuesThe manager must be familiar with the syntax and functionality of special rules.

Set Customer Discounts

Figure 2.32. Use case UC016

Use case UC016

Use case IDUC016
Use case nameSet Customer Discounts
ActorsManager
DescriptionThe manager sets rules for special customer discounts.
TriggerManagement decision is made about customer discounts.
PreconditionManager must be logged in
PostconditionThe newly created rules are saved.
Normal flow
  1. The manager sets certain rules on the form for each customer category about discounts.

  2. The manager saves the rules.

Alternative flowsNone
ExceptionsThe rules cannot be saved in the system due to a database failure.
IncludesNone
Frequency of use 
Special requirements 
Assumptions 
Notes and issuesThe manager must be familiar with the syntax and functionality of special rules. Customers belong to different categories based on the amount of purchased products so far. During the ordering process, these rules will be applied together with action offers for products at calculating total price for a given order.

View/Check Reports/Statistics

Figure 2.33. Use case UC017

Use case UC017

Use case IDUC017
Use case nameView/Check Reports/Statistics
ActorsManager
DescriptionThe manager can check different reports and/or statistics about the sales.
TriggerManager wants to some reports or statistics.
PreconditionThe manager must be logged in.
PostconditionGenerated reports are presented to the manager.
Normal flow
  1. The manager opens the "Reports and Statistics" dialog.

  2. The appropriate report type is selected plus values for required parameters (like time window for the report) are provided.

Alternative flowsNone
ExceptionsNone
IncludesNone
Notes and issuesNone

In many processes, the detailed description of the use cases are developed in line with some preliminary models of the system. This side by side development means that we often perform some iterations and as we develop deeper and deeper understanding of the problem, more and more accurate system models that capture the problem space are established. Examples of such models that can be developed at this stage are context models, detailed interaction and behavioral models (described by sequence and activity diagrams and statecharts) and domain models that make use of class diagrams in order to capture the main concepts of the particular domain. (More examples will be shown in Chapter 3, System modeling soon.)

Based on the detailed description of use cases, activity and/or sequence diagrams might be created in order to show how the control flows when a use case is executed. However, it is uncommon to provide such interaction diagrams for each use case: some of the use cases can be so simple that it does not need further elaboration. For complex scenarios it might be reasonable to provide an activity or sequence diagram as it helps the reader to understand easier.

Figure 2.34. Activity diagram for use cases Browse/Search and Purchase Order

Activity diagram for use cases Browse/Search and Purchase Order


This activity diagram shows how a customer will perform the most important scenario of the system, namely, purchasing an order. This process has multiple entries: normally, it starts with either browsing or searching for a product, however, it is also possible to check the actual contents of the shopping cart, or, one can directly proceed to checkout phase in case he or she has a non-empty cart. Note the guards on the outgoing edges of decisions. The [new search] guard should include a refined search, as well, since the normal execution flow of searching requested the possibility of refining search criteria.

The described process still stands on a relatively high level of abstraction: it shows how some of the use cases work together to provide system functionalities but the underlying objects that will interact each other are not revealed. To illustrate how various objects will communicate with each other in run-time, we can create sequence diagrams for some activities. Again, there is no need to assign a separate sequence diagram to each activities as some of the activities work in a very simple way: for example, Browse items only visits Products, there is no further processing. On the other hand, some activities capture more difficult logic that worth depicting on a separate diagram as seen on the following figure.

Figure 2.36. Sequence diagram of the activity Checkout

Sequence diagram of the activity Checkout


Of course, this is the Customer actor, who initiates the checkout process. When the actual contents of the shopping cart needs to checked out, the customer will click on the Checkout button which then will result in the invocation of the shopping cart domain object which has the responsibility of the price calculation. It will first ask the customer domain object whether the given customer has some customer-based discounts to calculate with. After retrieving this information, a loop will iterate over each products put into the shopping cart and their individual prices along with their quantities accessed from the associated ProductSelection object will be retrieved. Based on that information, the shopping cart will send itself a self-message (invoke its own method) to calculate the price.

Note

This diagram still omits a couple of details. Of course, it is not the Customer actor itself who will send the checkout message to the shopping cart domain object but there should be a GUI object (a class with the boundary stereotype). According to the Model—View—Controller pattern, an intermediary controller object is also needed since the views are required to notify the controllers about GUI events but these objects and the delagations performed by them are not shown in the figure in order to keep the example small.

Important

Technically, there are two customer lifelines on this diagram, an actor and an object. The former is not an object of the system but a human being using the application and cause variuos scenarios to be executed while the latter is an object of the system which can therefore receive messages. So this is not an error but a preferred way of how you should model situations when an actor initiates some activities that involve sending messages to the "digital representation" of the actor.

Communication digrams provide almost an alternative notation for sequence diagrams. A communication diagram also shows the messages that are passed between objects but the lifelines are depicted as objects (rectangles) and the order of messages are described by numbering the arrows that represent messsages.

Figure 2.41. Communication diagram of the online bookstore's find book and checkout activities

Communication diagram of the online bookstore's find book and checkout activities


Non-functional requirements

Besides functional requirements, it is important to gather and document non-functional requirements. Such requirements might be product, organizational or external requirements that need to be worded in a verifiable manner. Examples of non-functional requirements (with their categories denoted in parenthesis) for the bookstore are shown in Example 2.1, “Non-functional requirements for the case study.”.

Non-functional requirements are in many cases more important that functional ones, especially from the architectural design point of view since non-functional requirements can heavily affect architectural design decisions.