Sunday 20 January 2013

Chapter 6: Structuring System Requirements: Use Case Description and Diagrams



True-False Questions


1.      The words “actor” and “user” are synonyms as terms in a use case diagram.

Answer:    False                Page Reference:  163                         Difficulty:  Moderate


2.      Use case modeling is one of the few non-iterative processes of OOSAD.

Answer:    False                Page Reference:  163, 180                 Difficulty:  Moderate


3.      In UML use case diagrams, actors exist outside the system that is being modeled.

Answer:    True                 Page Reference:  163                         Difficulty:  Easy


4.      It is possible for a single user to be represented by several actor roles in a use case diagram.

Answer:    True                 Page Reference:  163                         Difficulty:  Moderate


5.      Use-case diagrams depict user interaction with information systems.

Answer:    True                 Page Reference:  164                         Difficulty:  Easy


6.      Adding new behaviors to a complete use case is represented through the use of an <<extend>> relationship.

Answer:    True                 Page Reference:  165                         Difficulty:  Moderate


7.      In UML use case diagrams, ellipses always appear inside the system boundaries.

Answer:    True                 Page Reference:  165                         Difficulty:  Easy


8.      In UML use case diagrams, lines that cross system boundaries are most likely to be solid.

Answer:    True                 Page Reference:  165                         Difficulty:  Moderate


9.      The relationship between a use case and a generic function commonly used by many other use cases is labeled with <<include>>.

Answer:    True                 Page Reference:  166                         Difficulty:  Moderate


10.  In UML use case diagrams, arrows on relationship lines indicate direction of data and process flow.

Answer:    False                Page Reference:  165-166                  Difficulty:  Moderate


11.  In UML use case diagrams, lines connecting use cases to each other for extension or inclusion are dotted.

Answer:    True                 Page Reference:  165-166                  Difficulty:  Moderate


12.  Abstract use cases have no direct interactions with actors.

Answer:    True                 Page Reference:  167                         Difficulty:  Moderate


13.  Microsoft Visio puts use case names below the use case ellipses.

Answer:    False                Page Reference:  167                         Difficulty:  Moderate


14.  Generalization relationships between actors are represented by solid lines with arrows.

Answer:    True                 Page Reference:  169-170                  Difficulty:  Moderate


15.  In UML diagrams, a use case with an <<extend>> relationship pointing toward it is dependent on its extension use case in order to function completely.

Answer:    False                Page Reference:  170                         Difficulty:  Hard


16.  Use case descriptions focus primarily on interactions with actors rather than internal processing steps.

Answer:    True                 Page Reference:  170                         Difficulty:  Moderate


17.  A use case diagram provides detailed information about the user interaction steps that take place within a use case.

Answer:    False                Page Reference:  170                         Difficulty:  Moderate


18.  Cockburn’s “black” level indicates a highly detailed use case description.

Answer:    True                 Page Reference:  173                         Difficulty:  Moderate



19.  In Cockburn’s use case template, a precondition is the event that triggers the use case.

Answer:    False                Page Reference:  174                         Difficulty:  Moderate


20.  In Cockburn’s use case template, an extension describes steps that take place when something goes wrong during the use case function.

Answer:    True                 Page Reference:  174-175                  Difficulty:  Moderate


21.  In Cockburn’s use case template, an extension is equivalent to the <<extend>> relationship in a use case diagram.

Answer:    False                Page Reference:  174-175                  Difficulty:  Moderate




Multiple-Choice Questions

22.  Use case construction is a technique used for:

a.       requirements determination.
b.      requirements structuring.
c.       user interface design.
d.      database design.

Answer: b                         Page Reference:  162                         Difficulty:  Moderate


23.  A use case represents:

a.       a class, its attributes and operations.
b.      a business case for using an information system.
c.       the system’s functionality under various conditions.
d.      the role a user plays when interacting with the system.

Answer: c                          Page Reference:  163                         Difficulty:  Moderate


24.  The name that identifies a use case is most likely to be in the form of a(n):

a.       noun.
b.      verb.
c.       verb/noun combination.
d.      adjective.

