软件工程英文教学课件:Ch6 Requirements Modeling Scenarios, Information, and Analysis Classes_第1页
软件工程英文教学课件:Ch6 Requirements Modeling Scenarios, Information, and Analysis Classes_第2页
软件工程英文教学课件:Ch6 Requirements Modeling Scenarios, Information, and Analysis Classes_第3页
软件工程英文教学课件:Ch6 Requirements Modeling Scenarios, Information, and Analysis Classes_第4页
软件工程英文教学课件:Ch6 Requirements Modeling Scenarios, Information, and Analysis Classes_第5页
已阅读5页,还剩44页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1Chapter 6Requirements Modeling: Scenarios, Information, and Analysis Classes Software Engineering: A Practitioners Approach, 7/e by Roger S. Pressman2Requirements AnalysisRequirements analysis specifies softwares operational characteristicsindicates softwares interface with other system elements es

2、tablishes constraints that software must meetRequirements analysis allows the software engineer (called an analyst or modeler in this role) to:elaborate(精化) on basic requirements established during earlier requirement engineering tasksbuild models that depict user scenarios, functional activities, p

3、roblem classes and their relationships, system and class behavior, and the flow of data as it is transformed. 3A Bridge44Two analysis modelStructured analysis (SA) Objectoriented analysis (OOA) 功能(用例) 模型 对象/行为模型 属性、 协作 操作、 对象/关 系模型 5Elements of Requirements Analysis6Scenario-Based Modeling“Use-cases

4、 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 organ

5、ize the description?(描述结构) 7What to Write About?Inception and elicitationprovide you with the information youll need to begin writing use cases. Requirements gathering meetings, and other requirements engineering mechanisms are used to define the problem scopespecify overall operational goalsoutline

6、 all known functional requirementsdescribe objects that will be manipulated by systemTo begin developing a set of use cases, list the functions or activities performed by a specific actor.(考虑每一个角色是如何使用系统的)8How Much to Write About?As further conversations with the stakeholders progress, the requireme

7、nts gathering team develops use cases for each of the functions. use case diagrama scenario that describes a “thread of usage” for a systemactors represent roles people or devices play as the system functionsusers can play a number of different roles for a given scenario9Use-Case Diagrama scenario t

8、hat describes a “thread of usage” for a systemactors represent roles people or devices play as the system functionsusers can play a number of different roles for a given scenario2022/7/1810状态是对象执行了一系列活动的结果。当某个事件发生后,对象的状态将发生变化,这种变化用状态图来表示。状态图描述了单个对象在其整个生命周期中的行为。状态图由对象的状态及状态间的迁移构成。它既可用于模拟系统对象按事件发生顺序产生

9、的各种行为,还可描述用例的一个脚本。状态是对象属性值的抽象,有时间上的持续性,可分为初始状态(用实心圆表示)、最终状态(用同心圆表示)、中间状态等。事件是指定时刻发生的事情,没有持续时间。通常,状态和事件是紧密相连的。节点表示状态,带箭头的连线表示状态的迁移。“do/活动”表明进入状态后对象执行的操作,为可选项。护卫条件是一个布尔表达式,其值如果为真,则触发状态转移,否则不触发。动作和事件的发生也可触发状态的转移。 State Diagram(状态图)11State DiagramReading CommandsSystem status = “ready”Display msg = “ent

10、er cmd”Display status = steadyEntry/subsystems readyDo: poll user input panelDo: read user inputDo: interpret user inputState nameState variablesState activities2022/7/1812状态图的一个实例13Activity DiagramSupplements the use case by providing a graphical representation of the flow of interaction within a s

11、pecific scenario2022/7/1814 Activity Diagram 活动图用于描述从活动到活动的流。它可用来为系统的动态方面建模,还可用来描述用例脚本。在活动图中,一个活动结束后立即进入下一个活动(在状态图中状态的变迁可能需要事件的触发)。 控制流从一个动作或活动状态传递到下一个动作或活动状态称为跃迁,跃迁可以用简单的有向线条表示。 分叉表示将单一的控制流分成两个或多个并发的控制流,分叉有一个输入和多个输出,分叉路径相关的活动是并行的。 联结代表两个或多个并发控制流的同步,联结有多个输入和一个输出,在联结上,与各路径有关的活动是并行的。活动图描述发生了什么,但没有说明该活

12、动由谁来完成。泳道决定各个活动由哪个类来完成。 泳道用矩形框表示,属于某个泳道的活动放在该矩形框中,将对象名放在矩形框的顶部,表示泳道中的活动由谁负责。 2022/7/1815Activity Diagram: Example16Swimlane DiagramsAllows the modeler to represent the flow of activities described by the use-case and at the same time indicate which actor or analysis class has responsibility for the

13、action described by an activity rectangle17Swimlane Diagrams泳道图18Data Modelingexamines data objects independently of processingfocuses attention on the data domaincreates a model at the customers level of abstractionindicates how data objects relate to one another19What is a Data Object?a representa

14、tion of almost any composite information that must be understood by software. can be an external entity (e.g., anything that produces or consumes information), a thing (e.g., a report or a display), an occurrence (e.g., a telephone call) or event (e.g., an alarm), a role (e.g., salesperson), an orga

15、nizational unit (e.g., accounting department), a place (e.g., a warehouse), or a structure (e.g., a file). The description of data object includes the data object and all of its attributes.A data object encapsulates data onlythere is no reference within a data object to operations that act on the da

