收藏 分享(赏)

软件工程-实践者的研究方法 (6).ppt

上传人:dreamzhangning 文档编号:3360245 上传时间:2018-10-18 格式:PPT 页数:40 大小:1.09MB
下载 相关 举报
软件工程-实践者的研究方法 (6).ppt_第1页
第1页 / 共40页
软件工程-实践者的研究方法 (6).ppt_第2页
第2页 / 共40页
软件工程-实践者的研究方法 (6).ppt_第3页
第3页 / 共40页
软件工程-实践者的研究方法 (6).ppt_第4页
第4页 / 共40页
软件工程-实践者的研究方法 (6).ppt_第5页
第5页 / 共40页
点击查看更多>>
资源描述

1、1,Chapter 7,Requirements Modeling: Flow and Behavior,Software Engineering: A Practitioners Approach, 7/e by Roger S. Pressman,2,Requirements Modeling Strategies,One view of requirements modeling, called structured analysis, considers data and the processes that transform the data as separate entitie

2、s. Data objects are modeled in a way that defines their attributes and relationships. Processes that manipulate data objects are modeled in a manner that shows how they transform data as data objects flow through the system. A second approach to analysis modeled, called object-oriented analysis, foc

3、uses on the definition of classes they collaborate with one another to effect customer requirements.,3,Flow-Oriented Modeling,Represents how data objects are transformed at they move through the system data flow diagram (DFD) is the diagrammatic form that is used Considered by many to be an “old sch

4、ool” approach, but continues to provide a view of the system that is uniqueit should be used to supplement other analysis model elements,4,Flow Modeling Notation,external entity,process,data flow,data store,5,External Entity,A producer or consumer of data,Examples: a person, a device, a sensor,Data

5、must always originate somewhere and must always be sent to something,6,Process,A data transformer (changes input to output),Examples: compute taxes, format report, display graph,Data must always be processed in some way to achieve system function,7,Data Flow,Data flows through a system, beginning as

6、 input and transformed into output.,compute triangle area,base,height,area,8,Data Stores,Data is stored for later use.,look-up sensor data,sensor #,report required,sensor #, type, location, age,sensor data,sensor number,type, location, age,9,Data Flow Diagramming: Guidelines,all icons must be labele

7、d with meaningful names the DFD evolves through a number of levels always begin with the level 0 do not represent procedural logic,10,Constructing a DFDI,review user scenarios and/or the data model to isolate data objects and use a grammatical parse to determine “operations” determine external entit

8、ies (producers and consumers of data) create a level 0 DFD,11,Level 0 DFD Example,Constructing a DFDI,12,Constructing a DFDII,to determine next level transforms Each sub-DFD provides a more detailed description “balance” the flow to maintain data flow continuity each Process is refined until it does

9、 just one thing 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,13,The Data Flow Hierarchy,P,a,b,x,y,p1,p2,p3,p4,5,a,b,c,d,e,f,g,level 0,level 1,教材管理系统的顶层DFD,Constructing DFDExample,教材管理系统可分为:销售子系统和采购子系统 销售子系统:

10、由教师或学生提交购书单,经教材科发行人员审核是有效购书单后,开发票、登记并返给学生领书单,学生凭领书单领书。 采购子系统:若是脱销教材,则登记缺书信息,并发缺书单给书库采购人员;一旦新书入库后,即发进书通知告知系统。,15,Constructing DFDExample,16,Constructing DFDExample,进书通知,17,Constructing DFDExample,18,Maps into,DFDs: A Look Ahead,analysis model,design model,19,Process Specification (PSPEC),20,Process S

11、pecification (PSPEC),21,Control Specification (CSPEC),Represents “events” and the processes that manage events. An “event” is a Boolean condition. The CSPEC can be:,22,Control Specification- Structured Language,一种介于自然语言和形式化语言之间的语言。 结构化语言的词汇表由英语命令动词数据词典中定义的名字 语言的正文用基本控制结构进行分割,加工中的操作用自然语言短语来表示。 基本控制结构

