chapter 8 analysis engineering (分析工程) software engineering: a practitioner’s approach...

28
Chapter 8 Analysis Engineering 分分分分分 () Software Engineering: A Practitioner’s Approach by Roger S. Pressman

Upload: shannon-lyons

Post on 12-Jan-2016

237 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Chapter 8Analysis Engineering

(分析工程)

Chapter 8Analysis Engineering

(分析工程)Software Engineering: A Practitioner’s Approach

by Roger S. Pressman

Software Engineering: A Practitioner’s Approach

by Roger S. Pressman

Page 2: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Analysis ModelAnalysis Model

Elements of the analysis model

Page 4: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Use-case DiagramUse-case Diagram

Use-case diagram for surveillance(监视) function

Page 5: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Alternative ActionsAlternative Actions

Can the actor take some other action at this point?

Is it possible that the actor will encounter some error condition at this point?

Is it possible that the actor will encounter behavior invoked by some event outside the actor’s control?

Can the actor take some other action at this point?

Is it possible that the actor will encounter some error condition at this point?

Is it possible that the actor will encounter behavior invoked by some event outside the actor’s control?

Page 6: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Activity diagram for Access camera surveillance—display camera views function

Page 7: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Swimlane diagram

Page 8: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Flow-Oriented Modeling(面向流的建模)

Flow-Oriented Modeling(面向流的建模)

Page 9: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

GuidelinesGuidelines

Depict (描绘) the system as single bubble in level 0.

Carefully note primary (主要的) input and output.

Refine by isolating candidate (候选的) processes and their associated data objects and data stores.

Label all elements with meaningful (有意义的) names.

Maintain information conformity (一致性) between levels.

Refine one bubble at a time.

Depict (描绘) the system as single bubble in level 0.

Carefully note primary (主要的) input and output.

Refine by isolating candidate (候选的) processes and their associated data objects and data stores.

Label all elements with meaningful (有意义的) names.

Maintain information conformity (一致性) between levels.

Refine one bubble at a time.

Page 10: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Data Flow DiagramData Flow Diagram

Context-level DFD for SafeHome security function

Page 11: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Grammatical ParseGrammatical Parse

The SafeHome security function enables the homeowner to configure the security system when it is installed, monitors all sensors connected to the security system, and interacts with the homeowner through the Internet, a PC, or a control panel.

During installation, the SafeHome PC is used to program and configure the system. Each sensor is assigned a number and type, a master password is programmed for arming and disarming the system, and telephone number(s) are input for dialing when a sensor event occurs.

When a sensor event is recognized, the software invokes an audible alarm attached to the system. After a delay time that is specified by the homeowner during system configuration activities, the software dials a telephone number of a monitoring service, provides information about the location, reporting the nature of the event that has been detected. The telephone number will be redialed every 20 seconds until a telephone connection is obtained.

The homeowner receives security information via a control panel, the PC, or a browser, collectively called an interface. The interface displays prompting messages and system status information on the control panel, the PC, or the browser window. Homeowner interaction takes the following form…

The SafeHome security function enables the homeowner to configure the security system when it is installed, monitors all sensors connected to the security system, and interacts with the homeowner through the Internet, a PC, or a control panel.

During installation, the SafeHome PC is used to program and configure the system. Each sensor is assigned a number and type, a master password is programmed for arming and disarming the system, and telephone number(s) are input for dialing when a sensor event occurs.

When a sensor event is recognized, the software invokes an audible alarm attached to the system. After a delay time that is specified by the homeowner during system configuration activities, the software dials a telephone number of a monitoring service, provides information about the location, reporting the nature of the event that has been detected. The telephone number will be redialed every 20 seconds until a telephone connection is obtained.

The homeowner receives security information via a control panel, the PC, or a browser, collectively called an interface. The interface displays prompting messages and system status information on the control panel, the PC, or the browser window. Homeowner interaction takes the following form…

Page 12: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach
Page 13: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Level 2 DFD that refines the monitor sensors process

Page 14: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Control Flow DiagramControl Flow Diagram