16、ta.20Data Objects and AttributesA data object contains a set of attributes that act as an aspect, quality, characteristic, or descriptor of the objectobject: automobileattributes: make model body type price options code21Class DiagramFrom the SafeHome system 类图是面向对象建模中最常用的图,也是其它图(状态图,协作图,组件图等)的基础,它描

17、述的是类与类之间的静态关系。UML中的类图用一个矩形表示,它由三个区域构成,分别标注类名、属性和服务。22What is a Relationship?Data objects are connected to one another in different ways.A connection is established between person and car because the two objects are related.A person owns a carA person is insured to drive(架车保险) a car The relationships

18、 owns and insured to drive define the relevant connections between person and car.Several instances of a relationship can existObjects can be related in many different ways23ERD Notation(0, m)(1, 1)objectobjectrelationship12One common form:(0, m)(1, 1)object1object2relationshipAnother common form:at

19、tribute24Building an ERDLevel 1model all data objects (entities) and their “connections” to one anotherLevel 2model all entities and relationshipsLevel 3model all entities, relationships, and the attributes that provide further depth25The ERD: An Example26Class-Based ModelingClass-based modeling rep

20、resents: objects that the system will manipulate operations (also called methods or services) that will be applied to the objects to effect the manipulation relationships (some hierarchical) between the objectscollaborations that occur between the classes that are defined. The elements of a class-ba

21、sed model include classes and objects, attributes, operations, CRC models, collaboration diagrams and packages. 27Identifying Analysis ClassesExamining the usage scenarios developed as part of the requirements model and perform a grammatical parse Classes are determined by underlining each noun or n

22、oun phrase. If the class (noun) is required to implement a solution, then it is part of the solution space; otherwise, if a class is necessary only to describe a solution, it is part of the problem space. 28Manifestations(表现) of Analysis ClassesAnalysis classes manifest themselves in one of followin

23、g ways:External entities (e.g., other systems, devices, people) that produce or consume information Things (e.g, reports, displays, letters, signals) that are part of the information domain for the problemOccurrences or events (e.g., a property transfer or the completion of a series of robot movemen

24、ts) that occur within the context of system operationActors (e.g., manager, engineer, salesperson) played by people who interact with the systemOrganizational units (e.g., division, group, team) that are relevant to an applicationPlaces (e.g., manufacturing floor or loading dock) that establish the

25、context of the problem and the overall functionStructures (e.g., sensors, four-wheeled vehicles, or computers) that define a class of objects or related classes of objects29Potential ClassesRetained information. The potential class will be useful if information must be remembered so that the system

26、can function.Needed services. The potential class must have a set of identifiable operations that can change the value of its attributes in some way.Multiple attributes. During requirement analysis, the focus should be on major information; a class with a single attribute may be useful during design

27、, but is probably better represented as an attribute of another class during the analysis activity.Common attributes. A set of attributes can be defined for the potential class and these attributes apply to all instances of the class.Common operations. A set of operations can be defined for the pote

28、ntial class and these operations apply to all instances of the class.Essential requirements. External entities that appear in the problem space to the operation of any solution for the system will almost always be defined as classes in the requirements model.30Defining AttributesAttributes describe

29、a class that has been selected for inclusion in the analysis model.build two different classes for professional baseball(棒球) playersFor Playing Statistics software: name, position, batting(击球) average, fielding(防守) percentage, years played, and games played might be relevantFor Pension(养老金) Fund sof

30、tware: average salary, credit toward full vesting(三金五险), pension plan options chosen, mailing address, and the like.又如:学生可以定义为“学生档案(反映个人基本情况的属性)”和“学生成绩(反映学习情况的属性)”两个不同的类。31Defining OperationsDo a grammatical parse of a processing narrative and look at the verbsOperations can be divided into four cat

31、egories: (1) operations that manipulate data in some way (e.g., adding, deleting, reformatting, selecting)(2) operations that perform a computation(3) operations that inquire about the state of an object (4) operations that monitor an object for the occurrence of a controlling event.32Class TypesEnt

32、ity classes, also called model or business classes, are extracted directly from the statement of the problem (e.g., 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 class

33、es manage a “unit of work” 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

34、 communicated between objects or between the user and the application. 33CRC ModelsClass-responsibility-collaborator (CRC) modeling Ambler Amb95 describes CRC modeling in the following way:A CRC model is a collection of standard index cards that represent classes. The cards are divided into three se

35、ctions. Along the top of the card you write the name of the class. In the body of the card you list the class responsibilities on the left and the collaborators on the right.34CRC Modeling35ResponsibilitiesEach responsibility should be stated as generally as possibleInformation and behavior related

36、to it should reside within the same classInformation about one thing should be localized with a single class, not distributed across multiple classes. Responsibilities should be shared among related classes, when appropriate. 36CollaborationsClasses fulfill their responsibilities in one of two ways:

37、 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 classesCollaborations are identified by determining whether a class can fulfill each respo

38、nsibility itselfthree different relationships between classes: the is-part-of relationship the has-knowledge-of relationship the depends-upon relationship37Composite Aggregate(聚合关系)代表“整体与部分”的关系38Associations and Multiplicity(多样性)Two analysis classes are often related to one another in some fashionIn

39、 UML these relationships are called associationsAssociations can be refined by indicating multiplicity代表“一般与特殊”的关系39Dependencies(依赖性)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 depend

40、ency relationship is established40PackagesVarious elements of the analysis model (e.g., use-cases, 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

41、therefore accessible from other packages.The minus sign indicates that an element is hidden from all other packages.The # symbol indicates that an element is accessible only to packages contained within a given package.Class-Based Modeling - SummaryObjects are extracted from use-casesRelationships among obj

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论