System models l Abstract descriptions of systems whose

43
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1 System models l Abstract descriptions of systems whose requirements are being analysed

Transcript of System models l Abstract descriptions of systems whose

Page 1: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1

System models

l Abstract descriptions ofsystems whose requirementsare being analysed

Page 2: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 2

Objectives

l To explain why the context of a system should bemodelled as part of the RE process

l To describe behavioural modelling, datamodelling and object modelling

l To introduce some of the notations used in theUnified Modeling Language (UML)

l To show how CASE workbenches supportsystem modelling

Page 3: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 3

Topics covered

l Context models

l Behavioural models

l Data models

l Object models

l CASE workbenches

Page 4: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 4

System modelling

l System modelling helps the analyst to understandthe functionality of the system and models areused to communicate with customers

l Different models present the system fromdifferent perspectives• External perspective showing the system’s context or

environment

• Behavioural perspective showing the behaviour of the system

• Structural perspective showing the system or data architecture

Page 5: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 5

Structured methods

l Structured methods incorporate system modellingas an inherent part of the method

l Methods define a set of models, a process forderiving these models and rules and guidelinesthat should apply to the models

l CASE tools support system modelling as part of astructured method

Page 6: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 6

Method weaknesses

l They do not model non-functional systemrequirements

l They do not usually include information aboutwhether a method is appropriate for a givenproblem

l The may produce too much documentation

l The system models are sometimes too detailedand difficult for users to understand

Page 7: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 7

Model typesl Data processing model showing how the data is

processed at different stages

l Composition model showing how entities arecomposed of other entities

l Architectural model showing principal sub-systems

l Classification model showing how entities havecommon characteristics

l Stimulus/response model showing the system’sreaction to events

Page 8: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 8

Context models

l Context models are used to illustrate theboundaries of a system

l Social and organisational concerns may affect thedecision on where to position system boundaries

l Architectural models show the a system and itsrelationship with other systems

Page 9: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 9

The context of an ATM system

Auto-tellersystem

Securitysystem

Maintenancesystem

Accountdatabase

Usagedatabase

Branchaccounting

system

Branchcountersystem

Page 10: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 10

Process models

l Process models show the overall process and theprocesses that are supported by the system

l Data flow models may be used to show theprocesses and the flow of information from oneprocess to another

Page 11: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 11

Equipment procurement process

Get costestimates

Acceptdelivery ofequipment

Checkdelivered

items

Validatespecification

Specifyequipmentrequired

Choosesupplier

Placeequipment

order

Installequipment

Findsuppliers

Supplierdatabase

Acceptdelivered

equipment

Equipmentdatabase

Equipmentspec.

Checkedspec.

Deliverynote

Deliverynote

Ordernotification

Installationinstructions

Installationacceptance

Equipmentdetails

Checked andsigned order form

Orderdetails +

Blank orderform

Spec. +supplier +estimate

Supplier listEquipment

spec.

Page 12: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 12

Behavioural models

l Behavioural models are used to describe theoverall behaviour of a system

l Two types of behavioural model are shown here• Data processing models that show how data is processed as it

moves through the system

• State machine models that show the systems response to events

l Both of these models are required for adescription of the system’s behaviour

Page 13: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 13

Data-processing models

l Data flow diagrams are used to model thesystem’s data processing

l These show the processing steps as data flowsthrough a system

l Intrinsic part of many analysis methods

l Simple and intuitive notation that customers canunderstand

l Show end-to-end processing of data

Page 14: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 14

Order processing DFD

Completeorder form

Orderdetails +

blankorder form

Validateorder

Recordorder

Send tosupplier

Adjustavailablebudget

Budgetfile

Ordersfile

Completedorder form

Signedorder form

Signedorder form

Checked andsigned order

+ ordernotification

Orderamount

+ accountdetails

Signedorder form

Orderdetails

Page 15: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 15

Data flow diagrams

l DFDs model the system from a functionalperspective

l Tracking and documenting how the dataassociated with a process is helpful to develop anoverall understanding of the system

l Data flow diagrams may also be used in showingthe data exchange between a system and othersystems in its environment

Page 16: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 16

CASE toolset DFD

Designeditor

Designcross checker

Designanalyser

Reportgenerator

Designdatabase

