CS 425/625 Software Engineering System Models

29
1 / 29 CS 425/625 Software Engineering System Models Based on Chapter 7 of the textbook [Somm00] Ian Sommerville, Software Engineering, 6 th Ed., Addison-Wesley, 2000 and on Ch7 PowerPoint presentation available at the book’s web-site: www.comp.lancs.ac.uk/computing/resources/IanS/SE6/Slides/ index.html September 29, 2003

description

CS 425/625 Software Engineering System Models. Based on Chapter 7 of the textbook [Somm00] Ian Sommerville, Software Engineering, 6 th Ed., Addison-Wesley, 2000 and on Ch7 PowerPoint presentation available at the book’s web-site: - PowerPoint PPT Presentation

Transcript of CS 425/625 Software Engineering System Models

Page 1: CS 425/625 Software Engineering System Models

1 / 29

CS 425/625 Software Engineering

System Models

Based on Chapter 7 of the textbook [Somm00] Ian Sommerville,Software Engineering, 6th Ed., Addison-Wesley, 2000 and on Ch7 PowerPoint presentation available at the book’s web-site:www.comp.lancs.ac.uk/computing/resources/IanS/SE6/Slides/index.html

September 29, 2003

Page 2: CS 425/625 Software Engineering System Models

2 / 29

Outline

System Models Contextual Models Behavioral Models Data Models Object Models

Page 3: CS 425/625 Software Engineering System Models

3 / 29

Introduction.

System models are used to specify the system to be built in a more detailed way

Typically, system models are graphical descriptions of the system, its services and its constraints

Various perspectives for system modeling: Context Behavior Structure

Page 4: CS 425/625 Software Engineering System Models

4 / 29

.Introduction.Introduction

The production of system models is usually guided by methods, e.g., SSA (Structured Systems Analysis), SADT (Structured Analysis and Design Technique), OMT (Object Modeling Technique), etc.

In practice, various models, not bound to methods, could be combined to describe the system and its requirements

Main types of system models: Data Processing Models Composition Models Architectural Models Classification Models Stimulus-Response Models

Page 5: CS 425/625 Software Engineering System Models

5 / 29

Context Models…

Contextual models show the system and its environment

Ideally, the boundaries between the system and its environment are identified clearly

Dependencies between the computer-based system and systems from the environment are highlighted

Page 6: CS 425/625 Software Engineering System Models

6 / 29

.Context Models..

Various models can be used for context modeling: Very simple, high level architectural models show

the system and its connections with environmental components

High level process models indicate main process activities

High-level data-flow diagrams depict data transformations and data transfers

Page 7: CS 425/625 Software Engineering System Models

7 / 29

..Context Models. Example of architectural model for system context specification: an

ATM system and its environment [Fig. 7.1, Somm00]

Auto-tellersystem

Securitysystem

Maintenancesystem

Accountdatabase

Usagedatabase

Branchaccounting

system

Branchcountersystem

Page 8: CS 425/625 Software Engineering System Models

8 / 29

…Context Models Example of process model for system context specification: an

equipment procurement system [Fig. 7.2, Somm00]

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 9: CS 425/625 Software Engineering System Models

9 / 29

Behavioral Models…….

Behavioral models specify the overall behavior of the system: Data-flow models (or data-flow diagrams, DFD) are

suitable for data-driven systems State machine models (or stimulus-response

models) are appropriate for event-driven systems

Page 10: CS 425/625 Software Engineering System Models

10 / 29

.Behavioral Models…...

Data-flow models show the system in terms of: Data stores

[graphical representation: rectangles] Data transformations (data processing operations)

[graphical representation: rounded rectangles] Data movements (data transfers)

[graphical representation: directed lines]

Page 11: CS 425/625 Software Engineering System Models

11 / 29

..Behavioral Models…..

State machine models describe system behavior using two main modeling elements: States

[represented using rounded rectangles] Transitions

[shown as directed links between states]

Page 12: CS 425/625 Software Engineering System Models

12 / 29

……Behavioral Models....Behavioral Models.... A DFD example: an order processing system [Fig. 7.3, Somm00]

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

Page 13: CS 425/625 Software Engineering System Models

13 / 29

…….Behavioral Models….Behavioral Models…

State machine diagrams depict the behavior of the system in terms of responses to events

Real-time systems are essentially event-driven systems The system is assumed to be in one of its possible

states at any given moment of time. A transition to another state is triggered by the occurrence of an event

