Ch06 - GCU

Embed Size (px)

Citation preview

  • 8/8/2019 Ch06 - GCU

    1/21

    1

    Software Engineering: A Practitioners Approach, 7/eSoftware Engineering: A Practitioners Approach, 7/e

    Chapter 6Chapter 6

    Requirements Modeling:Requirements Modeling:Scenarios, Information, And Analysis ClassesScenarios, Information, And Analysis Classes

  • 8/8/2019 Ch06 - GCU

    2/21

    Agenda Chapter 6

    Requirements Modeling

    Requirements Analysis

    Scenario-Based Modeling Data Modeling

    Class-Based Modeling

  • 8/8/2019 Ch06 - GCU

    3/21

    3

    Requirements AnalysisRequirements Analysis

    Requirements analysisRequirements analysis specifies softwares operational characteristicsspecifies softwares operational characteristics

    indicates software's interface with other system elementsindicates software's interface with other system elements

    establishes constraints that software must meetestablishes constraints that software must meet

    Requirements analysis allows the software engineer (called anRequirements analysis allows the software engineer (called ananalystanalystorormodelermodelerin this role) to:in this role) to: elaborate on basic requirements established during earlier requirementelaborate on basic requirements established during earlier requirement

    engineering tasksengineering tasks

    build models that depict user scenarios, functional activities, problembuild models that depict user scenarios, functional activities, problemclasses and their relationships, system and class behavior, and the flowclasses and their relationships, system and class behavior, and the flow

    of data as it is transformed.of data as it is transformed. Requirements models provide a software designer with informationRequirements models provide a software designer with information

    that can be translated to architectural, interface, and componentthat can be translated to architectural, interface, and component--level designs.level designs.

  • 8/8/2019 Ch06 - GCU

    4/21

    4

    A BridgeA Bridge

    e

    de ri i

    i

    de

    de ig

    de

    The requirements model bridges the gap between a system-level description that describes overall system or business

    functionality as it is achieved by applying software, hardware, data,human, and other system elements

    and a software design that describes the softwares applicationarchitecture, user interface, and component-level structure.

  • 8/8/2019 Ch06 - GCU

    5/21

  • 8/8/2019 Ch06 - GCU

    6/21

    6

    ScenarioScenario--Based ModelingBased ModelingRequirements modeling with UML begins with the creationRequirements modeling with UML begins with the creation

    of scenarios in the form of use cases, activity diagrams, andof scenarios in the form of use cases, activity diagrams, and

    swimlane diagrams.swimlane diagrams.

  • 8/8/2019 Ch06 - GCU

    7/21

    [Use[Use--cases] are simply an aid to defining what existscases] are simply an aid to defining what exists

    outside the system (actors) and what should beoutside the system (actors) and what should be

    performed by the system (useperformed by the system (use--cases). Ivar Jacobsoncases). Ivar Jacobson

    (1) What should we write about?(1) What should we write about?

    (2) How much should we write about it?(2) How much should we write about it?

    Creating a Preliminary Use CaseCreating a Preliminary Use Case

    (3) How detailed should we make our description?(3) How detailed should we make our description?

    Refining a Preliminary a Use CaseRefining a Preliminary a Use Case

    (4) How should we organize the description?(4) How should we organize the description?

    Writing Formal Use CaseWriting Formal Use Case

    7

    ScenarioScenario--Based ModelingBased Modeling

  • 8/8/2019 Ch06 - GCU

    8/21

    8

    Developing a Preliminary UseDeveloping a Preliminary Use--CaseCase

    List the functions or activities performed by the system by aList the functions or activities performed by the system by a

    specific actorspecific actor

    Two variations existsTwo variations exists

    Narrative presentationNarrative presentation

    Sequential presentationSequential presentation

    Use cases of this type are sometimes referred to as primaryUse cases of this type are sometimes referred to as primary

    scenarios.scenarios.

  • 8/8/2019 Ch06 - GCU

    9/21

    9

    Refining a Preliminary UseRefining a Preliminary Use--CaseCase

    Alternative interactions (secondary scenarios) are essential for a completeAlternative interactions (secondary scenarios) are essential for a complete

    understanding of the function that is being described by a use case.understanding of the function that is being described by a use case.

    Secondary scenarios represent alternative interactionsSecondary scenarios represent alternative interactions

    A set of secondary scenarios is obtained by evaluating primary scenario byA set of secondary scenarios is obtained by evaluating primary scenario by

    asking following questions:asking following questions: Can the actor take some other action at this point?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 some error condition at this point?

    Is it possible that the actor will encounter some other behavior at this point?Is it possible that the actor will encounter some other behavior at this point?

    Alternative behavior is characterized as useAlternative behavior is characterized as use--case exception.case exception. An exception describes a situation that causes the system to exhibit somewhat differentAn exception describes a situation that causes the system to exhibit somewhat different

    behaviorbehavior

  • 8/8/2019 Ch06 - GCU

    10/21

    10

    Writing a Formal UseWriting a Formal Use--CaseCase

    Informal use cases are insufficient for describing a complex set of stepsInformal use cases are insufficient for describing a complex set of steps

    with a significant number of exceptionswith a significant number of exceptions

    A formal description of a use case includesA formal description of a use case includes Goal in contextGoal in context

    PreconditionPrecondition

    TriggerTrigger Scenario (list of actions)Scenario (list of actions)

    ExceptionsExceptions

    additional heading may be addedadditional heading may be added

  • 8/8/2019 Ch06 - GCU

    11/21

    11

    UseUse--Case DiagramCase Diagram

    There is no need to create aThere is no need to create a

    diagrammatic representation,diagrammatic representation,

    however, it can facilitatehowever, it can facilitate

    understanding, particularly whenunderstanding, particularly when

    the scenario is complex.the scenario is complex.

  • 8/8/2019 Ch06 - GCU

    12/21

    12

    Activity DiagramActivity Diagram

    SupplementsSupplements the usethe use--case bycase by

    providing a diagrammaticproviding a diagrammatic

    representation of the flow ofrepresentation of the flow of

    interaction within a specificinteraction within a specific

    scenario.scenario.

    Adds additional detail notAdds additional detail not

    directly mentioned (but implied)directly mentioned (but implied)

    by the use case.by the use case.

  • 8/8/2019 Ch06 - GCU

    13/21

    13

    Swimlane DiagramsSwimlane Diagrams

    A useful variation of the activityA useful variation of the activity

    diagram that allows tdiagram that allows the modelerhe modeler

    to represent the flow of activitiesto represent the flow of activities

    described by the use case anddescribed by the use case and

    at the same time indicate whichat the same time indicate which

    actor (if there are multiple actorsactor (if there are multiple actorsinvolved in a specific useinvolved in a specific use--case)case)

    or analysis class hasor analysis class has

    responsibility for the actionresponsibility for the action

    described by an activitydescribed by an activity

    rectangle.rectangle.

  • 8/8/2019 Ch06 - GCU

    14/21

    14

    Data Modeling ConceptsData Modeling ConceptsData models depict the information domain for the problemData models depict the information domain for the problem

  • 8/8/2019 Ch06 - GCU

    15/21

  • 8/8/2019 Ch06 - GCU

    16/21

    16

    What is a Data Object?What is a Data Object?

    AA datadata objectobject isis aa representationrepresentation ofof anyany compositecomposite

    informationinformation thatthat isis processedprocessed byby software,software, ee..gg..,,

    dimensionsdimensions

    TheThe descriptiondescription ofof thethe datadata objectobject incorporatesincorporates thethedatadata objectobject andand allall ofof itsits attributesattributes..

    AA datadata objectobject encapsulatesencapsulates datadata onlyonlytherethere isis nono

    referencereference withinwithin aa datadata objectobject toto operationsoperations thatthat actact onon

    thethe datadata.. DataData objectobject isis notnot thethe samesame thingthing asas objectobject--orientedoriented classclass

  • 8/8/2019 Ch06 - GCU

    17/21

    17

    Typical ObjectsTypical Objectsexternal entitiesexternal entities (printer, user, sensor)(printer, user, sensor)

    thingsthings (e.g, reports, displays, signals)(e.g, reports, displays, signals)

    occurrences or eventsoccurrences or events (e.g., telephone call, alarm)(e.g., telephone call, alarm)

    rolesroles (e.g., manager, engineer, salesperson)(e.g., manager, engineer, salesperson)

    organizational unitsorganizational units (e.g., division, team)(e.g., division, team)

    placesplaces (e.g., manufacturing floor)(e.g., manufacturing floor)

    structuresstructures (e.g., employee record)(e.g., employee record)

  • 8/8/2019 Ch06 - GCU

    18/21

    18

    Data AttributesData Attributes DataData attributesattributes definedefine thethe propertiesproperties ofof aa datadata objectobject

    andand taketake onon oneone ofof threethree differentdifferent characteristicscharacteristics..

    NameName anan instanceinstance ofof thethe datadata objectobject

    DescribeDescribe thethe instance,instance, oror

    MakeMake referencereference toto anotheranother instanceinstance inin anotheranother

    tabletable..

    OneOne oror moremore ofof thethe attributesattributes mustmust bebe defineddefined asas anan

    identifieridentifier.. AttributesAttributes forfor aa givengiven datadata objectobject isis determineddetermined

    throughthrough anan understandingunderstanding ofof thethe problemproblem contextcontext..

  • 8/8/2019 Ch06 - GCU

    19/21

    19

    RelationshipRelationshipDataData objectsobjects areare connectedconnected toto oneone

    anotheranother inin twotwo differentdifferent waysways::

    BasicBasic connectionconnection betweenbetween twotwo

    relatedrelated objectsobjects

    RelationshipRelationship withinwithin thethe contextcontext ofof

    thethe softwaresoftware toto bebe builtbuilt

  • 8/8/2019 Ch06 - GCU

    20/21

    20

    ClassClass--Based ModelingBased ModelingClass modeling is a representation of the objectClass modeling is a representation of the object--orientedoriented

    classes and the resultant collaborations that allow a systemclasses and the resultant collaborations that allow a system

    to function.to function.

  • 8/8/2019 Ch06 - GCU

    21/21

    21

    ClassClass--Based ModelBased Model

    A classA class--based model includesbased model includes

    Classes and objectsClasses and objects

    AttributesAttributes

    OperationsOperations ClassClass--responsibilityresponsibility--collaborator (CRC) modelscollaborator (CRC) models

    Collaboration diagramsCollaboration diagrams

    PackagesPackages

    Analysis classes, attributes, operations etc., areAnalysis classes, attributes, operations etc., are

    identified by examining the problem statement.identified by examining the problem statement.