Code skeletongenerator

Designdatabase

Inputdesign

Validdesign

Checkeddesign

Designanalysis

Userreport

andReferenced

designsCheckeddesign Output

code

Page 17: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 17

State machine models

l These model the behaviour of the system inresponse to external and internal events

l They show the system’s responses to stimuli soare often used for modelling real-time systems

l State machine models show system states asnodes and events as arcs between these nodes.When an event occurs, the system moves fromone state to another

l Statecharts are an integral part of the UML

Page 18: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 18

Microwave oven modelFull power

Enabled

do: operateoven

Fullpower

Halfpower

Halfpower

Fullpower

Number

TimerDooropen

Doorclosed

Doorclosed

Dooropen

Start

do: set power = 600

Half powerdo: set power = 300

Set time

do: get numberexit: set time

Disabled

Operation

Timer

Cancel

Waiting

do: display time

Waiting

do: display time

do: display 'Ready'

do: display 'Waiting'

Page 19: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 19

Microwave oven state descriptionState Description

Waiting The oven is waiting for input. The display shows the current time.Half power The oven power is set to 300 watts. The display shows ‘Half

power’.Full power The oven power is set to 600 watts. The display shows ‘Full

power’.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 issounded for 5 seconds. Oven light is on. Display shows ‘Cookingcomplete’ while buzzer is sounding.

Page 20: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 20

Microwave oven stimuli

Stimulus DescriptionHalf power The user has pressed the half power buttonFull power The user has pressed the full power buttonTimer The user has pressed one of the timer buttonsNumber The user has pressed a numeric keyDoor open The oven door switch is not closedDoor closed The oven door switch is closedStart The user has pressed the start buttonCancel The user has pressed the cancel button

Page 21: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 21

Statecharts

l Allow the decomposition of a model into sub-models (see following slide)

l A brief description of the actions is includedfollowing the ‘do’ in each state

l Can be complemented by tables describing thestates and the stimuli

Page 22: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 22

Microwave oven operation

Cookdo: run generator

Done

do: buzzer on for 5 secs.

Waiting

Alarm

do: display event

do: checkstatus

Checking

Turntablefault

Emitterfault

Disabled

OK

Timeout

TimeOperation

Dooropen Cancel

Page 23: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 23

Semantic data models

l Used to describe the logical structure of dataprocessed by the system

l Entity-relation-attribute model sets out theentities in the system, the relationships betweenthese entities and the entity attributes

l Widely used in database design. Can readily beimplemented using relational databases

l No specific notation provided in the UML butobjects and associations can be used

Page 24: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 24

Software design semantic modelDesign

namedescriptionC-dateM-date

Link

nametype

Node

nametype

links

has-links

12

1 n

Label

nametexticon

has-labelshas-labels

1

n

1

n

has-linkshas-nodes is-a

1

n

1

n1

1

Page 25: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 25

Data dictionaries

l Data dictionaries are lists of all of the names usedin the system models. Descriptions of the entities,relationships and attributes are also included

l Advantages• Support name management and avoid duplication

• Store of organisational knowledge linking analysis, design andimplementation

l Many CASE workbenches support datadictionaries

Page 26: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 26

Data dictionary entries

Name Description Type Date

has-labels1:N relation between entities of typeNode or Link and entities of typeLabel.

Relation 5.10.1998

LabelHolds structured or unstructuredinformation about nodes or links.Labels are represented by an icon(which can be a transparent box) andassociated text.

Entity 8.12.1998

LinkA 1:1 relation between designentities represented as nodes. Linksare typed and may be named.

Relation 8.12.1998

name(label)

Each label has a name whichidentifies the type of label. The namemust be unique within the set of labeltypes used in a design.

Attribute 8.12.1998

name(node)

Each node has a name which must beunique within a design. The namemay be up to 64 characters long.

Attribute 15.11.1998

Page 27: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 27

Object models

l Object models describe the system in terms ofobject classes

l An object class is an abstraction over a set ofobjects with common attributes and the services(operations) provided by each object

l Various object models may be produced• Inheritance models

• Aggregation models

• Interaction models

Page 28: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 28

Object models

l Natural ways of reflecting the real-world entitiesmanipulated by the system

l More abstract entities are more difficult to modelusing this approach