Answer: c                          Page Reference:  163                         Difficulty:  Moderate


25.  An external entity that interacts with a system is called a(n):

a.       use case.
b.      actor.
c.       stakeholder.
d.      association.

Answer: b                         Page Reference:  163                         Difficulty:  Moderate


26.  In UML notation, an ellipse signifies a(n):

a.       actor.
b.      class.
c.       use case.
d.      system boundary.

Answer: c                          Page Reference:  164-165                  Difficulty:  Easy


27.  An abstract use case is one that is:

a.       connected to an actor but not initiated by another use case.
b.      connected to an actor and initiated by another use case.
c.       not connected to an actor and not initiated by another use case.
d.      not connected to an actor but instead initiated by another use case.

Answer: d                         Page Reference:  165, 167                 Difficulty:  Moderate


28.  In a use case diagram, dotted lines with arrows represent:

a.       data flows between actors and use cases.
b.      connections between use cases in a system.
c.       links between use cases and data stores.
d.      associations between classes and use cases.

Answer: b                         Page Reference:  165-166                  Difficulty:  Moderate


29.  In UML notation, the connection between an actor and a use case is represented by:

a.       a dotted line with an arrow.
b.      a dotted line without an arrow.
c.       a solid line with an arrow.
d.      a solid line without an arrow.

Answer: d                         Page Reference:  165                         Difficulty:  Moderate


30.  Which use case label indicates that one use case provides a variation of the behaviors and actions to the use case it is connected to?

a.       <<extend>>
b.      <<include>>
c.       <<add>>
d.      <<expand>>

Answer: a                          Page Reference:  165-166                  Difficulty:  Moderate


31.  The <<extend>> relationship between use cases would be used when behavior in the extending use case is ____________ the extended use case.

a.       always needed by
b.      never needed by
c.       sometimes needed by
d.      unrelated to

Answer: c                          Page Reference:  165-166                  Difficulty:  Hard


32.  Which use case label indicates that one use case is initiated and used by another use case?

a.       <<extend>>
b.      <<use>>
c.       <<initiate>>
d.      <<include>>

Answer: d                         Page Reference:  166                         Difficulty:  Moderate


33.  Which type of use case is most likely to be pointed at by a dotted line labeled <<include>>?

a.       A use case that is initiated by an actor playing a role
b.      A use case that is specialized by another use case in the system
c.       A use case providing functionality that is used by several other use cases
d.      A use case that exists outside the system boundary

Answer: c                          Page Reference:  166                         Difficulty:  Hard


34.  Which software product is a CASE tool that includes user case diagramming capabilities?

a.       Rational Rose
b.      Microsoft Visio
c.       User Case Manager
d.      Unified Modeling Language

Answer: a                          Page Reference:  167                         Difficulty:  Moderate


35.  Under which circumstance will you prefer an <<extend>> relationship instead of an <<include>> relationship?

a.       Modeling a variation of a complete use case
b.      Factoring the common behavior among two or more use cases
c.       Connecting a use case to an actor
d.      Describing the detailed behavior of a use case

Answer: a                          Page Reference:  170                         Difficulty:  Hard


36.  What is the advantage of using a template for writing a use case?

a.       Facilitates free form open-ended writing
b.      Encourages analyst to create complete use case
c.       Matches the UML format specifications
d.      Provides a diagrammatic representation of a use case

Answer: b                         Page Reference:  172                         Difficulty:  Moderate


37.  In Cockburn’s written use case template, the level indicates:

a.       degree of importance.
b.      amount of detail.
c.       authority of stakeholders.
d.      degree of success.

Answer: b                         Page Reference:  172-173                  Difficulty:  Moderate


38.  In Cockburn’s written use case template, a ____________ specifies what needs to be true in order for the use case to execute.

a.       precondition
b.      minimal guarantee
c.       trigger
d.      requirement

Answer: a                          Page Reference:  174                         Difficulty:  Moderate


39.  In Cockburn’s written use case template, the event initiating a use case is called a(n):

a.       precondition.
b.      stakeholder.
c.       extension.
d.      trigger.

Answer: d                         Page Reference:  174                         Difficulty:  Moderate


