Chapter 5 – Extending the Requirements Models Solutions to End-Of-Chapter Problems
Total Page:16
File Type:pdf, Size:1020Kb
Systems Analysis and Design in a Changing World, sixth edition 5-1 Chapter 5 – Extending the Requirements Models Solutions to End-of-Chapter Problems Review Questions 1. What are the models that describe use cases in more detail? Fully developed use case description, activity diagrams, and system sequence diagrams. 2. What two UML diagrams are used to model domain classes? Problem domain class diagram and state machine diagram. 3. Which part of a use case description can also be modeled by using an activity diagram? The “flow of activities” section. 4. Explain the difference between a use case and a scenario. Give a specific example of a use case with a few possible scenarios. A use case is the entire function or user goal or event. A scenario is one specific version or instance of that use case. From RMO we have Create customer account as a use case. But we might have Create online Customer account and Create instore customer account and even Create phone customer account as different scenarios. 5. List the parts or compartments of a fully developed use case description. Use case name Scenario Triggering event Brief description Actors Related use cases Stakeholders Preconditions Postconditions Flow of activities Exception conditions 6. Compare/contrast precondition and postcondition. A precondition describes the “states” of data and the system that must exist before the use case can begin. For example to add an item to a shopping cart, the item must exist in the database. A postcondition describes the states of data and the system that must exist after the use case completes. For example after Create a customer account use case, a customer account object (record) must exist. Systems Analysis and Design in a Changing World, sixth edition 5-2 7. Compare/contrast postcondition and exception condition. A post condition, as explained about describes states of the data and the system. An exception condition describes some non-normal situation in the processing, i.e. in the flow of activities, that must be handled in some way.. 8. Compare/contrast business process and flow of activities for a use case. Explain how an activity diagram can be used to model both. A business process is larger than a use case. A business process might include various manual business procedures both before and after the “business event” that causes the use case to occur. However, an activity diagram is a powerful model to describe all types of sequences of tasks and activities. The various swimlanes can represent various users or user groups as well as system activities. 9. What is the purpose of an SSD? What symbols are used in an SSD? An SSD (system sequence diagram) is used to describe the messages that flow into and out of a system, i.e. between the system and the use case user. The symbols include: Stick figure for the actor Box with object name for the system object Vertical dashed lines for object lifelines Horizontal arrows for messages Horizontal dashed arrows for return data Comment box for comments 10. What are the steps required to develop an SSD? 1. Identify the input messages (from the activity diagram) 2. Describe the input message using the SSD message syntax 3. Add message conditions such as looping or true/false conditions 4. Add all output message data 11. Write a complete SSD message from the actor to the system, with the actor asking the system to begin the process for updating information about a specific product. updateProductInformation (productID, updateInformation) 12. What is the name of the sequence diagram symbol used to represent the extension of an object throughout the duration of a use case? Lifeline or object lifeline 13. What are the two ways to show a returned value on a sequence diagram? Either with a return value on the left hand side of the equal (:=) sign, or with a return message shown by a dashed line and labeled with the return data. Systems Analysis and Design in a Changing World, sixth edition 5-3 14. What are two ways to show repetition on a sequence diagram? Either with an asterisk on the message label or a loop frame around the message(s). 15. What are the three types of frames used on a sequence diagram? Loop frame – repeat or loop the contents of the frame Opt frame – send or do not send the message based on true/false condition Alt frame – if-else alternative flows based on condition 16. What is the symbol for a true/false condition on a sequence diagram? A true/false condition is shown in brackets [ ] 17. What are the parameters of a message? The parameters represent the input data, i.e. the data that is being passed to the destination object. 18. List the primary steps for developing a SSD. Ooops, duplicate question. See question 10. 19. What is an object state? An object state is the state of being of an object, and is usually measured by a set of values. It is comparable to a status condition. 20. What is a state transition? A state transition is the movement of an object from one state to another state. 21. When considering requirements, states and state transitions are important for understanding which other diagram? States and Transitions are part of the state machine diagram for an object class. Therefore, they help to understand the objects in the class diagram. 22. What UML diagram is used to show the states and transitions for an object? States and Transitions are part of the state machine diagram, which describes the activity of the objects in an object class. 23. List the elements that make up a transition description. Which elements are optional? Systems Analysis and Design in a Changing World, sixth edition 5-4 Transition-name (parameters, ... ) [guard-condition] / action-expression Any of the three elements may be empty, i.e. are optional. 24. What is a composite state? What is it used for? A composite state is a high-level state in that it may have other states and transitions inside of it. It is used to represent concurrent states. For example, a printer may be in the “on” state, which is a composite state, and it may be “idle” which is an internal state within “on.” 25. What is meant by the term path? A path is a sequence of states and transitions. It may be a complete path to describe an entire origin to destination path, or it may be a “snippet” of a path and only contain a few states and transitions. 26. What is the purpose of a guard-condition? A guard-condition determines whether or not a transition can fire. Usually first the trigger fires to notify the transition that it should execute, but before it begins execution, it tests to see if the guard-condition is true. 27. Identify the models explained in this chapter and their relationship to one another. The two main models for requirements are the Use case model,which identifies the use cases or the “processes,” and the Domain model class diagram, which identifies the information or data for the system. The Use case diagram is supported by Use Case Descriptions, Activity diagrams, and System Sequence diagrams. The Domain model class diagram is supported by State machine diagrams. Systems Analysis and Design in a Changing World, sixth edition 5-5 Problems and Exercises 1. After reading the following narrative, do the following: i. Develop an activity diagram for each scenario. ii. Complete a fully developed use case description for each scenario. Contractor Sale activity diagram: Systems Analysis and Design in a Changing World, sixth edition 5-6 Contractor Sale fully developed use case description: Use Case Name: Create a new sale Scenario: Create new sale to a contractor (on account sale) Triggering Event: Contractor wants to purchase items. Brief Description: A contractor wants to purchase items. The clerk rings up the items and then adds them to the contractor’s account. Actors: Sales clerk Stakeholders: Sales clerk Accounting department Sales department Preconditions: Customer account must exist. Inventory items must exist. Postconditions: New sale is created. Sales line items are created and connected to the sale. Customer (contractor) account is updated. Flow of Activities: Actor System 1. Clerk enters contractor ID. 1.1 System validates contractor account. 2. Clerk enters each item. 2.1 System finds item in inventory, finds price, adds to 3. Clerk indicates the end of the sale. total. 3.1 System calculates total and 4. If contractor wants receipt, requests adds to contractor account. receipt. 4.1 System prints receipt. Exception 1.1 If contractor account is out of balance, treat this sale as a cash sale, or Conditions: stop process and send contractor to accounting clerk. 2.1 If system has information missing, sales clerk calls manager and manually enters information. 3.1 If contractor account balance is over the limit, treat as cash sale, cancel, or send contractor to accounting clerk. Systems Analysis and Design in a Changing World, sixth edition 5-7 Sale to public activity diagram: Systems Analysis and Design in a Changing World, sixth edition 5-8 Sale to public fully developed use case description: Use Case Name: Create a new sale Scenario: A new cash sale Triggering Event: Cash customer wants to purchase items. Brief Description: A cash customer wants to purchase items. The clerk enters the item ID, and the system creates a sales ticket. Customer pays with cash, check or credit card. Actors: Sales clerk Stakeholders: Sales clerk Accounting department Sales department Preconditions: Inventory items must exist. Postconditions: New sale is created.