l Object class identification is recognised as adifficult process requiring a deep understandingof the application domain

l Object classes reflecting domain entities arereusable across systems

Page 29: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 29

Inheritance models

l Organise the domain object classes into ahierarchy

l Classes at the top of the hierarchy reflect thecommon features of all classes

l Object classes inherit their attributes and servicesfrom one or more super-classes. these may thenbe specialised as necessary

l Class hierarchy design is a difficult process ifduplication in different branches is to be avoided

Page 30: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 30

The Unified Modeling Language

l Devised by the developers of widely used object-oriented analysis and design methods

l Has become an effective standard for object-oriented modelling

l Notation• 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 generalisation and is shown‘upwards’ rather than ‘downwards’ in a hierarchy

Page 31: System models l Abstract descriptions of systems whose

Library class hierarchyCatalogue numberAcquisition dateCostTypeStatusNumber of copies

Library item

Acquire ()Catalogue ()Dispose ()Issue ()Return ()

AuthorEditionPublication dateISBN

Book

YearIssue

MagazineDirectorDate of releaseDistributor

Film

VersionPlatform

Computerprogram

TitlePublisher

Published item

TitleMedium

Recorded item

Page 32: System models l Abstract descriptions of systems whose

User class hierarchyNameAddressPhoneRegistration #

Library user

Register ()De-register ()

Affiliation

Reader

Items on loanMax. loans

Borrower

DepartmentDepartment phone

Staff

Major subjectHome address

Student

Page 33: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 33

Multiple inheritance

l Rather than inheriting the attributes and servicesfrom a single parent class, a system whichsupports multiple inheritance allows objectclasses to inherit from several super-classes

l Can lead to semantic conflicts whereattributes/services with the same name indifferent super-classes have different semantics

l Makes class hierarchy reorganisation morecomplex

Page 34: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 34

Multiple inheritance

# Tapes

Talking book

AuthorEditionPublication dateISBN

Book

SpeakerDurationRecording date

Voice recording

Page 35: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 35

Object aggregation

l Aggregation model shows how classes which arecollections are composed of other classes

l Similar to the part-of relationship in semanticdata models

Page 36: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 36

Object aggregation

Videotape

Tape ids.

Lecturenotes

Text

OHP slides

Slides

Assignment

Credits

Solutions

TextDiagrams

Exercises

#Problems Description

Course titleNumberYearInstructor

Study pack

Page 37: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 37

Object behaviour modelling

l A behavioural model shows the interactionsbetween objects to produce some particularsystem behaviour that is specified as a use-case

l Sequence diagrams (or collaboration diagrams) inthe UML are used to model interaction betweenobjects

Page 38: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 38

Issue of electronic items

:Library User

Ecat:Catalog

Lookup

Issue

Display

:Library Item Lib1:NetServer

Issue licence

Accept licence

Compress

Deliver

Page 39: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 39

CASE workbenches

l A coherent set of tools that is designed to supportrelated software process activities such asanalysis, design or testing

l Analysis and design workbenches support systemmodelling during both requirements engineeringand system design

l These workbenches may support a specific designmethod or may provide support for a creatingseveral different types of system model

Page 40: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 40

An analysis and design workbench

Centralinformationrepository

Codegenerator

Querylanguagefacilities

Structureddiagramming

tools

Datadictionary

Reportgenerationfacilities

Design, analysisand checking

tools

Formscreation

tools

Import/exportfacilities

Page 41: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 41

Analysis workbench components

l Diagram editors

l Model analysis and checking tools

l Repository and associated query language

l Data dictionary

l Report definition and generation tools

l Forms definition tools

l Import/export translators

l Code generation tools

Page 42: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 42

Key points

l A model is an abstract system view.Complementary types of model provide differentsystem information

l Context models show the position of a system inits environment with other systems and processes

l Data flow models may be used to model the dataprocessing in a system

l State machine models model the system’sbehaviour in response to internal or externalevents

Page 43: System models l Abstract descriptions of systems whose

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 43

Key points

l Semantic data models describe the logicalstructure of data which is imported to or exportedby the systems

l Object models describe logical system entities,their classification and aggregation

l Object models describe the logical system entitiesand their classification and aggregation

l CASE workbenches support the development ofsystem models