State diagram for SafeHome security function

Page 15: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Class-Based Modeling(基于类的建模)

Class-Based Modeling(基于类的建模)

Page 16: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Identifying Analysis ClassesIdentifying Analysis ClassesExternal entities that produce or consume

informationThings that are part of the information domainOccurrences or eventsRoles played by people who interact with the

systemOrganizational unitsPlaces that establish contextStructures that define a class of objects

External entities that produce or consume information

Things that are part of the information domainOccurrences or eventsRoles played by people who interact with the

systemOrganizational unitsPlaces that establish contextStructures that define a class of objects

Page 17: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Class Selection CriteriaClass Selection Criteria

1. Retained (保留) information

2. Needed services (必须的服务)3. Multiple attributes (多个属性)4. Common attributes (公共属性)5. Common operations (公共操作)6. Essential requirements (必须的需

求)

1. Retained (保留) information

2. Needed services (必须的服务)3. Multiple attributes (多个属性)4. Common attributes (公共属性)5. Common operations (公共操作)6. Essential requirements (必须的需

求)

Page 18: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Identifying ClassesIdentifying ClassesPotential class Classification Accept / Reject

homeowner role; external entity reject: 1, 2 fail

sensor external entity accept

control panel external entity accept

installation occurrence reject

(security) system thing accept

number, type not objects, attributes reject: 3 fails

master password thing reject: 3 fails

telephone number thing reject: 3 fails

sensor event occurrence accept

audible alarm external entity accept: 1 fails

monitoring service organizational unit; ee reject: 1, 2 fail

Page 19: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Class DiagramClass Diagram

Class diagram for the system class

Page 20: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Class DiagramClass Diagram

Class diagram for FloorPlan

Page 21: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

CRC ModelingCRC Modeling

A CRC model index card for FloorPlan class

Page 22: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Class ResponsibilitiesClass Responsibilities

Distribute system intelligence across classes. (分散)State each responsibility as generally as possible. (普遍

性)Put information and the behavior related to it in the same

class. (封装)Localize information about one thing rather than distributing it

across multiple classes. (内敛)Share responsibilities among related classes, when

appropriate. (关联)

Distribute system intelligence across classes. (分散)State each responsibility as generally as possible. (普遍

性)Put information and the behavior related to it in the same

class. (封装)Localize information about one thing rather than distributing it

across multiple classes. (内敛)Share responsibilities among related classes, when

appropriate. (关联)

Page 23: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Class CollaborationsClass Collaborations

Relationships between classes:is-part-of (部分关系) — used when classes are

part of an aggregate class.

has-knowledge-of (知识关系)— used when one class must acquire information from another class.

depends-on (依赖关系) — used in all other cases.

Relationships between classes:is-part-of (部分关系) — used when classes are

part of an aggregate class.

has-knowledge-of (知识关系)— used when one class must acquire information from another class.

depends-on (依赖关系) — used in all other cases.

Page 24: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Class DiagramsClass Diagrams

Top: MultiplicityBottom: Dependencies

Page 25: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Behavioral Modeling(行为模型)

Behavioral Modeling(行为模型)

Page 26: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Identifying EventsIdentifying Events

A use-case is examined for points of information exchange.

The homeowner uses the keypad to key in a four-digit password. The password is compared with the valid password stored in the system. If the password in incorrect, the control panel will beep once and reset itself for additional input. If the password is correct, the control panel awaits further action.

A use-case is examined for points of information exchange.

The homeowner uses the keypad to key in a four-digit password. The password is compared with the valid password stored in the system. If the password in incorrect, the control panel will beep once and reset itself for additional input. If the password is correct, the control panel awaits further action.

Page 27: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

State DiagramState Diagram

State diagram for the ControlPanel class

Page 28: Chapter 8 Analysis Engineering (分析工程) Software Engineering: A Practitioner’s Approach by Roger S. Pressman Software Engineering: A Practitioner’s Approach

Sequence DiagramSequence Diagram

Sequence diagram (partial) for the SafeHome security function