40.  In Cockburn’s written use case template, the behaviors that will occur in the case of system exceptions or some other failure takes place in the:

a.       failure scenario.
b.      extensions.
c.       preconditions.
d.      exception description.

Answer: b                         Page Reference:  174-175                  Difficulty:  Moderate


41.  All of the following help achieve the goal of  use case completeness EXCEPT:

a.       Obtain all functional requirements before use case development begins.
b.      Include rapid prototyping as part of the requirements structuring process.
c.       Write a user manual as the requirements structure process takes place.
d.      Iteratively review use cases and generate new ones based on user evaluations.

Answer: a                          Page Reference:  179                         Difficulty:  Hard




Essay and Problem-Solving Questions


42.  What is the purpose of use case modeling? At what stage in the systems development process will use case modeling take place? What are the inputs to use case modeling and what are its outputs?

Answer:

The purpose of use case modeling is to analyze the functional requirements of a system. It takes place in the early stages of systems development, during the analysis phase. Primarily, it is taking place during requirements structuring, and inputs to this process are the requirements that had been obtained from interviews, questionnaires, JAD sessions, observations, and document analyses of the requirements determination process. The outputs from use case modeling are use case diagrams and written use cases.

                                          Page Reference:  163                         Difficulty:  Easy


43.  What is a use case? What is the most appropriate verbal form in which to identify a use case?  In a use case model, what does a use case generally interact with? How does use-case modeling promote forward and backward traceability in object-oriented development? Finally, what questions can the systems analyst ask herself in order to generate use cases for the system model?

Answer:

A use case is a depiction of a system’s behavior or functionality under various conditions as the system responds to requests from the user. They are generally identified using verb phrases including a verb indicating the action to take and a noun indicating the object that is acted upon.  Use cases interact either with actors or with other use cases. Use case-driven design supports forward traceability in that requirements specified in a use case will guide the construction and modification of elements in other analysis and design models.  Similarly, a design change in other analysis models can be traced backward to see its effects on use case requirements. In developing a use case model, the identification of use cases can benefit from the following questions. First, what are the main tasks performed by each actor? Second, will an actor read or update any information in a system? Third, does the actor inform the system of events occurring outside the system? And fourth, is the actor to be informed of any unexpected changes that occur within the system?

                                          Page Reference:  163                         Difficulty:  Moderate


44.  List each of the elements of a UML use case diagram, and describe what they look like and what they represent.

Answer:

A use case diagram consists of four elements. A stick figure represents actors, which are roles played by external entities of a system, usually system users. An oval shape describes a use case, which represent elements of system behavior in response to user interaction. Solid lines between actors and use cases represent connections indicating the actor’s involvement with the system function of the use case. Connections can also exist between use cases. These are usually represented as dashed lines with arrows. There are two major types of connections between use cases; one is an include relationship and the other is an extend relationship. Extend refers to adding new behaviors or actions to a default use case. Include refers to a relationship in which one use case uses another use case. The final symbol of a use case diagram is a system boundary, which is a box surrounding the use case symbols and separating them from the external actors.

                                          Page Reference:  164-166                  Difficulty:  Moderate


45.  Compare and contrast the different types of connections that are represented in a use case diagram. Give the meanings of each of these connections, describe the circumstances under which each type of connection is appropriate, and give a verbal description of what the connection looks like. Relate this discussion to the concepts of include, extend, and generalize. Also, discuss how this relates to the distinction between abstract and non-abstract use cases.

Answer:

The different connections include associations between actors and use cases, associations between actors themselves, and associations between use cases. A typical association between an actor and a use case is a solid line containing no arrowheads, and does not imply any direction of data flow; it merely shows that an actor is involved in a use case. The connections between use cases imply either an extension or inclusion relationship. In an extend relationship, the extending use case points to the base use case with a dotted line that has an arrowhead at the base use case; that dotted line is labeled as <<extend>>. This type of relationship is appropriate when you wish to model a variation of a complete use case as an alternative to the original use case. Another type of relationship is an include relationship, in which one use case uses the functionality of another. In this case, a dotted arrow points from one use case to the use case that it relies on for the additional functionality, and the dotted line is labeled with <<include>>. This type of relationship is appropriate when the intent is to factor a common among multiple use cases into a shared generalized use case. Another type of association can exist between different actors; in this case one actor role is a generalization of a more specific actor role, and the representation is with a solid arrow that leads from the specific actor role to the more general actor role. The distinction between an abstract and a non-abstract use case is determined based on whether the use case is initiated by an actor or another use case; those use cases that are initiated by other use cases instead of actors are called abstract use cases.

                                          Page Reference:  164-167, 170                      Difficulty:  Moderate


