Software Engineering: A Practitioner¶s Approach, 6/e

Chapter 8 Analysis Modeling
copyright © 1996, 2001, 2005

R.S. Pressman & Associates, Inc. For University Use Only May be reproduced ONLY for student use at the university level when used in conjunction with Software Engineering: A Practitioner's Approach. Any other reproduction or use is expressly prohibited.

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

1

Requirements Analysis 

Requirements analysis 
 

specifies software¶s operational characteristics indicates software's interface with other system elements establishes constraints that software must meet 

Requirements analysis allows the software engineer (called an analyst or modeler in this role) to:  

elaborate on basic requirements established during earlier requirement engineering tasks build models that depict user scenarios, functional activities, problem classes and their relationships, system and class behavior, and the flow of data as it is transformed.
2

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

A Bridge
de te ri ti

l i del

de ig del

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

3

Rules of Thumb   

  

The model should focus on requirements that are visible within the problem or business domain. The level of abstraction should be relatively high. Each element of the analysis model should add to an overall understanding of software requirements and provide insight into the information domain, function and behavior of the system. Delay consideration of infrastructure and other non-functional nonmodels until design. Minimize coupling throughout the system. Be certain that the analysis model provides value to all stakeholders. Keep the model as simple as it can be.

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

4

Domain Analysis
Software domain analysis is the identification, analysis, and specification of common requirements from a specific application domain, typically for reuse on multiple projects within that application domain . . . [Object[Object-oriented domain analysis is] the identification, analysis, and specification of common, reusable capabilities within a specific application domain, in terms of common objects, classes, subassemblies, and frameworks . . .
Donald Firesmith

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

5

Domain Analysis 
 



Define the domain to be investigated. Collect a representative sample of applications in the domain. Analyze each application in the sample. Develop an analysis model for the objects.

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

6

Data Modeling  

 

examines data objects independently of processing focuses attention on the data domain creates a model at the customer¶s level of abstraction indicates how data objects relate to one another

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

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) each instance 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

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

Typical Objects
external entities (printer, user, sensor) things (e.g, reports, displays, signals) occurrences or events (e.g., interrupt, alarm) roles (e.g., manager, engineer, salesperson) organizational units (e.g., division, team) places (e.g., manufacturing floor) structures (e.g., employee record)

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

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 model body type price options code

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

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 objects can be related in many different ways

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

ERD Notation
One common form: object1
(0, m)
relationship

(1, 1)

object 2
attribute

Another common form: object1
(0, m) relationship (1, 1)

object 2

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

Building an ERD  



Level 1²model all data objects (entities) and their 1² ³connections´ to one another Level 2²model all entities and relationships 2² Level 3²model all entities, relationships, and the 3² attributes that provide further depth

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

The ERD: An Example
Customer (1,1)
places

(1,m)

request for service (1,1) (1,n) work order (1,1)

standard task table (1,1)
selected from

generates

work (1,w) tasks materials

(1,w) (1,i)

(1,1)
consists of

lists

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

ObjectObject-Oriented Concepts  

Must be understood to apply class-based classelements of the analysis model Key concepts: 
  

Classes and objects Attributes and operations Encapsulation and instantiation Inheritance

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

Classes
‡

objectobject-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) superclass) establishes a hierarchy of classes once a class of items is defined, a specific instance of the class can be identified

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

Building a Class
class name attributes: operations

attributes: operations:

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

What is a Class?
occurrences things external entities roles organizational units places structures

class name attributes:

operations:

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

Encapsulation/Hiding
The object encapsulates both data and the logical procedures required to method manipulate the data
#1
data

method #2 method #3

method #6 method #4

method #5

Achieves ³information hiding´
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

Class Hierarchy
PieceOfFurniture (superclass)

Table

Chair

Desk

´Chable"

subclasses of the

instances of Chair
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

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.

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

