System models by A3up88m4


									Chapter 7: System models
              Abstract descriptions of systems whose
               requirements are being analysed
                •      Models help developers to communicate with customers
              System modeling helps the analyst to understand
               the functionality of the system
              Different models present the system from
               different perspectives
                •      Data perspective showing the data architecture
                •      Functional perspective showing the data transformations
                       (processes) that occur in a system
                •      Behavioral perspective showing the behavior of the system
Software Engineering, Chapter 7                                                    Slide 1
Analysis Modeling
              Analysis Modeling, 2 approaches:
                •      Structured analysis – initiated by structured programming
                •      Object oriented analysis – initiated by OOP
              Elements of structured analysis
                •      Data model – data objects and their relationships
                         » Entity relationship diagrams (ERD)
                •      Functional model – data transformations
                         » Data flow diagrams (DFD)
                •      Behavioral model – event and states
                         » State transition diagrams (STD)
                •      Data dictionary

Software Engineering, Chapter 7                                                    Slide 2
Model weaknesses
              They do not model non-functional system
              They do not usually include information about
               whether a method is appropriate for a given
              The may produce too much documentation
              The system models are sometimes too detailed
               and difficult for users to understand

Software Engineering, Chapter 7                                Slide 3
Data modeling: ERD
        Describe entities (objects) and their relationships
        Entity – something that can be described by
           •     Attributes define the properties of an entity
           •     Each entity has a primary key that uniquely identifies an entity
        Relationships connect entities
           •     Relationships can be binary, ternary, quaternary
           •     An instances may participate more than once in a relationship
           •     They can have their own descriptive attributes
           •     Multiplicity of a relationship – the number of occurrences of an
                 entity that may relate to a single occurrence of another entity

Software Engineering, Chapter 7                                                     Slide 4
Example of an ERD (in UML notation)


                                  1..1   0..1

                                  1..*   1..1

Software Engineering, Chapter 7                                Slide 5
Functional model: DFD
              Data flow models are used to show the processes
               and the flow of information from one process to
              DFDs show the processing steps as data flows
               through a system
              Intrinsic part of many analysis methods
              Simple and intuitive notation that customers can
              Show end-to-end processing of data

Software Engineering, Chapter 7                             Slide 6
Data flow diagrams
              DFDs model the system from a functional
              DFDs has three basic elements:
                •      external entities (producers or consumers of data),
                •      processes, and data flows
              DFDs may represent different levels of
                •      Level-0: entire system represented by a single process

                                  External                     External
                                  entities      system         entities

Software Engineering, Chapter 7                                                 Slide 7
    Order processing DFD
                                                                                                              Checked and
                                Completed                    Signed        Signed        Send to              signed order
                                order form                 order form    order form    4 supplier                + order
  Or der
 details +          1 Complete               2 Valida te           3 Record
  blank              order form                 order                 order
order form                                                                                 Adjust
                                                                  Order                 5 available
                                                                               Signed      budget
                                                                  details    order form
                                                                                                      + account
                                                                        Orders            Budget
                                                                         file              file

     Software Engineering, Chapter 7                                                                              Slide 8
Behavioral model: STD
              It models the behavior of the system in response
               to external and internal events
              It shows the system’s responses to stimuli so are
               often used for modeling real-time systems
              State machine models show system states as
               nodes and events as arcs between these nodes.
                •      When an event occurs, the system moves from one state to
                       another (state transition)

Software Engineering, Chapter 7                                                   Slide 9
STD for a microwave oven
          power           Full power
                         do: set power
                           = 600

    do: display                                                                            Operation
        time                       Full          Set time
                                  power                                                   do: operate    Completion
                                              do: get number
                                               exit: set time                                oven
   Half                   power
  power                                                                                                 Cancel
                                          Timer                 closed
                                                      Door                        Start
                                                      open                                   Door
                         Half power                                       Enabled            open                 Waiting
                        do: set power                      Door          do: display                             do: display
                          = 300                           closed            'Ready'                                  time

                                                  do: display

Software Engineering, Chapter 7                                                                                                Slide 10
Microwave oven state description
      State                                         Description
Waiting                 The oven is waiting for input. T he display shows the current time.
Half power              The oven power is set to 300 watts. The display shows ‘Half
Full power              The oven power is set to 600 watts. The display shows ‘Full
Set time                The cooking time is set to the user’s input value. The display
                        shows the cooking time selected and is updated as the time is set.
Disabled                Oven operation is disabled for safety. Interior oven light is on.
                        Display shows ‘Not ready’.
Enabled                 Oven operation is enabled. Interior oven light is off. Display
                        shows ‘Ready to cook’.
Operation               Oven in operation. Interior oven light is on. Display shows the
                        timer countdown. On completion of cooking, the buzzer is
                        sounded for 5 seconds. Oven light is on. Display shows ‘ Cooking
                        complete’ while buzzer is sounding.

Software Engineering, Chapter 7                                                               Slide 11
Microwave oven stimuli
         Stimulus                                             Description
     Half power                   The user has pressed the half power button
     Full power                   The user has pressed the full power button
     T imer                       The user has pressed one of the timer buttons
     Number                       The user has pressed a numeric key
     Door open                    The oven door switch is not closed
     Door closed                  The oven door switch is closed
     Start                        The user has pressed the start button
     Cancel                       The user has pressed the cancel button

Software Engineering, Chapter 7                                                   Slide 12
Data dictionaries
              Data dictionaries are lists of all of the names used
               in the system models. Descriptions of the entities,
               relationships and attributes are also included
              Advantages
                •      Support name management and avoid duplication
                •      Store of organisational knowledge linking analysis, design and
              Many CASE workbenches support data