46.  Draw a use case diagram for an ATM machine with the following functionality. A customer’s interaction with the system involves logging in, making withdrawal requests, deposit requests, and balance inquiry requests. If the customer logs in, there is a possibility (although rare) that the system will confiscate the card (for example, if the login is incorrect or if the bank determines that the customer’s balance is significantly under zero). Card confiscation involves triggering an alert, which will be received by the branch manager of the bank. If the customer does a balance inquiry, this of course causes the system to check the balance. Checking the balance is also done when the customer requests a withdrawal, since the system must verify that enough money is in his account. In principle, checking the balance is a function that may be performed to support many use cases throughout the system.


Answer: (See next page.)


                                          Page Reference:  entire chapter                      Difficulty:  Hard


47.  Draw a use case diagram for a hospital admissions system. This system serves six types of users: patients, admissions receptionists, floor nurses, medical technologists, physicians, and release receptionists. When a patient comes to the hospital, the patient and admissions technologist use the system to perform a check-in procedure. Check-in procedures all involve the same steps, such as getting patient information, insurance, information, etc. Some check-ins are for inpatients; for these there are additional check-in steps for assigning the patient to a room and bed. The floor nurse uses the system to perform two tasks. First is the task of obtaining a list of all patients on the floor. Second is a task of entering patient notes. The medical technologist also performs two tasks on the system. One is to retrieve the patient record, and the second is to enter lab service notes. The physician performs two tasks as well, one of which is to obtain her rounds schedule and the other is to enter patient notes (which is the same system process used by the floor nurse). Finally, the patient and release receptionist go through the check-out procedure.

As can be expected, there are some tasks that are shared by several processes. Specifically, check-in, check-out, entering patient notes and entering lab services all require updating the patient record in the database. Also, retrieving the patient record is a task required to support processes such as listing floor patients, receiving rounds schedules, and updating the patient record.

Answer:

                                          Page Reference:  entire chapter                      Difficulty:  Hard


48.  List and describe the sections of Cockburn’s written use case template, discussing the sorts of information contained in each section.


Answer:

Cockburn’s use case template consists of the following sections: a title, the primary actor, an indicator of the level, a list of stakeholders, a precondition, a minimal guarantee, a success guarantee, a trigger, a main success scenario, and a list of extensions. The title is the name of the use case, similar to the name that will appear in the oval of a use case diagram. The primary actor is the role that is directly associated with the use case. Level has to do with the level of detail at which the use case is described. Cockburn suggested five levels, from most abstract to most detailed: white, kite, blue, fish, and black. The stakeholders are the people in whose interest the system is being developed. Preconditions are criteria which must be satisfied in order for the use case to start. The minimal guarantee is the very least promised about the result of the use case; this would correspond to a failure condition in the use case. At the very least, a failure condition should not result in any detrimental effects to the system as a whole. The success guarantee identifies what the stakeholders can expect as a result when the use case successfully accomplishes its tasks. The trigger is an event that initiates a use case. The main success scenario outlines the user interaction steps that take place in order to meet the success guarantee. Extensions are a list of behaviors or functions in the use case that take place if steps in the main success scenario fail for some reason.   

                                          Page Reference:  172-175                  Difficulty:  Moderate


49.  Using the template suggested by Cockburn, create a written use case for the following scenario:

An employee must record his or her time and expenses in order to assist the payroll department to process correct payments to the employee. The activities that the employee should perform will begin by viewing the screen for entering time reporting information. The employee will enter time reporting information for each task performed during the pay period and then submit this information to the system. When the system receives this submitted information, it will look up salary and benefits data for the employee and use this to calculate payment, then respond with an acknowledgement that details all time reporting information as well as the total pay amount that will accrue to the employee.

