SWEN 5231 FORMAL METHODS Slide 1 System models u Abstract presentations of systems whose...

31
FORMAL METHODS System models Abstract presentations of systems whose requirements are being analyzed

Transcript of SWEN 5231 FORMAL METHODS Slide 1 System models u Abstract presentations of systems whose...

SWEN 5231 FORMAL METHODS Slide 1

System models

Abstract presentations of systems whose requirements are being analyzed

SWEN 5231 FORMAL METHODS Slide 2

Objectives

To explain the role of system models in the requirements analysis process

To show how different models can present complementary system information

To describe different types of system model To introduce the notion of a data dictionary as a

supplement to system models

SWEN 5231 FORMAL METHODS Slide 3

Topics covered

Data-flow models Semantic data models Object models Data dictionaries

SWEN 5231 FORMAL METHODS Slide 4

System modeling

System modeling helps the analyst to understand the functionality of the system and models are used to communicate with customers

Models are abstract - they always leave out some system information

Method-based analysis relies heavily on system modeling. Methods usually prescribe the models to be developed

SWEN 5231 FORMAL METHODS Slide 5

Different types of system model

There are several complementary types of system model• Data-processing model

• Composition model

• Classification model

• Stimulus-response model

• Process model

This chapter covers data-flow models (data processing), semantic data models (composition) and object models (classification and aggregation)

SWEN 5231 FORMAL METHODS Slide 6

Data-flow models

Show the processing steps as data flows through a system

Intrinsic part of many analysis methods Simple and intuitive notation that customers can

understand Show end-to-end processing of data

SWEN 5231 FORMAL METHODS Slide 7

Order processing DFD

Completeorder form

Orderdetails +

blankorder form

Valida teorder

Recordorder

Send tosupplier

Adjustavailablebudget

Budgetfile

Ordersfile

Completedorder form

Signedorder form

Signedorder form

Checked andsigned order

+ ordernotification

Orderamount

+ accountdetails

Signedorder form

Orderdetails

SWEN 5231 FORMAL METHODS Slide 8

Data-flow diagrams

may be used to show processing at different levels of abstraction from fairly abstract to fairly detailed

May also be used for architectural description showing data interchange between the sub-systems making up the system

Not a good way to describe system interfaces

SWEN 5231 FORMAL METHODS Slide 9

Equipment procurement DFD

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

SupplierlistEquipment

spec.

SWEN 5231 FORMAL METHODS Slide 10

CASE toolset DFD

Designeditor

Designcross checker

Designanalyser

Reportgenerator

Designdatabase

Code skeletongenerator

Designdatabase

Inputdesign

Validdesign

Checkeddesign

Designanalysis

Userreport

and

Referenceddesigns

Checkeddesign Output

code

SWEN 5231 FORMAL METHODS Slide 11

Semantic data models

Used to describe the logical structure of data processed by the system

Entity-relation model sets out the entities in the system, the relationships between these entities and the entity attributes

Widely used in database design. Can readily be implemented using relational databases

SWEN 5231 FORMAL METHODS Slide 12

Notation for semantic data models

A relation between entities.The number of input entity instancesis the input cardinality. The number

of output instances is the outputcardinality.

An inheritance relation.An entity inherits the a ttributes of its

related entity. The sub-type is referencedby the arrow.

< name >

< input cardinality >

< output cardinality >

An entity

< name >

An entity or relationattribute

< name >

SWEN 5231 FORMAL METHODS Slide 13

Software design semantic model

C-date

M-date

linksNode

hasnodes

name

typehas

labels

is_a

Design

Label

name type

Link

haslinks

name

typehas

labels

haslinks

DesignDesc.

Owner

IconTextlabel

text bitmap

N

1

N

1

N

1

N

1

N

1

12

1

1

SWEN 5231 FORMAL METHODS Slide 14

Object models

Object models describe the system in terms of object classes

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

Various object models may be produced• Inheritance models

• Aggregation models

• Service models

SWEN 5231 FORMAL METHODS Slide 15

Object models

Natural ways of reflecting the real-world entities manipulated by the system

More abstract entities are more difficult to model using this approach

Object class identification is recognized as a difficult process requiring a deep understanding of the application domain

Object classes reflecting domain entities are reusable across systems

SWEN 5231 FORMAL METHODS Slide 16

Object class notation

< attributes >

< services >

< class name >