ScenarioScenario-Based Modeling
³[Use³[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 (use(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?

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

UseUse-Cases   

a scenario that describes a ³thread of usage´ for a system actors represent roles people or devices play as the system functions users can play a number of different roles for a given scenario

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

Developing a Use-Case Use   



What are the main tasks or functions that are performed by the actor? 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? What information does the actor desire from the system? Does the actor wish to be informed about unexpected changes?

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

UseUse-Case Diagram
Saf H

homeowner

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

  ¢¡  

ccess c mer s r eill nce i t he Int ernet

c mer s

onf i re f eHome s st em r met ers

et l rm

25

Activity Diagram
Supplements the use-case by providing a diagrammatic userepresentation of procedural flow
e n t e r p a ssw o r d a n d u se r I

valid passwor ds/ I

invalid passwor ds/ I

se le c t m a o r f u n c t io n ot her f unct ions m ay also be select ed

p r o mp t f o r r e e n t r y

input t r ies r em ain se le c t su r v e illa n c e no input t r ies r em ain

t hum bnail views

select a specif ic cam er a

se le c t sp e c if ic c a m e r a - t h u m b n a ils se le c t c a m e r a ic o n

v ie w c a m e r a o u t p u t in la b e lle d w in d o w

prompt f or a n o t h e r v ie w

e it t his f unct ion

see anot her cam er a

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

Swimlane Diagrams
Allows the modeler to represent the flow of activities described by the use-case and at the usesame time indicate which actor (if there are multiple actors involved in a specific use-case) useor analysis class has responsibility for the action described by an activity rectangle
hom e ow ner c a m e ra i n t e rf a c e

e n t e r p a s s w o rd a n d u s e r ID

valid p asswo r d s/ ID in valid p asswo r d s/ ID s e le c t m a jo r f u n c t io n o t h er f u n ct io n s m ay also b e select ed

p r o m p t f o r re e n t ry

in p u t t r ies s e le c t s u r v e illa n c e n o in p u t t r ies r em ain r em ain

t h u m b n ail views

select a sp ecif ic cam er a

s e le c t s p e c if ic c a m e r a - t h u m b n a ils

s e le c t c a m e r a ic o n

g e n e r a t e v id e o out put prom pt f or a n o t h e r v ie w

v ie w c a m e r a o u t p u t in la b e lle d w in d o w

exit t h is f u n ct io n see an o t h er cam er a

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

FlowFlow-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, flowfloworiented modeling continues to provide a view of the system that is unique²it should be used to supplement unique² other analysis model elements

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

The Flow Model
Every computer-based system is an computerinformation transform ....

input

computer based system

output

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

Flow Modeling Notation
external entity

process data flow data store

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

External Entity
A producer or consumer of data Examples: a person, a device, a sensor Another example: computer-based computersystem Data must always originate somewhere and must always be sent to something

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

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

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
Data flows through a system, beginning as input and be transformed into output.
base compute triangle area area

height

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

33

Data Stores
Data is often stored for later use.
sensor # sensor #, type, location, age

report required

looklook-up sensor data
sensor number

type, location, age sensor data

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

34

Data Flow Diagramming: Guidelines    

 

all icons must be labeled with meaningful names the DFD evolves through a number of levels of detail always begin with a context level diagram (also called level 0) always show external entities at level 0 always label data flow arrows do not represent procedural logic
35

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

Constructing a DFD²I DFD²  



review the data model to isolate data objects and use a grammatical parse to determine ³operations´ determine external entities (producers and consumers of data) create a level 0 DFD

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

36

Level 0 DFD Example
user
processing request requested video signal

digital video processor video source
NTSC video signal

monitor

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

37

Constructing a DFD²II DFD² 
  



write a narrative describing the transform parse to determine next level transforms ³balance´ the flow to maintain data flow continuity develop a level 1 DFD use a 1:5 (approx.) expansion ratio

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

38

The Data Flow Hierarchy
x a P b y level 0

a

c
p1

p2

f
p4

d level 1

p3

e

g

5

b

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

39

Flow Modeling Notes    

each bubble is refined until it does just one thing the expansion ratio decreases as the number of levels increase 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)

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

40

Process Specification (PSPEC)
bubble

PSPEC narrative pseudocode (PDL) equations tables diagrams and/or charts

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

41

DFDs: A Look Ahead

analysis model

Maps into
design model

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

42

Control Flow Diagrams  

Represents ³events´ and the processes that manage ³events´ events An ³event´ is a Boolean condition that can be ascertained by: 
   

listing all sensors that are "read" by the software. listing all interrupt conditions. listing all "switches" that are actuated by an operator. 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.

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

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 flows² items² 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² processes²this is done via the CSPEC
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

Control Flow Diagram
copies done beeper on/off
read perat r i put
¦ § ¦

full problem light

start

anage c pying

rel ad process perform problem diagnosis

jammed
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

¦

empty

display panel enabled

¦ ¨

create user displays

45

Control Specification (CSPEC)
The CSPEC can be: state diagram (sequential spec) state transition table decision tables activation tables combinatorial spec

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

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 nounsoftware 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?"
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

ClassClass-Based Modeling   



Identify analysis classes by examining the problem statement Use a ³grammatical parse´ to isolate potential classes Identify the attributes of each class Identify operations that manipulate the attributes

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

Analysis Classes 
     

External entities (e.g., other systems, devices, people) that produce or consume information to be used by a computer-based system. computerThings (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. 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. 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 fourof objects or related classes of objects.

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

Selecting Classes²Criteria Classes²
retained information needed services multiple attributes common attributes common operations essential requirements

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

Class Diagram
Class name
Syste
syste ID veri icationPhoneNu ber syste Status delayTi e telephoneNu ber asterPassword te poraryPassword nu berTries

attributes

progra () display() reset() query() odi y() call()

operations

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

Class Diagram
FloorPlan
type name outsideDimensions determineType ( ) positionFloorplan scale( ) change color( )

is placed wit hin is part of

Cam era
ty p e ID lo c a t io n f ie ld V ie w p a n A n g le Z o o m Se t t in g d e t e r m in e T y p e ( ) t r a n s la t e L o c a t io n ( ) d is p la y ID ( ) d is p la y V ie w ( ) d is p la y Z o o m ( ) ty pe

Wall

w a llD im e n s io n s

determineType ( ) computeDimensions ( )

is used t o build

is used t o build is used t o build

WallSegm ent
t y pe s t a r t Co o r d in a t e s s t o p Co o r d in a t e s n e x t W a llSe m e n t t y pe

Window
ty p e s t a r t Co o r d in a t e s s t o p Co o r d in a t e s n e x t W in d o w

Door
s t a r t Co o r d in a t e s s t o p Co o r d in a t e s nex t D oor

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

determineType ( ) draw( )

determineType ( ) draw( )

determineType ( ) draw( )

52

CRC Modeling 

Analysis classes have ³responsibilities´ 

Responsibilities are the attributes and operations encapsulated by the class 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. 

Analysis classes collaborate with one another  

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

CRC Modeling
Cl Cl Description: Cl Description: FloorPlan Cl Description: Re on i ili Description: Re on i ili Re on i ili Re on i ili
defines floor plan name/type manages floor plan positioning scales floor plan for display scales floor plan for display incorporates walls, doors and windows shows position of video cameras Wall Camera

Coll o o Coll o o Coll o o Coll o

o

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

Class Types 

Entity classes, also called model or business classes, are classes, 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. 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 instantiation of boundary objects as they obtain information from entity objects; complex communication between sets of objects; validation of data communicated between objects or between the user and the application.

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

Responsibilities 
   

System intelligence should be distributed across classes to best address the needs of the problem Each responsibility should be stated as generally as possible 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. Responsibilities should be shared among related classes, when appropriate.
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

Collaborations 

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 collaborate with other classes. 

 

Collaborations identify relationships between classes Collaborations are identified by determining whether a class can fulfill each responsibility itself three different generic relationships between classes [WIR90]: 
 

the is-part-of relationship is-partthe has-knowledge-of relationship has-knowledgethe depends-upon relationship depends-

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

Composite Aggregate Class
Player

PlayerHead

Player ody

Player rms

Player egs

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

Reviewing the CRC Model 

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). 



All use-case scenarios (and corresponding use-case diagrams) should be organized useuseinto categories. categories. The review leader reads the use-case deliberately. usedeliberately. 

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. card. 

The group determines whether one (or more) of the responsibilities satisfies the use-case userequirement. 

If the responsibilities and collaborations noted on the index cards cannot accommodate the use-case, modifications are made to the cards. usecards. 

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.

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

Associations and Dependencies 

Two analysis classes are often related to one another in some fashion 


In UML these relationships are called associations Associations can be refined by indicating multiplicity (the term cardinality is used in data modeling 

In many instances, a client-server relationship exists clientbetween two analysis classes. 

In such cases, a client-class depends on the server-class in clientserversome way and a dependency relationship is established

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

Multiplicity
Wall

1 is used to build 1..*
WallSegm ent Window

1

1 is used to build

0..* is used to build
Door

0..*

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

Dependencies

DisplayWindow <<access>>
{password}

Camera

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

Analysis Packages   

Various elements of the analysis model (e.g., use-cases, useanalysis 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. 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.
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

Analysis Packages
package name

Environment +Tree + andscape + oad +Wall + ridge + uilding + isualEffect +Scene

Rules f TheGame +Rules f ovement +Constraints nAction

Charact ers +Player +Protagonist + ntagonist +SupportingRole

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

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:   

 

Evaluate all use-cases to fully understand the sequence of interaction within usethe system. Identify events that drive the interaction sequence and understand how these events relate to specific objects. Create a sequence for each use-case. useBuild a state diagram for the system. Review the behavioral model to verify accuracy and consistency.

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

State Representations 

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 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]. 


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.

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

State Diagram for the ControlPanel Class
t imer < lockedTime

t imer > lockedTime

locked

password = incorrect & numberOfTries < maxTries comparing password ent ered numberOfTries > maxTries

reading key hit

do: validat ePassw ord

password = correct

select ing

act iv at ion successful

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

The States of a System    

state² state²a set of observable circumcircumstances that characterizes the behavior of a system at a given time state transition²the movement from one transition² state to another event² event²an occurrence that causes the system to exhibit some predictable form of behavior action² action²process that occurs as a consequence of making a transition
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

Behavioral Modeling  

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 event indicate action 

draw a state diagram or a sequence diagram
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

Sequence Diagram
ho meow ner on t rol nel syst em syst em ready

A
passwo rd en t ered

read ing

req uest loo ku p comp aring resu lt req uest act i at io n lo cked

n u m b e r O f T r ie s

> m a x T r ie s

A

t imer > lockedTime

select in g act i at ion successful

act i at ion successful

Figure 8 .2 7 Sequence diagram (part ial f or

Saf eHome securit y f unct ion

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 

pas s w ord = c orrec t 

  

© 

senso rs en sors

70

Writing the Software Specification
Everyone knew exactly what had to be done until someone wrote it down!

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

Specification Guidelines
use a layered for at that provides increasing detail as the "layers" deepen use consistent graphical notation and apply textual ter s consistently (stay a ay fro aliases) be sure to define all acrony s be sure to include a table of contents; ideally, include an index and/or a glossary write in a si ple, una biguous style (see "editing suggestions" on the following pages) always put yourself in the reader's position, "Would I be able to understand this if I wasn't inti ately fa iliar with the syste ?"
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

Specification Guidelines
Be on the lookout for persuasive connectors, ask hy? keys: certainly, therefore, clearly, obviously, it follo s that ... Watch out for vague terms keys: some, sometimes, often, usually,ordinarily, most, mostly ... When lists are given, but not completed, be sure all items are understood keys: etc., and so forth, and so on, such as Be sure stated ranges don't contain unstated assumptions e.g., Valid codes range from 10 to 100. Integer? Real? Hex? Be are of vague verbs such as handled, rejected, processed, ... By hat?

Be are "passive voice" statements e.g., The parameters are initialized.

Be are "dangling" pronouns e.g., The I/ module communicated ith the data validation module and its contol flag is set. Whose control flag?

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

Specification Guidelines
When term i expli itl efined in ne pl e, try tit ting the definiti n f rother occurrences of the term When structure is descri ed in words, draw a picture When a structure is descri ed with a picture, try to redraw the picture to emphasi e different elements of the structure When symbolic equations are used, try expressing their meaning in words When a calculation is specified, work at least two examples Look for statements that imply certainty, then ask for proof keys; always, every, all, none, never Search behind certainty statements²be sure restrictions or limitations are realistic
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

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer: Get 4 months of Scribd and The New York Times for just $1.87 per week!

Master Your Semester with a Special Offer from Scribd & The New York Times