Download presentation
Presentation is loading. Please wait.
Published byShonda Evans Modified over 8 years ago
1
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 4, Requirements Elicitation: Functional Modeling
2
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 2 Can you develop this?
3
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 3 Recap: Types of Scenarios As-is scenario: Used in describing a current situation. Usually used during re- engineering. The user describes the system. Visionary scenario: Used to describe a future system. Usually described in greenfield engineering or reengineering. Can often not be done by the user or developer alone Evaluation scenario: User tasks against which the system is to be evaluated Training scenario: Step by step instructions designed to guide a novice user through a system
4
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 4 What is This?
5
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 5 Possible Object Model: Innuit Innuit Size Dress() Smile() Sleep() Shoe Size Color Type Wear() Igloo lighting entrance enter() leave() livesIn * Coat Size Color Type Wear()
6
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 6 Alternative: Head Head Hair Dress() Smile() Sleep() Face Nose smile() close_ey e() Mouth Teeth Size open() speak() Ear Size listen() *
7
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 7 The Artist’s View Picture of Sculpture Picture Picture of Innuit View 1View 2 MouthEyes Nose JacketHands Legs
8
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 8 System and Object identification Development of a system is not just done by taking a picture of a scene or domain Two important problems during requirements engineering and requirements analysis: Identification of objects Definition of the system purpose Depending on the purpose of the system, different objects might be found What object is inside, what object is outside? How can we identify the purpose of a system? Scenarios Use cases: Abstractions of scenarios
9
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 9 Why Scenarios and Use Cases? Utterly comprehensible by the user Use cases model a system from the users’ point of view (functional requirements) Define every possible event flow through the system Description of interaction between objects Great tools to manage a project. Use cases can form basis for whole development process User manual System design and object design Implementation Test specification Client acceptance test An excellent basis for incremental & iterative development Use cases have also been proposed for business process reengineering (Ivar Jacobson)
10
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 10 How do we find scenarios? Don’t expect the client to be verbal if the system does not exist (greenfield engineering) Don’t wait for information even if the system exists Engage in a dialectic approach (evolutionary, incremental) You help the client to formulate the requirements The client helps you to understand the requirements The requirements evolve while the scenarios are being developed
11
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 11 Example: Accident Management System What needs to be done to report a “Cat in a Tree” incident? What do you need to do if a person reports “Warehouse on Fire?” Who is involved in reporting an incident? What does the system do if no police cars are available? If the police car has an accident on the way to the “cat in a tree” incident? What do you need to do if the “Cat in the Tree” turns into a “Grandma has fallen from the Ladder”? Can the system cope with a simultaneous incident report “Warehouse on Fire?”
12
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 12 Scenario Example: Warehouse on Fire Bob, driving down main street in his patrol car notices smoke coming out of a warehouse. His partner, Alice, reports the emergency from her car. Alice enters the address of the building, a brief description of its location (i.e., north west corner), and an emergency level. In addition to a fire unit, she requests several paramedic units on the scene given that area appear to be relatively busy. She confirms her input and waits for an acknowledgment. John, the Dispatcher, is alerted to the emergency by a beep of his workstation. He reviews the information submitted by Alice and acknowledges the report. He allocates a fire unit and two paramedic units to the Incident site and sends their estimated arrival time (ETA) to Alice. Alice received the acknowledgment and the ETA.
13
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 13 Observations about Warehouse on Fire Scenario Concrete scenario Describes a single instance of reporting a fire incident. Does not describe all possible situations in which a fire can be reported. Participating actors Bob, Alice and John
14
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 14 Next goal, after the scenarios are formulated: Find a use case in the scenario that specifies all possible instances of how to report a fire Example: “Report Emergency “ in the first paragraph of the scenario is a candidate for a use case Describe this use case in more detail Describe the entry condition Describe the flow of events Describe the exit condition Describe exceptions Describe special requirements (constraints, nonfunctional requirements)
15
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 15 Example of steps in formulating a use case First name the use case Use case name: ReportEmergency Then find the actors Generalize the concrete names (“Bob”) to participating actors (“Field officer”) Participating Actors: Field Officer (Bob and Alice in the Scenario) Dispatcher (John in the Scenario) ? Then concentrate on the flow of events Use informal natural language
16
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 16 Example of steps in formulating a use case Formulate the Flow of Events: The FieldOfficer activates the “Report Emergency” function on her terminal. FRIEND responds by presenting a form to the officer. The FieldOfficer fills the form, by selecting the emergency level, type, location, and brief description of the situation. The FieldOfficer also describes possible responses to the emergency situation. Once the form is completed, the FieldOfficer submits the form, at which point, the Dispatcher is notified. The Dispatcher reviews the submitted information and creates an Incident in the database by invoking the OpenIncident use case. The Dispatcher selects a response and acknowledges the emergency report. The FieldOfficer receives the acknowledgment and the selected response. Start using Abbot’s technique for object identification in parallel to the use case modeling!
17
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 17 Example of steps in formulating a use case Write down the exceptions: The FieldOfficer is notified immediately if the connection between her terminal and the central is lost. The Dispatcher is notified immediately if the connection between any logged in FieldOfficer and the central is lost. Identify and write down any special requirements: The FieldOfficer’s report is acknowledged within 30 seconds. The selected response arrives no later than 30 seconds after it is sent by the Dispatcher.
18
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 18 How to Specify a Use Case (Summary) Name of Use Case Actors Description of actors involved in use case Entry condition Use a syntactic phrase such as “This use case starts when…” Flow of Events Free form, informal natural language Exit condition Star with “This use cases terminates when…” Exceptions Describe what happens if things go wrong Special Requirements List nonfunctional requirements and constraints
19
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 19 Use Case Model for Incident Management ReportEmergency FieldOfficer Dispatcher OpenIncident AllocateResources
20
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 20 Use Case Associations Use case association = relationship between use cases Important types: Extends A use case extends another use case Include A use case uses another use case (“functional decomposition”) Generalization An abstract use case has different specializations
21
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 21 >: Functional Decomposition Problem: A function in the original problem statement is too complex to be solvable immediately Solution: Describe the function as the aggregation of a set of simpler functions. The associated use case is decomposed into smaller use cases CreateDocument Scan OCR Check >
22
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 22 >: Reuse of Existing Functionality Problem: There are already existing functions. How can we reuse them? Solution: The include association from a use case A to a use case B indicates that an instance of the use case A performs all the behavior described in the use case B (“A delegates to B”) Example: The use case “ViewMap” describes behavior that can be used by the use case “OpenIncident” (“ViewMap” is factored out) Note: The base case cannot exist alone. It is always called with the supplier use case ViewMap OpenIncident AllocateResources > Base Use Case Supplier Use Case
23
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 23 ReportEmergency FieldOfficer Help > > Association for Use Cases Problem: The functionality in the original problem statement needs to be extended. Solution: An extend association from a use case A to a use case B indicates that use case B is an extension of use case A. Example: The use case “ReportEmergency” is complete by itself, but can be extended by the use case “Help” for a specific scenario in which the user requires help Note: In an extend assocation, the base use case can be executed without the use case extension
24
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 24 ValidateUser CheckPassword CheckFingerprint Parent Case Child Use Case Generalization association in use cases Problem: You have common behavior among use cases and want to factor this out. Solution: The generalization association among use cases factors out common behavior. The child use cases inherit the behavior and meaning of the parent use case and add or override some behavior. Example: Consider the use case “ValidateUser”, responsible for verifying the identity of the user. The customer might require two realizations: “CheckPassword” and “CheckFingerprint”
25
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 25 How do I find use cases? Select a narrow vertical slice of the system (i.e. one scenario) Discuss it in detail with the user to understand the user’s preferred style of interaction Select a horizontal slice (i.e. many scenarios) to define the scope of the system. Discuss the scope with the user Use mock-ups as visual support Find out what the user does Task observation (Good) Questionnaires (Bad)
26
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 26 From Use Cases to Objects Top Level Use Case Level 2 Use Cases Level 3 Use Cases Operations Participating Objects Level 2 Level 1 Level 2 Level 3 Level 3 Level 4 Level 4 Level 3 AB
27
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 27 Finding Participating Objects in Use Cases For any use case do the following Find terms that developers or users need to clarify in order to understand the flow of events Always start with the user’s terms, then negotiate: –FieldOfficerStationBoundary or FieldOfficerStation? –IncidentBoundary or IncidentForm? –EOPControl or EOP? Identify real world entities that the system needs to keep track of. Examples: FieldOfficer, Dispatcher, Resource Identify real world procedures that the system needs to keep track of. Example: EmergencyOperationsPlan Identify data sources or sinks. Example: Printer Identify interface artifacts. Example: PoliceStation Do textual analysis to find additional objects (Use Abott’s technique) Model the flow of events with a sequence diagram
28
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 28 Summary In this lecture, we reviewed the requirements elicitation activities aimed at defining the boundary of the system: Scenario identification Use case identification and refinement Identification of participating objects Requirements elicitation is to build a functional model of the system which will then be used during analysis to build an object model and a dynamic model.
29
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 5, Analysis: Object Modeling
30
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 30 Outline From use cases to objects Object modeling Class vs instance diagrams Attributes Operations and methods Links and associations Examples of associations Two special associations Aggregation Inheritance
31
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 31 From Use Cases to Objects Level 1 Use Case Level 2 Use Cases Level 3 Use Cases Operations Participating Objects Level 2 Level 1 Level 2 Level 3 Level 3 Level 4 Level 4 Level 3 AB
32
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 32 From Use Cases to Objects: Why Functional Decomposition is not Enough Scenarios Level 1 Use Cases Level 2 Use Cases Operations Participating Objects Level 2 Level 1 Level 2 Level 3 Level 3 Level 4 Level 4 Level 3 AB
33
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 33 How do we describe complex systems (Natural Systems, Social Systems, Artificial Systems)? Epistemology Knowledge about Causality (Dynamic Model) Describes our knowledge about the system Knowledge about Functionality (Functional model) Knowledge about Relationships (Object model) Neural Networks DataFlow Diagrams (SA/SD) Scenarios/Use Cases (Jacobsen) Formal Specifications (Liskov) State Diagrams (Harel) Petri Nets(Petri) Inheritance Frames,SemanticNet works (Minsky) Uncertain Knowledge Fuzzy Sets (Zadeh) Data Relationship (E/R Modeling, Chen) Hierarchical Database Model (IMS) Network Database Model (CODASYL) Relational Database Model (Codd) Fuzzy Frames (Graham) Class Diagrams (“E/R + Inheritance”, Rumbaugh) Sequence Diagrams Activity Diagrams
34
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 34 Definition: Object Modeling Main goal: Find the important abstractions What happens if we find the wrong abstractions? Iterate and correct the model Steps during object modeling 1. Class identification Based on the fundamental assumption that we can find abstractions 2. Find the attributes 3. Find the methods 4. Find the associations between classes Order of steps Goal: get the desired abstractions Order of steps secondary, only a heuristic Iteration is important
35
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 35 Class Identification Identify the boundaries of the system Identify the important entities in the system Class identification is crucial to object-oriented modeling Basic assumption: 1. We can find the classes for a new software system (Forward Engineering) 2. We can identify the classes in an existing system (Reverse Engineering) Why can we do this? Philosophy, science, experimental evidence
36
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 36 Class identification is an ancient problem Objects are not just found by taking a picture of a scene or domain The application domain has to be analyzed. Depending on the purpose of the system different objects might be found How can we identify the purpose of a system? Scenarios and use cases Another important problem: Define system boundary. What object is inside, what object is outside?
37
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 37 What is This?
38
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 38 Pieces of an Object Model Classes Associations (Relations) Part of- Hierarchy (Aggregation) Kind of-Hierarchy (Generalization) Attributes Detection of attributes Application specific Attributes in one system can be classes in another system Turning attributes to classes Methods Detection of methods Generic methods: General world knowledge, design patterns Domain Methods: Dynamic model, Functional model
39
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 39 Object vs Class Object (instance): Exactly one thing The lecture on September 7 on Software Engineering from 9:00 - 10:20 A class describes a group of objects with similar properties IETM, Author, Corrosion, Work order Object diagram: A graphic notation for modeling objects, classes and their relationships ("associations"): Class diagram: Template for describing many instances of data. Useful for taxonomies, patters, schemata... Instance diagram: A particular set of objects relating to each other. Useful for discussing scenarios, test cases and examples Together-J: CASE Tool for building object diagrams, in particular class diagrams
40
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 40 UML: Class and Instance Diagrams Inspector joe: Inspector mary: Inspector anonymous: Inspector Class Diagram Instance Diagram
41
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 41 Attributes and Values name:string age: integer Inspector name = “Joe” age = 24 joe:Inspector name = “Mary” age = 18 mary: Inspector
42
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 42 Operation, Signature or Method? What when? Operation: A function or transformation applied to objects in a class. All objects in a class share the same operations (Analysis Phase) Signature: Number & types of arguments, type of result value. All methods of a class have the same signature (Object Design Phase) Method: Implementation of an operation for a class (Implementation Phase) Polymorphic operation: The same operation applies to many different classes. Workorder File_name: String Size_in_bytes: integer Last_update: date Stickies: array[max] print() delete() open() close() write() read()
43
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 43 Links and Associations Links and associations establish relationships among objects and classes. Link: A connection between two object instances. A link is like a tuple. A link is an instance of an association Association: Basically a bidirectional mapping. One-to-one, many-to-one, one-to-many, An association describes a set of links like a class describes a set of objects.
44
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 44 1-to-1 and 1-to-many Associations Has- capital One-to-one association One-to-many association City name:String Workorder schedule() StickyNote x: Integer y: Integer z: Integer * Country name:String
45
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 45 Object Instance Diagram Example for 1-to-many :Sticky x,y,z=(-1,0,5) :WorkOrder:Sticky x,y,z=(1,10,1) :Sticky x,y,z=(10,1,2)
46
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 46 Many-to-Many Associations Work on ** MechanicsPlane
47
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 47 Do UML associations have direction? A association between two classes is by default a bi-directional mapping. Class A can access class B and class B can access class A Both classes play the agent role. AB If you want to to make A a client, and B a server, you can make the association unidirectional. The arrowhead points to the server role: Class A ( the “client”) accesses class B (“the server”). B is also called navigable AB accesses Name Direction Name of association Association Direction
48
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 48 Aggregation Models "part of" hierarchy Useful for modeling the breakdown of a product into its component parts (sometimes called bills of materials (BOM) by manufacturers) UML notation: Like an association but with a small diamond indicating the assembly end of the relationship.
49
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 49 weight Automobile serial number year manufacturer model color drive purchase Aggregation Engine horsepower volume on off 3,4,5 Wheel diameter number of bolts 2,4 Door open close Battery amps volts charge discharge * Brakelight on off
50
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 50 Inheritance Models "kind of" hierarchy Powerful notation for sharing similarities among classes while preserving their differences UML Notation: An arrow with a triangle Cell MuscleCellBloodCellNerveCell StriateSmoothRedWhitePyramidalCortical
51
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 51 Aggregation vs Inheritance Both associations describe trees (hierarchies) Aggregation tree describes a-part-of relationships (also called and-relationship) Inheritance tree describes "kind-of" relationships (also called or-relationship) Aggregation relates instances (involves two or more different objects) Inheritance relates classes (a way to structure the description of a single object)
52
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 52 Other Associations Uses: A subsystem uses another subsystem (System Design) Contains: Sometimes called “spatial aggregation” ... contains... Example: A UML package contains another UML package Parent/child relationship: ... is father of... ... is mother of... Seniority: ... is older than... ... is more experienced than...
53
UNB CS3013 Software Engineering II lectures adapted from Bernd Bruegge & Allen Dutoit, Object-Oriented Software Engineering: Conquering Complex and Changing Systems 53 Object Types Entity Objects Represent the persistent information tracked by the system (Application domain objects, “Business objects”) Boundary Objects Represent the interaction between the user and the system Control Objects: Represent the control tasks performed by the system Having three types of objects leads to models that are more resilient to change. The boundary of a system changes more likely than the control The control of the system change more likely than the application domain Object types originated in Smalltalk: Model, View, Controller (MV)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.