SWEN 5231 FORMAL METHODS Slide 17

Inheritance models

Organize the domain object classes into a hierarchy

Classes at the top of the hierarchy reflect the common features of all classes

Object classes inherit their attributes and services from one or more super-classes. these may then be specialized as necessary

Class hierarchy design is a difficult process if duplication in different branches is to be avoided

SWEN 5231 FORMAL METHODS Slide 18

Library class hierarchy

Catalogue numberAcquisition dateCostTypeStatusNumber of copies

Library item

AcquireCatalogueDisposeIssueReturn

AuthorEditionPublication dateISBN

Book

YearIssue

Magazine

DirectorDate of releaseDistributor

Film

VersionPlatform

Computerprogram

TitlePublisher

Published item

TitleMedium

Recorded item

SWEN 5231 FORMAL METHODS Slide 18

SWEN 5231 FORMAL METHODS Slide 19

User class hierarchy

NameAddressPhoneRegistration #

Library user

RegisterDe-register

Affiliation

Reader

Items on loanMax. loans

Borrower

DepartmentDepartment phone

Staff

Major subjectHome address

Student

SWEN 5231 FORMAL METHODS Slide 19

SWEN 5231 FORMAL METHODS Slide 20

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 complex

SWEN 5231 FORMAL METHODS Slide 21

Multiple inheritance

SWEN 5231 FORMAL METHODS Slide 21

# Tapes

Talking book

AuthorEditionPublication dateISBN

Book

SpeakerDurationRecording date

Voice recording

SWEN 5231 FORMAL METHODS Slide 22

Object aggregation

Aggregation model shows how classes which are collections are composed of other classes

Similar to the part-of relationship in semantic data models

SWEN 5231 FORMAL METHODS Slide 23

Object aggregation

Videotape

Tape ids.

Lecturenotes

Text

OHP slides

Slides

Assignment

Credits

Solutions

Text

Problems

#Problems#Text

TitleNumberYearInstructor

Course

SWEN 5231 FORMAL METHODS Slide 24

Service-usage models

These models show how services provided by one object are used by other objects

Must be used sparingly as, obviously, some objects provide common services which are used by many other objects in the system

SWEN 5231 FORMAL METHODS Slide 25

Service usageIssueReturn

Libraryuser

Libraryitem

AcquireCatalogueDispose

Librarystaff

RegisterDe-register

SWEN 5231 FORMAL METHODS Slide 26

Data dictionaries

A data dictionary is a list of names and associated descriptions of entities used in the system

It represents a shared repository of system information

It serves as• A mechanism for name management. As a system model may

be developed by different people, there is potential for name clashes

• A link from analysis to design and implementation

SWEN 5231 FORMAL METHODS Slide 27

Data dictionary model

SWEN 5231 FORMAL METHODS Slide 27

status

name

Entry

usedby

Entry

date

desc.

N

1

Entry

uses

N

1

Entry

includes

N

1

defines

Datadictionary

type

N

1

name

SWEN 5231 FORMAL METHODS Slide 28

Data dictionary entries

All names used in the system model, design and implementation should be entered in the data dictionary

Support software should be used to create, maintain and query the dictionary

The data dictionary may be integrated with CASE tools so that its construction and maintenance may be partially automated

SWEN 5231 FORMAL METHODS Slide 29

Data dictionary entriesName Description Type Date

has_labels1:N relation between entities of typeNode or Link and entities of typeLabel.

Relation 5.10.93

LabelHolds structured or unstructuredinformation about nodes or links. Labels can be text or can be an icon.

Entity 8.12.93

LinkRepresents a relation between designentities represented as nodes. Linksare typed and may be named.

Relation 8.12.93

name (label)Each label has a name whichidentifies the type of label. The namemust be unique within the set oflabel types used in a design.

Attribute 8.12.93

name (node)Each node has a name which must beunique within a design. The namemaybe up to 64 characters long.

Attribute 15.11.93

SWEN 5231 FORMAL METHODS Slide 30

Key points

A model is an abstract system view. Different types of model provide different system information

Data-flow diagrams may be used to model system data-processing

Semantic data models are used to show the logical structure of the data processed by the system

SWEN 5231 FORMAL METHODS Slide 31

Key points

Object models describe logical system entities, their classification and aggregation

Object models are valuable for modeling system interfaces in an abstract way

Data dictionaries are used to maintain information about system entities throughout the lifetime of a project