第三章 需求分析 (requirements analysis)

22
第第第 第第第第 (Requirements Analys is) 第第第第第第Our real-time example is based on the embedde d software in the Ariane-5, a space rocket belonging to the European Space Agency (ESA). On June 4, 1996, on its maiden flight, the Ariane-5 was launched and performed perfectly for approximately 40 seconds. T hen, it began to veer off course. At the direction of an Ariane ground controller, the rocket was destr oyed by remote control. The destruction of the uni nsured rocket was a loss not only of the rocket itse lf, but also of the four satellites it contained; th e total cost of the disaster was $500 million (Newsb ytes home page 1996; Lions et al. 1996).

Upload: karina-holden

Post on 15-Mar-2016

111 views

Category:

Documents


18 download

DESCRIPTION

第三章 需求分析 (Requirements Analysis). 真的很重要吗? 例: - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 第三章 需求分析 (Requirements Analysis)

第三章 需求分析(Requirements Analysis)

真的很重要吗?例: Our real-time example is based on the embedded software in the Ariane-5, a space rocket belonging to the European Space Agency (ESA). On June 4, 1996, on its maiden flight, the Ariane-5 was launched and performed perfectly for approximately 40 seconds. Then, it began to veer off course. At the direction of an Ariane ground controller, the rocket was destroyed by remote control. The destruction of the uninsured rocket was a loss not only of the rocket itself, but also of the four satellites it contained; the total cost of the disaster was $500 million (Newsbytes home page 1996; Lions et al. 1996).

Page 2: 第三章 需求分析 (Requirements Analysis)

第三章 需求分析 The reason: there was no discussion in the requirements documents of the ways in which the Ariane-5 trajectory would be different from Ariane-4.

统计资料: In 1994, the Standish Group surveyed over 350 companies about their over 8000 software projects to find out how well they were faring. The results are sobering. Thirty-one percent of the software projects were canceled before they were completed. Moreover, in large companies, only 9% of the projects were delivered on time and cost what they were budgeted, and 16% met those criteria in small companies (Standish 1994).

Page 3: 第三章 需求分析 (Requirements Analysis)

To understand why, Standish (1995) asked the surveyrespondents to explain the causes of the failed projects.The top factors were reported to be1. incomplete requirements (13.1%)2. lack of user involvement (12.4%)3. lack of resources (10.6%)4. unrealistic expectations (9.9%)5. lack of executive support (9.3%)6. changing requirements and specifications (8.7%)7. lack of planning (8.1%)8. system no longer needed (7.5%)

第三章 需求分析

Page 4: 第三章 需求分析 (Requirements Analysis)

§1. 需求分析的任务仍然回答“ What” ,而不是“ How” ,但更细致、精确(合同的拟定)

可行性分析DFD

DD

功能具体化需求规格说明加细DFD

DD

算法描述IPO

Final stage of Definition phase

Page 5: 第三章 需求分析 (Requirements Analysis)

§1. 需求分析的任务1 、确定要求⑴ 功能要求 (functional requirements): 系统必须做什么?⑵ 性能要求 (performance requirements) :做得怎样? 例: response time , memory , back-up memory , security , ……

⑶ 运行要求 (operational requirements) :运行环境、软硬件配置等。

⑷ 未来可能的扩充要求 (possible evolution) :如 HDIS 各组的合并, 3 维虚拟现实的效果等等。

Page 6: 第三章 需求分析 (Requirements Analysis)

§1. 需求分析的任务2 、分析数据⑴建立概念模型 (conceptual models): E-R Diagram⑵形象描绘数据结构 : Data Hierarchy, Warnier Dia

gram, IPO⑶数据结构规范化 (Normalization)

3 、导出逻辑模型: DFD + DD + IPO

4 、修正计划:重估成本、进度等

Page 7: 第三章 需求分析 (Requirements Analysis)

§1. 需求分析的任务5 、开发原型系统 (Prototyping)

“样机试用”

Page 8: 第三章 需求分析 (Requirements Analysis)

§2. 分析过程1 、沿 DFD 回溯: DFD 的输出端是系统的最终目的。向回确定每个数据元素的来源,可加细 DFD 及 DD ,并将相关算法记录在 IPO 图中。2 、用户复查3 、细化 DFD : 加细前后的 I\O 须相同。 分解到须考虑具体实现的代码时即可仃止

Page 9: 第三章 需求分析 (Requirements Analysis)

§2. 分析过程

4 、修正计划5 、文档:《需求规格说明书》

不需分解

有补充修正

无补充修正分析追踪数据流图 用户复查 细 化数据流图

需要分解

Page 10: 第三章 需求分析 (Requirements Analysis)

需求规格说明书封面: 文档编号: 版 本 号: 文档名称: 项目名称: 项目负责人: 年 月 日

编写:核对:审核:批准:

开发单位:

Page 11: 第三章 需求分析 (Requirements Analysis)

需求规格说明书内容:⑴系统规格说明: 系统概貌 功能要求 性能要求 运行要求 可能增加的要求 DFD IPO⑵ 数据要求: DD Hierarchy 或 Warnier Diagram

⑶ 用户系统描述 —— 初步用户手册:从用户的观点考虑系统 系统功能、性能 使用与步骤 等⑷修正的开发计划: 成本估计 资源使用计划 进度计划

Page 12: 第三章 需求分析 (Requirements Analysis)