David Harel’s statecharts are included in the UML (Unified Modeling Language); DFDs are not part of UML

Page 14: CS 425/625 Software Engineering System Models

14 / 29

…..Behavioral Models.. Example of state machine diagram: A microwave oven controller

[Fig. 7.5, Somm00]

Full 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 15: CS 425/625 Software Engineering System Models

15 / 29

…...Behavioral Models.

The statecharts notation used in UML allows: Specification of composite states (states that have

sub-states), thus supporting model decomposition Description of actions performed while in a state:

Entry actions State actions (activities) Exit actions

Description of transitions: Events that trigger the transition Conditions under which transitions occur Actions on transitions, if any

Page 16: CS 425/625 Software Engineering System Models

16 / 29

……....Behavioral Models....Behavioral Models Example of composite state: microwave oven [Fig. 7.7, Somm00]

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 17: CS 425/625 Software Engineering System Models

17 / 29

Semantic Data Models…

Data models describe the logical structure of data processed by the system

The Entity-Relationship-Attribute model, ERA (also known as Entity-Relationship model, ER) shows: Entities in the system Relationships between entities Attributes of entities and relationships Cardinality constraints (e.g., “one” or “many”)

Page 18: CS 425/625 Software Engineering System Models

18 / 29

.Semantic Data Models..

Data dictionaries are repositories of information pertaining to the elements of the system models. They are useful to manage the namespace of the system models as well as to supply a cross-reference tool for analysis, design, implementation, and evolution.

Page 19: CS 425/625 Software Engineering System Models

19 / 29

..Semantic Data Models.

Design

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

An ERA example: a software design description [Fig. 7.8, Somm00]

Page 20: CS 425/625 Software Engineering System Models

20 / 29

…Semantic Data Models Data dictionary: examples of data entries [Fig. 7.9, Somm00]

Page 21: CS 425/625 Software Engineering System Models

21 / 29

Object Models……..

Objected-oriented modeling is centered around the concepts of object and class

An object is an entity described in terms of attributes (data) and operations (functionality)

A class is a template for objects that have similar features (attributes and operations).

More exactly, the objects that belong to the same class have the same structure and behavior, e.g., davidsAlarmClock is an object (instantiation) of the class AlarmClock

Page 22: CS 425/625 Software Engineering System Models

22 / 29

.Object Models…….

The distinguishing principles of object-oriented (OO) technology are: Encapsulation Inheritance Polymorphism

Page 23: CS 425/625 Software Engineering System Models

23 / 29

..Object Models……

Objects provide more natural ways to model real-life entities

Both structure (class diagrams) and behavior (e.g., interaction diagrams and state diagrams) can be described

A class diagram shows: Classes Relationships between classes Constraints Annotations

Page 24: CS 425/625 Software Engineering System Models

24 / 29

…Object Models…..

The value of OO comes from: Greater modeling power Increased reusability and extensibility Improved control of complexity

Page 25: CS 425/625 Software Engineering System Models

25 / 29

…….Object Models…..Object Models…. Example of class hierarchy: a library system [Fig. 7.10, Somm00]

Catalogue 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 26: CS 425/625 Software Engineering System Models

26 / 29

…..Object Models… Another example of class hierarchy: Library users [Fig. 7.11, Somm00]

NameAddressPhoneRegistration #

Library user

Register ()De-register ()

Affiliation

Reader

Items on loanMax. loans

Borrower

DepartmentDepartment phone

Staff

Major subjectHome address

Student

Page 27: CS 425/625 Software Engineering System Models

27 / 29

……Object Models.. Example of multiple inheritance [Fig. 7.12, Somm00]

# Tapes

Talking book

AuthorEditionPublication dateISBN

Book

SpeakerDurationRecording date

Voice recording

Page 28: CS 425/625 Software Engineering System Models

28 / 29

…….Object Models. Example of class structure with aggregation [Fig. 7.13, Somm00]

Videotape

Tape ids.

Lecturenotes

Text

OHP slides

Slides

Assignment

Credits

Solutions

TextDiagrams

Exercises

#Problems Description

Course titleNumberYearInstructor

Study pack

Page 29: CS 425/625 Software Engineering System Models

29 / 29

……..Object Models Example of sequence diagram [Fig. 7.14, Somm00]

:Library User

Ecat:Catalog

Lookup

Issue

Display

:Library Item Lib1:NetServer

Issue licence

Accept licence

Compress

Deliver