Similarly, the employee should be able to view a form containing all expense-related information, and then enter expense data and submit this to the system. When the system receives this submittal, it will look up expense categories to verify that the employee is qualified to claim reimbursement, and then presents an acknowledgement detailing all expenses and the total reimbursement.

In the case that a failure occurs in time reporting, the system should present the detailed error message about the cause of failure, and instruct the user which inputs need to be corrected. The employee may then decide to retry, or simply cancel the operation. Similar activities should occur for dealing with expense reporting errors.

The main beneficiaries of this use case will be the employee, of course, as well as the payroll department.  The use case will be triggered when the user selects time and expense reporting from a menu of options, but ONLY  if the employee as already logged into the system with a valid employeeID and password, and ONLY if the employee has not already submitted time or expense information for the given pay period.

The best-case scenario in this use case is for the time and expense information to have been successfully entered into the system and positive acknowledgements sent back to the user, but at the very least, the system should be able to rolls back any uncompleted transaction and log an error message so that the system administrator can be alerted.



Answer:

Title: Record Time and Expenses
Primary Actor: Employee
Level: Kite
Stakeholders: Employee, Payroll Department
Precondition: Employee has logged in with a valid Employee ID and password, and the employee has not already entered time and expenses for the current pay period.
Trigger: Employee selects Time and Expenses from the menu of options.
Minimum Guarantee: System rolls back any uncompleted transaction and an error log is recorded for the system administrator.
Success Guarantee: Employee’s time and expense information is loaded into the database and an acknowledgment message detailing the time and expenses are displayed to the employee with option for printing.
Main success scenario:
1)      the employee is presented with a screen for entering time reporting information
2)      employee enters time reporting information for each task performed during the pay period
3)      employee submits time reporting information to the system
4)      the system looks up salary and benefits information for the employee in order to calculate payment
5)      the system presents an acknowledgment to the employee detailing all time reporting information, and a total pay amount that will accrue to the employee
6)      the employee is presented with a screen for entering expense reporting information
7)      employee enters expense reporting information for all expenses accrued during the pay period
8)      employee submits expense reporting information
9)      the system looks up expense categories and employee information to verify that employee is qualified to claim all expenses submitted
10)  the system presents an acknowledgment to the employee detailing all expenses and totaling the amount of money that will be refunded to the employee
Extensions
1)      Time reporting submission fails
a.       Message created to tell employee about specific errors, identifying the inputs that need correction, and allowing employee to retry the time report submission
b.      Employee either retries entering the time reporting information or cancels time reporting
2)      Expense reporting submission fails
a.       Message created to tell employee about specific errors, identifying the inputs that need correction, and allowing employee to retry the expense report submission
b.      Employee either retries entering the expense reporting information or cancels expense reporting

                                          Page Reference:  172-180                  Difficulty:  Hard



50.  Discuss the goal of completeness as it relates to use case modeling. Why is it important for systems development? Describe some ways in which the goal of completeness can be achieved during the requirements structuring process.

Answer:

When developing a use case model, it is important to represent as much of the system functionality as possible. The more complete the model, the more likely the completed system will, in fact, meet all the customer needs. There are a variety of approaches the systems analyst can use to ensure completeness. One is to work continuously with the customer to revise and refine requirements as the use cases are being written. In this sense, requirements structuring and requirements determination are taking place in parallel. Making use of rapid prototyping in conjunction with use case modeling also helps ensure completeness, as use cases can be refined based on user feedback regarding prototype functionality, and the modified use cases can in turn lead to improvements in the prototype. Yet another way of facilitating completeness is to develop the user manual early in the requirements structuring process. The user manual can provide lists of functionality that can be used to generate new use cases or fill in details of existing use cases in the model.

                                          Page Reference:  179-180                  Difficulty:  Moderate

1 comment:

  1. Nice compilation of questions but..
    why can't i see the images for the use case diagrams? :/

    ReplyDelete