§2. 分析过程轻松一分钟 —— True Tech Support Stories

A woman complied with a tech's request to send in a copy of a defective diskette. A few days later, the tech received a letter from her along with a xerox copy of the floppy.

A tech advised a customer to put his troubled floppy back in the drive and close the door. The customer put his phone down and was heard walking across the room and shutting the door to the room.

6 、审查和复审

Page 13: 第三章 需求分析 (Requirements Analysis)

§3. 概念模型和规范化 —— 对数据的分析1 、概念模型:描述从用户角度看到的数据 实体 - 联系图 (Entity - Relationship Diagram)

⑴ Entities 例: , ,

Student Instructor Class

⑶ Attributes 例: ,Name I D#

⑵ Relations 例: Enrolled in Teach

1 1 1 N M N

Page 14: 第三章 需求分析 (Requirements Analysis)

§3. 概念模型和规范化

…………

Instructor Student

Enrolled inTeach

Class

I D # I D #

Name Name

Sex Sex

Title

Instructor ID

Class ID

Grade

Student ID

Class ID

CreditI D #Subject

例:

Page 15: 第三章 需求分析 (Requirements Analysis)

§3. 概念模型和规范化2 、范式 (Normal Forms) :消除数据冗余的程度 IBM E. F. Godd (1970)

例: Student Instructor Class Enrolled in Teach

ID*

NameSexAgeMajor …

ID*

NameSexAgeTitle …

ID*

SubjectCredit

Student ID*

Class IDGrade…

Instructor ID*

Class ID*

*Keyword: 可唯一地标识一个元组的属性1 - NF :所有属性都是原子值,即不出现“表中有表”2 - NF :在 1-NF 基础上,每个 non-key-word 都由整个 key

word 决定(而非依赖于 key word 的一部分)。例:“ Major” 实际上由“ ID” 的第 6 、 7 位决定,可省去。3 - NF :在 2-NF 基础上, non-key-word之间无从属关系。

Page 16: 第三章 需求分析 (Requirements Analysis)

§4. 图形工具1 、层次方框图 (Hierarchy) —— 描绘数据的结构例: A Room hierarchy based on an interior designer’s pe

rspective.

Room

Room with lights

Room with windows Garage

Basement Kitchen Bathroom Room withFurniture

LivingRoom

FamilyRoom

BedRoom

DiningRoom

例: P.46 图 3.3

Page 17: 第三章 需求分析 (Requirements Analysis)

§4. 图形工具2 、 Warnier Diagram :

{ :层次 ( n1 ,n2): 重复 n1 到 n2次 :二者择一例: 头条新闻 地区队 头版 国内新闻 体育新闻 职业队 本地新闻 拳击 社论 (1,1) 经营简讯 专栏 (1,3) 报纸 社论 读者来信 (1,3) 副刊 商业新闻 雇员简讯 讽刺漫画 (0,1) 一般新闻 体育新闻联播 招生 副刊 商业新闻 广告 招聘 广告 求助

细化

例: P.46 图 3.4

Page 18: 第三章 需求分析 (Requirements Analysis)

§4. 图形工具3 、 IPO 图 (Input / Process / Output) :简要的算法描述

1. 校验主记录2. 校验事务记录3. 更新主记录

旧的主文件

事务文件

有效的主记录有效的事务记录更新后的主文件

输出 O处理 P输入 I

Page 19: 第三章 需求分析 (Requirements Analysis)

§5.验证要求 (Requirements Validation)

正确性:Are the requirements correct? 一致性:Are the requirements consistent? 完整性:Are the requirements complete? 现实性:Are the requirements realistic? Do the requirements described something that is reallyneeded by the customer?

方法: 人工审查 初步用户手册 Prototyping 使用软件工具 —— 完整性、一致性

Page 20: 第三章 需求分析 (Requirements Analysis)

§5.验证要求例 1 : Software Requirements Engineering Methodology (SREM) (TRW Corporation, 1977)SREM = Requirements Statement Language (RSL) + Requirements Engineering Validation System (REVS)

REVSRSLRequirements

RSLStatements

Abstract System Semantic Model

(ASSM)

Analyzer Reports

例 2:Problem Statement Language (PSL) / Problem StatementAnalyzer (PSA) (Michigan University, 1977)

PSAPSLRequirements Database

Reports

Page 21: 第三章 需求分析 (Requirements Analysis)

§5.验证要求例 3:Heimdahl and Leveson (1996) have developed an approach forchecking the completeness and consistency in hierarchical, state-basedrequirements. Their framework uses the Requirements SpecificationModeling Language (RSML), developed at the University ofCalifornia at Irvine.

In RSML, the system being built is considered as a finite-statemachine, and the language models the states, transitions, andsequencing of events. The graphical RSML specification defines amathematical next-state function. Ideally, the function should bedefined over all possible system states; this property is called d-completeness. Also, the function should have no conflictingrequirements, meaning that the system is consistent.

RSML was used to analyze TCAS II, a collision avoidance systemused in U.S. airspace. By describing TCAS with the next-stateapproach, Heimdahl and Leveson revealed an unplannednondeterminism that had serious safety implications and was notapparent when the specification was originally written.

Page 22: 第三章 需求分析 (Requirements Analysis)

Project Part Ⅱ《需求规格说明书》

上交书面报告 ,两星期内完成。 截止日期: 10 月 23 日。 每迟交一日,多扣 1 分