Software Engineering, Chapter 7                                                   Slide 13
Data dictionary entries
               Name                        Description                Type        Date
                             1:N relation between entities of type
           has-labels        Node or Link and entities of type        Relation    5.10.1998
                             Holds structured or unstructured
           Label             information about nodes or links.        Entity      8.12.1998
                             Labels are represented by an icon
                             (which can be a transparent box) and
                             associated text.
                             A 1:1 relation between design
           Link              entities represented as nodes. Links     Relation    8.12.1998
                             are typed and may be named.
                             Each label has a name which
           name              identifies the type of label. The name   Attribute   8.12.1998
           (label)           must be unique within the set of label
                             types used in a design.
                             Each node has a name which must be
           name              unique within a design. T he name        Attribute   15.11.1998
           (node)            may be up to 64 characters long.

Software Engineering, Chapter 7                                                                Slide 14
Object oriented analysis (OOA)
              Based on object models
                •      They describe the system in terms of object/classes
                •      Natural way of representing external real-world entities
              A class is an abstraction over a set of objects with
               common attributes and the services (operations)
               provided by each object
              OOA consists of:
                •      Defining use cases
                •      Identifying objects/classes, their attributes and operations
                •      Indicating how classes/objects are related
                •      Building a behavioral (interaction) model
                •      Iterating on these previous steps
Software Engineering, Chapter 7                                                       Slide 15
              Objects are identified by examining the nouns in
               a problem statement or scenarios
              Objects can be:
                •      Physical objects – students, devices, …
                •      Roles of an entity – foreman, operator
                •      Incidents (occurrence of some event) – flight, an alarm
                •      Interactions between objects – course registration
                •      Specifications – a recipe, color
              Objects should not be: redundant, irrelevant,
               vague, attributes, operations

Software Engineering, Chapter 7                                                  Slide 16
Characteristics of an object
          Identity
             •      each object has its own identity
          Classification
             •      common objects grouped in a class
          Polymorphism
             •      same operation may behave differently on different class
          Inheritance
             •      a class inheriting properties of a parent class
          Encapsulation
             •      Object encapsulates both data and operations

Software Engineering, Chapter 7                                                Slide 17
The Unified Modeling Language (UML)
              Essential for object-oriented analysis and design
              Has become an effective standard for object-
               oriented modeling
              UML combines ERD, DFD, and Object modeling
              UML is a visualization tool that can show:
                •      The use cases (case diagram)
                •      Static structure of a system (class diagram)
                •      Use case realizations (interaction diagram)
                •      The behavior of objects in a system (STD)
                •      Physical implementation of a system (component and
                       deployment diagrams)
Software Engineering, Chapter 7                                             Slide 18
Use case diagram
      Use case diagrams are created to visualize the
       relationships between actors and use cases

                                                  Request Course Roster

      Student                                                                         Professor

                          Maintain Schedule

    Billing System                                                        Maintain Curriculum


Software Engineering, Chapter 7                                                                   Slide 19
Class diagrams
              A class diagram shows the existence of classes
               and their relationships in the logical view of a
              Notation for class diagrams:
                •      Object classes are rectangles with the name at the top, attributes
                       in the middle section and operations in the bottom section
                •      Relationships between object classes (known as associations)
                       are shown as lines linking objects
                •      Inheritance is referred to as generalization and is shown with a
                       small triangle pointing from subclasses to a parent class
                •      Aggregation representing part-of relationships uses a diamond
Software Engineering, Chapter 7                                                     Slide 20
                                      Library item
                                 Catalogue number
                                                                Library class hierarchy
                                 Acquisition date
                                 Number of copies
                                  Acquire ()
                                  Catalogue ()
                                  Dispose ()
                                  Issue ()
                                  Return ()

              Published item                                 Recorded item
            Title                                           Title
            Publisher                                       Medium

     Book                  Magazine                  Film                Computer
Author                  Year                Director
Edition                 Issue               Date of release           Version
Publication date                            Distributor               Platform
                 Libr ary user                User class hierarchy
              Registration #
              Register ()
              De-r egister ()

     Reader                                   Borrower
Affiliation                              Items on loan
                                         Max. loans

                                 Staff                   Student
                         Department                 Major subject
                         Department phone           Home address
Multiple inheritance
              Rather than inheriting the attributes and services
               from a single parent class, a system which
               supports multiple inheritance allows object
               classes to inherit from several super-classes
              Can lead to semantic conflicts where
               attributes/services with the same name in
               different super-classes have different semantics
              Makes class hierarchy reorganization more

Software Engineering, Chapter 7                                Slide 23
Multiple inheritance
                                  Book                    Voice recording
                        Author                            Speaker
                        Edition                           Duration
                        Publication date                  Recording date

                                           Talking book
                                         # Tapes

Software Engineering, Chapter 7                                             Slide 24
Object aggregation

Software Engineering, Chapter 7   Slide 25
Object behavior modeling
        A behavioral model shows the interactions between
         objects to produce some particular system behavior
         that is specified as a use-case
        Sequence diagrams (or collaboration diagrams) in
         UML are used to model interaction between objects
           •     An object is shown as a box at the top
           •     A vertical line represents an object’s life during the interaction
           •     Each message is represented by an arrow between the lifelines of
                 two objects, indicating who sends the message and when
           •     Activation box shows when an object is active
           •     A condition (in square brackets) indicates when a message is sent

Software Engineering, Chapter 7                                                  Slide 26
Issue of electronic items
                                       Ecat:                     :Library Item         Lib1:
                                       Catalog                                         NetServer

              :Library User



                                                 Issue licence

                          Accept licence

Time                                                                        Compress
 Software Engineering, Chapter 7                                                                   Slide 27

To top