Download presentation
Presentation is loading. Please wait.
Published byVernon Franklin Modified over 9 years ago
1
1 Chapter 7 Requirement Modeling flow, behavior, patterns and Webapps
2
A Roadmap Use-cases Use-cases Use-case diagrams Use-case diagrams Activity diagrams Activity diagrams Swimlane diagrams Swimlane diagrams Data object diagrams ERD diagrams Data flow diagrams Process specifications We are going to examine some of the key tools used for creating an analysis model. General Structured AnalysisOO Analysis Class diagrams Packages CRC cards Sequence Diagrams These tools are not specific to either structured analysis or OO analysis.
3
Requirement Modeling Strategies Structured Analysis Structured Analysis Data and processes defined in terms of attributes and relationships Data and processes defined in terms of attributes and relationships Processes transform data as data objects Processes transform data as data objects Flow oriented, behavioral models, special requirement analysis Flow oriented, behavioral models, special requirement analysis Who does it? Who does it? What are the steps? What are the steps? What are the work products? What are the work products? How do I ensure that I’ve done it right? How do I ensure that I’ve done it right? 3
4
4 Data Modeling examines data objects independently of processing examines data objects independently of processing focuses attention on the data domain focuses attention on the data domain creates a model at the customer’s level of abstraction creates a model at the customer’s level of abstraction indicates how data objects relate to one another indicates how data objects relate to one another
5
5 What is a Data Object? Object —something that is described by a set of attributes (data items) and that will be manipulated within the software (system) eachinstance of an object (e.g., a book) can be identified uniquely (e.g., ISBN #) each plays a necessary role in the system i.e., the system could not function without access to instances of the object each is described by attributes that are themselves data items
6
6 Typical Objects external entities (printer, user, sensor) things (e.g, reports, displays, signals) (e.g, reports, displays, signals) occurrences or events (e.g., interrupt, alarm) roles (e.g., manager, engineer, salesperson) organizational units (e.g., division, team) (e.g., division, team) places (e.g., manufacturing floor) (e.g., manufacturing floor) structures (e.g., employee record)
7
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 7 Data Objects and Attributes A data object contains a set of attributes that act as an aspect, quality, characteristic, or descriptor of the object object: automobile attributes: make make model model body type body type price price options code options code
8
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 8 What is a Relationship? relationship —indicates “connectedness”; a "fact" that must be "remembered" by the system and cannot or is not computed or derived mechanically several instances of a relationship can exist several instances of a relationship can exist objects can be related in many different ways objects can be related in many different ways
9
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 9 ERD Notation (0, m) (1, 1) object object relationship 1 2 One common form: (0, m) (1, 1) object 1 object 2 relationship Another common form: attribute
10
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 10 Building an ERD Level 1—model all data objects (entities) and their “connections” to one another Level 1—model all data objects (entities) and their “connections” to one another Level 2—model all entities and relationships Level 2—model all entities and relationships Level 3—model all entities, relationships, and the attributes that provide further depth Level 3—model all entities, relationships, and the attributes that provide further depth
11
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 11 The ERD: An Example (1,1) (1,m) places Customer request for service generates (1,n) (1,1) workorder worktasks materials consistsof lists (1,1) (1,w) (1,1) (1,i) selectedfrom standard task table (1,w) (1,1)
12
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 12 Object-Oriented Concepts Must be understood to apply class-based elements of the analysis model Must be understood to apply class-based elements of the analysis model Key concepts: Key concepts: Classes and objects Classes and objects Attributes and operations Attributes and operations Encapsulation and instantiation Encapsulation and instantiation Inheritance Inheritance
13
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 13 Classes object-oriented thinking begins with the definition of a class, often defined as: object-oriented thinking begins with the definition of a class, often defined as: – template – generalized description – “blueprint”... describing a collection of similar items a metaclass (also called a superclass) establishes a hierarchy of classes a metaclass (also called a superclass) establishes a hierarchy of classes once a class of items is defined, a specific instance of the class can be identified once a class of items is defined, a specific instance of the class can be identified
14
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 14 Building a Class
15
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 15 What is a Class? external entities things occurrences roles organizational units places structures class name attributes: operations:
16
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 16 Encapsulation/Hiding The object encapsulates both data and the logical procedures required to manipulate the data Achieves “information hiding” method # 1 data method # 2 method # 4 method # 5 method # 6 method # 3
17
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 17 Class Hierarchy Chair Table Desk”Chable" instances of Chair PieceOfFurniture (superclass) subclasses of the
18
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 18 Methods (a.k.a. Operations, Services) An executable procedure that is encapsulated in a class and is designed to operate on one or more data attributes that are defined as part of the class. A method is invoked via message passing.
19
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 19 Scenario-Based Modeling “[Use-cases] are simply an aid to defining what exists outside the system (actors) and what should be performed by the system (use-cases).” Ivar Jacobson (1) What should we write about? (2) How much should we write about it? (3) How detailed should we make our description? (4) How should we organize the description?
20
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 20 Use-Cases a scenario that describes a “thread of usage” for a system a scenario that describes a “thread of usage” for a system actors represent roles people or devices play as the system functions actors represent roles people or devices play as the system functions users can play a number of different roles for a given scenario users can play a number of different roles for a given scenario
21
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 21 Developing a Use-Case What are the main tasks or functions that are performed by the actor? What are the main tasks or functions that are performed by the actor? What system information will the the actor acquire, produce or change? What system information will the the actor acquire, produce or change? Will the actor have to inform the system about changes in the external environment? Will the actor have to inform the system about changes in the external environment? What information does the actor desire from the system? What information does the actor desire from the system? Does the actor wish to be informed about unexpected changes? Does the actor wish to be informed about unexpected changes?
22
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 22 Use-Case Diagram
23
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 23 Activity Diagram Supplements the use-case by providing a diagrammatic representation of procedural flow
24
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 24 Swimlane Diagrams Allows the modeler to represent the flow of activities described by the use-case and at the same time indicate which actor (if there are multiple actors involved in a specific use-case) or analysis class has responsibility for the action described by an activity rectangle
25
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 25 Flow-Oriented Modeling Represents how data objects are transformed at they move through the system A data flow diagram (DFD) is the diagrammatic form that is used Considered by many to be an ‘old school’ approach, flow- oriented modeling continues to provide a view of the system that is unique—it should be used to supplement other analysis model elements
26
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 26 The Flow Model Every computer-based system is an information transform.... computerbasedsystem input output
27
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 27 Flow Modeling Notation external entity process data flow data store
28
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 28 External Entity A producer or consumer of data Examples: a person, a device, a sensor Another example: computer-based system Data must always originate somewhere and must always be sent to something
29
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 29 Process A data transformer (changes input to output) Examples: compute taxes, determine area, format report, display graph Data must always be processed in some way to achieve system function
30
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 30 Data Flow Data flows through a system, beginning as input and be transformed into output. computetrianglearea base height area
31
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 31 Data Stores Data is often stored for later use. look-upsensordata sensor # report required sensor #, type, location, age sensor data sensor number type, location, age
32
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 32 Data Flow Diagramming: Guidelines all icons must be labeled with meaningful names all icons must be labeled with meaningful names the DFD evolves through a number of levels of detail the DFD evolves through a number of levels of detail always begin with a context level diagram (also called level 0) always begin with a context level diagram (also called level 0) always show external entities at level 0 always show external entities at level 0 always label data flow arrows always label data flow arrows do not represent procedural logic do not represent procedural logic
33
Data Flow Diagrams Models data elements Attributes Relationships Models processes that transform data Structured Analysis: Data object diagrams ERD diagrams modeled using Data flow diagram Process narrative modeled using A data flow diagram describes information flow among a set of processes and actors. A process narrative describes how a single process transforms input data to output data. Modeling Tools: 1 *
34
Data Objects Plays a necessary role Plays a necessary role Characterized by attributes Characterized by attributes Uniquely identifiable (?) Uniquely identifiable (?) Roles Roles Events Events Places Places A data object is a domain element that will be manipulated by the system. Characteristics:Examples: External entities Structures Other things Object: car Attributes: ID # Make Model Price Modeling
35
Relationships, Cardinality, Modality Cardinality Cardinality Defines the number of items on either end of a connection Defines the number of items on either end of a connection Relationships Define connections between objects Modality Defines the necessity of a connection Person Car ownsinsured 11 ** Trailer attache d 1 1 Entity-Relationship Diagram (ERD)
36
DFD: A Basic Example SafeHome software SafeHome software Control panel Control panel Sensors Panel display Panel display Alarm Telephone line Telephone line commands and data sensor status display information telephone tones alarm type External entities (squares) Data flows (directed edges) Processe s (circles) Notice that the system is represented as a single bubble. This is known as a level 0 DFD, or a context diagram.
37
DFDs and Progressive Refinement Each DFD reveals progressively more detail than the DFD that preceded it. Level 1 DFD: Interact with user Interact with user Control panel Control panel commands and data Configure system Configure system Configure request Activate / deactivate system Activate / deactivate system Start/stop request Process password Process password … … … Refinement continues until each bubble can be (easily) implemented as a program module.
38
Process Narrative Process password Process password … … A process specification describes all of the flow processes in the final (most detailed) DFD. A process specification can be represented as a collection of process narratives. “The process password transform performs password validation at the control panel for the SafeHome security function. Process password receives a four-digit password from the interact with user function. The password is first compared to the master password stored within the system …”
39
How are DFDs Constructed? Grammatical parse Develop process narratives Level 0 DFD Scope document Grammatical parse Next level DFD (nouns = external entities, data/control objects, data stores) (verbs = processes) Note that nouns and verbs are associated with one another.
40
Some Guidelines Level 0 DFD should contain only a single bubble Level 0 DFD should contain only a single bubble All arrows and bubbles should be meaningfully labeled All arrows and bubbles should be meaningfully labeled Refinement begins by isolating next level processes, data objects, and data stores Refinement begins by isolating next level processes, data objects, and data stores Refine only one bubble at a time Refine only one bubble at a time Data flow continuity must be maintained between levels Data flow continuity must be maintained between levels
41
Let’s Try it Out! The video library management system will interact with the user through a web-based browser interface. When the user logs into the system, the system will determine the user’s access privileges based on the user configuration database. If the user is an administrator, the system will allow the user to enter new movie titles, new actor information, etc. If the user is not an administrator, the system will allow the user to query the system based on movie title, actor, director, etc. The Video Library Management System What might the level 0 DFD look like? Level 1? An excerpt from the scope document:
42
And a Bit of Review The system will allow the user to store a number of information elements with each video, director, and actor. Each video will be characterized by a title, a genre descriptor, a short synopsis, a list of directors, a list of actors, a rating, and a UPC code. Each actor and director will be characterized by a first and last name, a year of birth, and a brief biography. When the user is viewing a video entry, they will be able to retrieve the full actor (or director) information by clicking the actor’s (or director’s) name. Another excerpt from the scope document: What would be an appropriate ERD diagram for this excerpt?
43
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 43 Constructing a DFD—I review the data model to isolate data objects and use a grammatical parse to determine “operations” review the data model to isolate data objects and use a grammatical parse to determine “operations” determine external entities (producers and consumers of data) determine external entities (producers and consumers of data) create a level 0 DFD create a level 0 DFD
44
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 44 Level 0 DFD Example user processingrequest videosource HDTV video signal digitalvideoprocessor requestedvideosignal monitor
45
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 45 Constructing a DFD—II write a narrative describing the transform write a narrative describing the transform parse to determine next level transforms parse to determine next level transforms “balance” the flow to maintain data flow continuity “balance” the flow to maintain data flow continuity develop a level 1 DFD develop a level 1 DFD use a 1:5 (approx.) expansion ratio use a 1:5 (approx.) expansion ratio
46
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 46 The Data Flow Hierarchy P a b xy p1 p2 p3 p4 5 a b c d e f g level 0 level 1
47
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 47 Flow Modeling Notes each bubble is refined until it does just one thing each bubble is refined until it does just one thing the expansion ratio decreases as the number of levels increase the expansion ratio decreases as the number of levels increase most systems require between 3 and 7 levels for an adequate flow model most systems require between 3 and 7 levels for an adequate flow model a single data flow item (arrow) may be expanded as levels increase (data dictionary provides information) a single data flow item (arrow) may be expanded as levels increase (data dictionary provides information)
48
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 48 Process Specification (PSPEC) PSPEC narrative pseudocode (PDL) equations tables diagrams and/or charts bubble
49
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 49 Maps into DFDs: A Look Ahead analysis model design model
50
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 50 Control Flow Diagrams Represents “events” and the processes that manage events Represents “events” and the processes that manage events An “event” is a Boolean condition that can be ascertained by: An “event” is a Boolean condition that can be ascertained by: listing all sensors that are "read" by the software. listing all sensors that are "read" by the software. listing all interrupt conditions. listing all interrupt conditions. listing all "switches" that are actuated by an operator. listing all "switches" that are actuated by an operator. listing all data conditions. listing all data conditions. recalling the noun/verb parse that was applied to the processing narrative, review all "control items" as possible CSPEC inputs/outputs. recalling the noun/verb parse that was applied to the processing narrative, review all "control items" as possible CSPEC inputs/outputs.
51
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 51 The Control Model the control flow diagram is "superimposed" on the DFD and shows events that control the processes noted in the DFD control flows—events and control items—are noted by dashed arrows a vertical bar implies an input to or output from a control spec (CSPEC) — a separate specification that describes how control is handled a dashed arrow entering a vertical bar is an input to the CSPEC a dashed arrow leaving a process implies a data condition a dashed arrow entering a process implies a control input read directly by the process control flows do not physically activate/deactivate the processes—this is done via the CSPEC
52
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 52 Control Flow Diagram
53
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 53 Control Specification (CSPEC) The CSPEC can be: state diagram (sequential spec) state transition table decision tables activation tables combinatorial spec
54
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 54 Guidelines for Building a CSPEC list all sensors that are "read" by the software list all interrupt conditions list all "switches" that are actuated by the operator list all data conditions recalling the noun-verb parse that was applied to the software statement of scope, review all "control items" as possible CSPEC inputs/outputs describe the behavior of a system by identifying its states; identify how each state is reach and defines the transitions between states focus on possible omissions... a very common error in specifying control, e.g., ask: "Is there any other way I can get to this state or exit from it?"
55
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 55 Class-Based Modeling Identify analysis classes by examining the problem statement Identify analysis classes by examining the problem statement Use a “grammatical parse” to isolate potential classes Use a “grammatical parse” to isolate potential classes Identify the attributes of each class Identify the attributes of each class Identify operations that manipulate the attributes Identify operations that manipulate the attributes
56
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 56 Analysis Classes External entities (e.g., other systems, devices, people) that produce or consume information to be used by a computer-based system. External entities (e.g., other systems, devices, people) that produce or consume information to be used by a computer-based system. Things (e.g, reports, displays, letters, signals) that are part of the information domain for the problem. Things (e.g, reports, displays, letters, signals) that are part of the information domain for the problem. Occurrences or events (e.g., a property transfer or the completion of a series of robot movements) that occur within the context of system operation. Occurrences or events (e.g., a property transfer or the completion of a series of robot movements) that occur within the context of system operation. Roles (e.g., manager, engineer, salesperson) played by people who interact with the system. Roles (e.g., manager, engineer, salesperson) played by people who interact with the system. Organizational units (e.g., division, group, team) that are relevant to an application. Organizational units (e.g., division, group, team) that are relevant to an application. Places (e.g., manufacturing floor or loading dock) that establish the context of the problem and the overall function of the system. Places (e.g., manufacturing floor or loading dock) that establish the context of the problem and the overall function of the system. Structures (e.g., sensors, four-wheeled vehicles, or computers) that define a class of objects or related classes of objects. Structures (e.g., sensors, four-wheeled vehicles, or computers) that define a class of objects or related classes of objects.
57
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 57 Selecting Classes—Criteria needed services multiple attributes common attributes common operations essential requirements retained information
58
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 58 Class Diagram Class name attributes operations
59
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 59 Class Diagram
60
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 60 CRC Modeling Analysis classes have “responsibilities” Analysis classes have “responsibilities” Responsibilities are the attributes and operations encapsulated by the class Responsibilities are the attributes and operations encapsulated by the class Analysis classes collaborate with one another Analysis classes collaborate with one another Collaborators are those classes that are required to provide a class with the information needed to complete a responsibility. Collaborators are those classes that are required to provide a class with the information needed to complete a responsibility. In general, a collaboration implies either a request for information or a request for some action. In general, a collaboration implies either a request for information or a request for some action.
61
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 61 CRC Modeling
62
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 62 Class Types Entity classes, also called model or business classes, are extracted directly from the statement of the problem (e.g., FloorPlan and Sensor). Entity classes, also called model or business classes, are extracted directly from the statement of the problem (e.g., FloorPlan and Sensor). Boundary classes are used to create the interface (e.g., interactive screen or printed reports) that the user sees and interacts with as the software is used. Boundary classes are used to create the interface (e.g., interactive screen or printed reports) that the user sees and interacts with as the software is used. Controller classes manage a “unit of work” [UML03] from start to finish. That is, controller classes can be designed to manage Controller classes manage a “unit of work” [UML03] from start to finish. That is, controller classes can be designed to manage the creation or update of entity objects; the creation or update of entity objects; the instantiation of boundary objects as they obtain information from entity objects; the instantiation of boundary objects as they obtain information from entity objects; complex communication between sets of objects; complex communication between sets of objects; validation of data communicated between objects or between the user and the application. validation of data communicated between objects or between the user and the application.
63
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 63 Responsibilities System intelligence should be distributed across classes to best address the needs of the problem System intelligence should be distributed across classes to best address the needs of the problem Each responsibility should be stated as generally as possible Each responsibility should be stated as generally as possible Information and the behavior related to it should reside within the same class Information and the behavior related to it should reside within the same class Information about one thing should be localized with a single class, not distributed across multiple classes. Information about one thing should be localized with a single class, not distributed across multiple classes. Responsibilities should be shared among related classes, when appropriate. Responsibilities should be shared among related classes, when appropriate.
64
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 64 Collaborations Classes fulfill their responsibilities in one of two ways: Classes fulfill their responsibilities in one of two ways: A class can use its own operations to manipulate its own attributes, thereby fulfilling a particular responsibility, or A class can use its own operations to manipulate its own attributes, thereby fulfilling a particular responsibility, or a class can collaborate with other classes. a class can collaborate with other classes. Collaborations identify relationships between classes Collaborations identify relationships between classes Collaborations are identified by determining whether a class can fulfill each responsibility itself Collaborations are identified by determining whether a class can fulfill each responsibility itself three different generic relationships between classes [WIR90]: three different generic relationships between classes [WIR90]: the is-part-of relationship the is-part-of relationship the has-knowledge-of relationship the has-knowledge-of relationship the depends-upon relationship the depends-upon relationship
65
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 65 Composite Aggregate Class
66
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 66 Reviewing the CRC Model All participants in the review (of the CRC model) are given a subset of the CRC model index cards. All participants in the review (of the CRC model) are given a subset of the CRC model index cards. Cards that collaborate should be separated (i.e., no reviewer should have two cards that collaborate). Cards that collaborate should be separated (i.e., no reviewer should have two cards that collaborate). All use-case scenarios (and corresponding use-case diagrams) should be organized into categories. All use-case scenarios (and corresponding use-case diagrams) should be organized into categories. The review leader reads the use-case deliberately. The review leader reads the use-case deliberately. As the review leader comes to a named object, she passes a token to the person holding the corresponding class index card. As the review leader comes to a named object, she passes a token to the person holding the corresponding class index card. When the token is passed, the holder of the class card is asked to describe the responsibilities noted on the card. When the token is passed, the holder of the class card is asked to describe the responsibilities noted on the card. The group determines whether one (or more) of the responsibilities satisfies the use-case requirement. The group determines whether one (or more) of the responsibilities satisfies the use-case requirement. If the responsibilities and collaborations noted on the index cards cannot accommodate the use-case, modifications are made to the cards. If the responsibilities and collaborations noted on the index cards cannot accommodate the use-case, modifications are made to the cards. This may include the definition of new classes (and corresponding CRC index cards) or the specification of new or revised responsibilities or collaborations on existing cards. This may include the definition of new classes (and corresponding CRC index cards) or the specification of new or revised responsibilities or collaborations on existing cards.
67
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 67 Associations and Dependencies Two analysis classes are often related to one another in some fashion Two analysis classes are often related to one another in some fashion In UML these relationships are called associations In UML these relationships are called associations Associations can be refined by indicating multiplicity (the term cardinality is used in data modeling Associations can be refined by indicating multiplicity (the term cardinality is used in data modeling In many instances, a client-server relationship exists between two analysis classes. In many instances, a client-server relationship exists between two analysis classes. In such cases, a client-class depends on the server-class in some way and a dependency relationship is established In such cases, a client-class depends on the server-class in some way and a dependency relationship is established
68
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 68Multiplicity
69
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 69 Dependencies
70
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 70 Analysis Packages Various elements of the analysis model (e.g., use-cases, analysis classes) are categorized in a manner that packages them as a grouping Various elements of the analysis model (e.g., use-cases, analysis classes) are categorized in a manner that packages them as a grouping The plus sign preceding the analysis class name in each package indicates that the classes have public visibility and are therefore accessible from other packages. The plus sign preceding the analysis class name in each package indicates that the classes have public visibility and are therefore accessible from other packages. Other symbols can precede an element within a package. A minus sign indicates that an element is hidden from all other packages and a # symbol indicates that an element is accessible only to packages contained within a given package. Other symbols can precede an element within a package. A minus sign indicates that an element is hidden from all other packages and a # symbol indicates that an element is accessible only to packages contained within a given package.
71
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 71 Analysis Packages
72
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 72 Behavioral Modeling The behavioral model indicates how software will respond to external events or stimuli. To create the model, the analyst must perform the following steps: The behavioral model indicates how software will respond to external events or stimuli. To create the model, the analyst must perform the following steps: Evaluate all use-cases to fully understand the sequence of interaction within the system. Evaluate all use-cases to fully understand the sequence of interaction within the system. Identify events that drive the interaction sequence and understand how these events relate to specific objects. Identify events that drive the interaction sequence and understand how these events relate to specific objects. Create a sequence for each use-case. Create a sequence for each use-case. Build a state diagram for the system. Build a state diagram for the system. Review the behavioral model to verify accuracy and consistency. Review the behavioral model to verify accuracy and consistency.
73
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 73 State Representations In the context of behavioral modeling, two different characterizations of states must be considered: In the context of behavioral modeling, two different characterizations of states must be considered: the state of each class as the system performs its function and the state of each class as the system performs its function and the state of the system as observed from the outside as the system performs its function the state of the system as observed from the outside as the system performs its function The state of a class takes on both passive and active characteristics [CHA93]. The state of a class takes on both passive and active characteristics [CHA93]. A passive state is simply the current status of all of an object’s attributes. A passive state is simply the current status of all of an object’s attributes. The active state of an object indicates the current status of the object as it undergoes a continuing transformation or processing. The active state of an object indicates the current status of the object as it undergoes a continuing transformation or processing.
74
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 74 State Diagram for the ControlPanel Class
75
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 75 The States of a System state—a set of observable circum- stances that characterizes the behavior of a system at a given time state—a set of observable circum- stances that characterizes the behavior of a system at a given time state transition—the movement from one state to another state transition—the movement from one state to another event—an occurrence that causes the system to exhibit some predictable form of behavior event—an occurrence that causes the system to exhibit some predictable form of behavior action—process that occurs as a consequence of making a transition action—process that occurs as a consequence of making a transition
76
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 76 Behavioral Modeling make a list of the different states of a system (How does the system behave?) make a list of the different states of a system (How does the system behave?) indicate how the system makes a transition from one state to another (How does the system change state?) indicate how the system makes a transition from one state to another (How does the system change state?) indicate event indicate event indicate action indicate action draw a state diagram or a sequence diagram draw a state diagram or a sequence diagram
77
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 77 Sequence Diagram
78
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 78 Writing the Software Specification Everyone knew exactly what had to be done until someone wrote it down!
79
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 79 Specification Guidelines
80
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 80 Specification Guidelines
81
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by R.S. Pressman & Associates, Inc., copyright © 1996, 2001, 2005 81 Specification Guidelines
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.