12、有三种: 简单陈述句结构; 重复结构:while_do 或 repeat_until 结构; 判定结构:if_then_else 或 case_of 结构。,23,Structured Language - Example,“检查发货单”的过程描述 if 发货单金额超过$500 thenif 欠款超过60天 then在偿还欠款前不予批准else (欠款未超期)发批准书,发货单 else (发货单金额未超过$500)if 欠款超过60天 then发批准书,发货单及赊欠报告else (欠款未超期)发批准书,发货单,24,判定表的构造方法: 1)列出与一个具体过程有关的全部操作。 2)列出该过程执行

13、期间的所有条件或作出的判定 3)找出每个可能的组合,将各组特定的条件与特定操作相结合,并消去那些不可能发生的条件组合。 4)指出在什么样的一组条件下将采取什么样的操作。,如果算法中包含多重嵌套的条件选择时,用判定表能清晰地表达条件组合与动作之间的对应关系.,Control Specification- Decision Table,25,Control Specification- Decision Tree,判定树与判定表的逻辑处理相似,但比判定表的语义表达上更直观。 判定树中,每个枝节点(子树的根)对应于一个判定条件,而叶节点则对应于系统的一个可能的动作。 判定树中,从根到叶的每条路径上所

14、有枝节点对应于一种条件组合取值下的特定动作。,26,Decision Table/Tree - Examples,27,Behavioral Modeling & State Representation,The behavioral model indicates how software will respond to external events or stimuli. In the behavioral modeling, two different characterizations of states must be considered: the state of each c

15、lass 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. A passive state is the current status of all of an objects attributes. The active state of an objec

16、t indicates the current status of the object as it undergoes a continuing transformation.,28,The States of a System,statea set of observable circumstances that characterizes the behavior of a system at a given time state transitionthe movement from one state to another eventan occurrence that causes

17、 the system to exhibit some predictable form of behavior actionprocess that occurs as a consequence of making a transition,29,State Diagram Example - Elevator,30,Behavioral Modeling & Sequence Diagram,make a list of the different states of a system (How does the system behave?) indicate how the syst

18、em makes a transition from one state to another (How does the system change state?) draw a sequence diagram,31,The Interaction Model,Composed of four elements: use-casessequence diagramsstate diagrams a user interface prototype Each of these is an important UML notation,2018/10/18,32,时序图 时序图用于描述对象与对

19、象之间动态的交互关系,着重体现对象间消息传递的时间顺序。 时序图有两个轴 水平轴表示不同的类/对象,垂直轴表示时间。 时序图中的类/对象用一个带有垂直虚线的矩形框表示,并标有对象名/类名。 垂直虚线是对象的生命线,用于表示在某段时间内对象是存在的。 对象间的通信通过在对象的生命线间画消息来表示,消息从上到下,表明其发送的先后顺序。 消息是对象间的一次通信,传达了要执行动作的信息,它能触发事件。消息可以是信号、操作、调用等,对象接收到消息时,立即开始执行指定活动,即对象被激活了。 “激活”用对象生命线上的一个细长矩形框来表示。消息可以带序号(也可省略),还可带有条件表达式,表示该消息是否被发送。

20、,2018/10/18,33,时序图实例:如图描述了某公司管理系统的脚本“打印工资单”。首先,“Print Cilent”发送消息print(PayCheck,String)给PrintService,该对象发送消息给PayCheckPrinterImage以创建工资单,创建工资单的打印图象时,需要取得雇员的姓名,ID,工资数等,然后才建立打印图象,最后发送print(Image)消息给Printer,打印工资单的图象。,34,Sequence Diagram,35,State Diagram,36,Activity Diagram,2018年10月18日,37,Flow-Oriented Modeling-Example 商店业务处理系统,2018年10月18日,38,第一层数据流图,2018年10月18日,39,第二层DFD 销售,2018年10月18日,40,第二层DFD 采购,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 大学课件

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报