You are on page 1of 40

Software Engineering for Real-Time

Systems
1 2005 IAS, Universitt Stuttgart
SER
Objectives of chapter 6
To explain what system models are and what kinds of systems models
exist
To describe behavioural modelling, data modelling and object modelling
To introduce some of the notations used in the Unified Modeling Language
(UML)
To show how analysis methods link up different modelling approaches to
an analysis process
Software Engineering for Real-Time
Systems
2 2005 IAS, Universitt Stuttgart
SER
6 System Analysis
6.1 Basic Principles of System Analysis
6.2 System Models
6.3 Analysis Methods
6.4 Summary
6.1 Basic Principles of System Analysis
3 2005 IAS, Universitt Stuttgart
SER
Aims of system analysis
starting point: requirements specification
(user requirements specification / system requirements specification)
demarcation of the system from its environment
detailed understanding of the system functionality
creation of a system description based on a system model or a set of
system models
analysis of system
requirements
precision of
requirements
specification
6.1 Basic Principles of System Analysis
4 2005 IAS, Universitt Stuttgart
SER
Overall view
Requirements
engineering
System
analysis
System and
software design
Implementation
Test
Requirements
specification
Problem
Xxx
Legend:
Development phase
Development result Yyy
System
model
Design
specification
Realized
system
Test
documentation
Maintenance,
enhancements
System
ready for use
6.1 Basic Principles of System Analysis
5 2005 IAS, Universitt Stuttgart
SER
Automation of a mixer for chemical materials
In a chemical production process two liquid substances have to be mixed.
A homogenous emulsion can be formed only, if the mixture ratio is exactly
kept. In addition the temperature has to be maintained constant during the
whole process and it must not be influenced by the incoming substances.
The automation system MIXER CONTROL is required to be suitable for any
combinations of substances.
By a terminal the user has to be enabled to adjust following parameters:
name of product resulting from mixing process
amount of product to be produced
All possible substance combinations have to be stored in the mixer control.
Example: Requirements specification (1)
6.1 Basic Principles of System Analysis
6 2005 IAS, Universitt Stuttgart
SER
... and discover: questions over questions
What does the mixing facility look like ?
Is it already equipped with thermal sensors ?
Which are the possible temperature ranges ?
What happens if one of the substances is running out ?
Which kind of terminal is going to be used ?
What kind of mixing products exist ?
How is the incoming substance quantity measured ?
What kind of computer is going to be used ?
How can new substances be filled in ?
Are the substances injurious to health ?
Is it dangerous if the mixture ratio is incorrect ?
... and, and, and ...
Example (2): We are starting to analyze ...
6.1 Basic Principles of System Analysis
7 2005 IAS, Universitt Stuttgart
SER
Major Problems in System Analysis
knowledge about area of application
communication with non-experts in terms of electronic data processing
frequent changes of requirements due to new insights
detection of similar aspects
division of tasks
System Analyst
= excellent, experienced
developers
customer/user, who determines what has to be done
developer carrying out the realization
mediates between
6.1 Basic Principles of System Analysis
8 2005 IAS, Universitt Stuttgart
SER
Definition in terms of Software:
System analysis is the investigation of an area of application with the aim to
describe the observable behavior, to verbalize the desired behavior in a
consistent, complete and realizable way and to include functional features as
well as quantifiable performance parameters.
Definition: System Analysis
General Definition:
Analysis is the systematic investigation of a phenomenon or object in all its
details and aspects.
[Langenscheidt Fremdwrterbuch]
Fundamental analysis steps
To demarcate the system
To investigate the system
To describe the system
using system models
following analysis methods
6.1 Basic Principles of System Analysis
9 2005 IAS, Universitt Stuttgart
SER
especially in
huge projects
Analysis tasks can be carried out on several levels
requirements specification
system analysis
system design
sw architecture analysis
sw architecture design
sw component analysis
sw component design
system
level
software architecture
level
software component
level
system model
system structure
architecture specification
component
specification
architecture model
component
model
6.1 Basic Principles of System Analysis
10 2005 IAS, Universitt Stuttgart
SER
System Models
Define the target of development
Establish a reference for the evaluation of the development result
system analysis
(target definition)
design / implementation
(product realization)
system test
(result / target
comparison)
target
result
result = target
system model
product
6.1 Basic Principles of System Analysis
11 2005 IAS, Universitt Stuttgart
SER
Demands on the system model
In short
The desired value has to be described sufficiently
for the development
for the (later) system test
where sufficiently means:
a comparison desired value resulting value must be achievable
the case desired value can not be reached must be avoided.
concrete and complete
consistent and unambiguous
minimal
easy to read and understand
easy to modify
6.1 Basic Principles of System Analysis
12 2005 IAS, Universitt Stuttgart
SER
Different perspectives in system analysis ...
External perspective
showing the systems context or environment
Behavioral perspective
showing the data or event processing of the system
Structural perspective
showing the system or data architecture
6.1 Basic Principles of System Analysis
13 2005 IAS, Universitt Stuttgart
SER
... make that there are different system model types
Data processing models
describing how the data is processed at different stages
Composition models
describing how entities are composed of other entities
Architectural models
describing principal sub-systems
Classification models
object class and inheritance diagrams describing how entities have
common characteristics
Stimulus/response models
state transition diagrams describing the systems reaction to events
6.1 Basic Principles of System Analysis
14 2005 IAS, Universitt Stuttgart
SER
Analysis methods
Analysis methods incorporate system modelling as an inherent part of the
method
Analysis methods define a set of system models, a process for deriving
these system models and rules and guidelines that should apply to the
system models
CASE tools support system modelling according to an analysis method
Common weaknesses of analysis methods:
They do not model non-functional system requirements
They do not usually include information about whether a method is
appropriate for a given problem
The may produce too much documentation
The system models are sometimes too detailed and difficult for users to
understand
Software Engineering for Real-Time
Systems
15 2005 IAS, Universitt Stuttgart
SER
6 System Analysis
6.1 Basic Principles of System Analysis
6.2 System Models
6.3 Analysis Methods
6.4 Summary
6.2 System Models
16 2005 IAS, Universitt Stuttgart
SER
Architectural models
Context models
Function tree
Example: Context model of an answering machine
Describe the environment of a system and its boundaries
Demarcate internal parts and components from external elements and
objects
Social and organisational concerns may affect the decision on where to
position system boundaries
User
Answering
Machine
Caller
Legend:
Terminator in
system environment
Association
System or process
Context models
6.2 System Models
17 2005 IAS, Universitt Stuttgart
SER
Disadvantages
Relationships with other systems cannot be detailed
No information about data sources and sinks, shared data, physical
location of the systems and the kind of their interconnection
Context models are normally supplemented by other models (e.g. data
flow models, data or object models)
Used for illustrating any kinds of hierarchy, e.g. consists-of hierarchies or
calling hierarchies
Allows to structure a systems entities according to their abstraction level
and common contexts
Function Tree
Answering machine
Microphone Message recorder Speaker
Example: function tree of the answering machine hardware
Announcement recorder
6.2 System Models
18 2005 IAS, Universitt Stuttgart
SER
Behavioural models
Behavioural models are used to describe the overall behavior of a system
Two types of behavioral model are shown here
Data-flow models that show how data is processed as it moves
through the system
State machine models that show the systems response to events
Depending on the kind of system, one or both of these models are
required for a description of the systems behavior
Examples
Business systems
primarily driven by data, very little event processing
data flow model sufficient
Real-time systems
primarily driven by external events, minimal data processing
state machine model more appropriate
6.2 System Models
19 2005 IAS, Universitt Stuttgart
SER
Data-flow models
Data flow diagrams model the system from a functional perspective
They are used to model the systems data processing including
functional processing
data stores
data movements between functions and stores
Intrinsic part of many analysis methods
Simple and intuitive notation that customers can understand
Record
message
Query
messages
Example: Data flow diagram of answering machine message processing
Messages
Legend:
Process
Data flow
Name
Data store Name
Name
New message
PIN code
Recorded
message
6.2 System Models
20 2005 IAS, Universitt Stuttgart
SER
State machine models
State charts
Model the behavior of the system in response to external and internal
events
They show the systems responses to stimuli so are often used for
modelling real-time systems
Show system states as nodes and events as arcs between these nodes.
When an event occurs, the system moves from one state to another.
Statecharts are an integral part of the UML
Reply &
record
Example: Statechart of answering machine operational modes
Legend:
Initial state
State
Name
Transition
Event
Reply
only
Mode button
Mode button
Power on
6.2 System Models
21 2005 IAS, Universitt Stuttgart
SER
C1 Operational mode (RplRec, RplOly)
C2 Mode button
A1 Confirm by playing announcement of
reply and record mode once
R1 R2
RplRec
1
X
RplOly
1
X
Decision tables
Allow a rule-based behavior modeling of event-driven systems
Show system functions as rules, each of them correlating a set of conditions
with a set of resulting actions
Conditions express the current system state or an internal or external event.
Actions are operations being executed or the following system state.
Decision tables are alternative representations of statecharts
They can be verified for completeness, consistence and unambiguousness
Example: Decision table for answering machine operational modes
A2 Confirm by playing announcement of
reply only mode once
R3
0
Dont care
Rules
Conditions
("if ... ")
Actions
(then ... ")
6.2 System Models
22 2005 IAS, Universitt Stuttgart
SER
Semantic data models
Used to describe the logical structure of data processed by the system
Sets out the entities in the system, their relationships and attributes
Entities can be thought of as simplified object classes without operations
Widely used in database design, in particular relational databases
Entity-relationship diagrams
Data dictionaries
Entity-relationship diagrams
Example: Entity-relationship diagram of answering machine data
Legend:
Entity
Attribute
Name
Association with
cardinalities
picks
up
Message
Text
Date & Time
Answering
machine
Operational
mode
1 n
Name
n m
Name
6.2 System Models
23 2005 IAS, Universitt Stuttgart
SER
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 knowledge linking analysis, design and implementation
Different variants exist: informal (e.g. descriptive text) or formal (e.g.
Backus Naur Form) data dictionaries
Many CASE workbenches support data dictionaries
Data Dictionaries
Example: Informal data dictionary of answering machine data
Name Description Type
Message Recorded information about a phone call Entity
Text
Date & Time
...
Spoken text left by the caller
Moment when the phone call has taken place
Attribute
Attribute
... ...
6.2 System Models
24 2005 IAS, Universitt Stuttgart
SER
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
Interaction 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
The pros and cons
6.2 System Models
25 2005 IAS, Universitt Stuttgart
SER
Devised by the developers of widely used object-oriented analysis and
design methods
Has become an effective standard for object-oriented modelling
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 generalization and is shown upwards
rather than downwards in a hierarchy
Unified Modeling Language (UML)
Class name
Attrtibutes
Operations
Object class: Association:
1 Abc object has n Xyz objects
Abc Xyz
1 *
Generalization:
Abc
Xyz
Xyz objects
are
Abc objects
6.2 System Models
26 2005 IAS, Universitt Stuttgart
SER
Aggregation model shows how classes which are collections are
composed of other classes
Similar to the part-of relationship in semantic data models
Example: Part of aggregation model for the answering machine
Object aggregation models
Answering machine
#operationalMode: integer
+recordAnnouncement()
+playAnnouncement()
+recordMessage()
+playMessages()
1
*
Message
+text: AudioStream
+dateAndTime: Date
1
Announcement
+text: AudioStream
2
6.2 System Models
27 2005 IAS, Universitt Stuttgart
SER
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
Inheritance models
Example: Part of a class hierarchy for the answering machine
Hardware device
#status: integer
+doSelfTest()
Microphone
-amplification: integer
+record() : AudioStream
Speaker
-volume: integer
+play(AudioStream anAudioStream)
6.2 System Models
28 2005 IAS, Universitt Stuttgart
SER
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 the UML are used to
model interaction between objects
Object interaction models
Example: Sequence diagram for changing the answering machines
operational mode
aAnnouncementRecorder aSpeaker anAnsweringMachine aModeButton
onPress()
playAnnouncement(currentMode)
changeOperationalMode()
play(announcement)
o.k.
o.k.
Object
Message
with
arguments
Object life line
Self delegation
Activation
Software Engineering for Real-Time
Systems
29 2005 IAS, Universitt Stuttgart
SER
6 System Analysis
6.1 Basic Principles of System Analysis
6.2 System Models
6.3 Analysis Methods
6.4 Summary
6.3 Analysis Methods
30 2005 IAS, Universitt Stuttgart
SER
Analysis methods
Major analysis methods
Structured analysis (SA)
Object-oriented analysis (OOA)
Provide a guideline defining an overall analysis process
embed several analysis models in order to form a complete system
description
introduce additional formal rules so that
the system description can be validated for completeness, clearness
and consistency
the analysis process may be supported be CASE tools
6.3 Analysis Methods
31 2005 IAS, Universitt Stuttgart
SER
Structured analysis (SA)
Context
diagram
Data flow
diagram
Mini spec
Data
dictionary
Structured
Analysis (SA)
System demarcation System behavior System structure
6.3 Analysis Methods
32 2005 IAS, Universitt Stuttgart
SER
Example: Context diagram for answering machine
User
Caller
New message
Recorded announcement
PIN code
Error message
Recorded message
New announcement
.0
Answering machine
Context Diagram (CD)
6.3 Analysis Methods
33 2005 IAS, Universitt Stuttgart
SER
Example: Level 0 data flow diagram for answering machine
Messages
Announcement
New message
Recorded annoncement
New Announcement
PIN code
Error message
Recorded message
.2
Record messge
.4
Query messages
.3
Record annoncement
.1
Play announcement
Data Flow Diagram (DFD) 0
6.3 Analysis Methods
34 2005 IAS, Universitt Stuttgart
SER
Example: Data dictionary and mini spec for answering machine
New message = audio stream
Messages = {audio stream + Date & time}
Recorded message = audio stream + Date & time
Date & time = year +month + day + hour + minute
New announcement = audio stream
Recorded announcement = audio stream
Error message = audio stream
PIN code = 4{Digit}4
Digit = [0|1|2|3|4|5|6|7|8|9]
Mini spec for process 0.4 Query Messages
IF RemoteQuery THEN
PinCode := AskForPinCode();
ENDIF
IF LocalQuery OR (RemoteQuery AND IsCorrect(PinCode) THEN
FOR i = 0 TO NumberOfMessages - 1
SpeakerPlay(Messages[i]);
ENDFOR
ELSE
SpeakerPlay(ErrorMessage)
ENDIF
Data Dictionary (DD)
Pseudo
Code
Backus-Naur Form (BNF)
expressions
6.3 Analysis Methods
35 2005 IAS, Universitt Stuttgart
SER
Object-oriented analysis (OOA)
Use case
diagram
Class
diagram
Object-Oriented
Analysis (OOA)
System
demarcation
System
behavior
System
structure
State
diagram
Sequence
diagram
Collaboration
diagram
6.3 Analysis Methods
36 2005 IAS, Universitt Stuttgart
SER
Example: Use case diagram for answering machine
Answering machine
Record announcement
Query recorded
messages
Change operational mode
Hear annoncement
(and leave message)
Record
audio stream
Play
audio stream
extends

in
c
lu
d
e
s

User
Caller

in
c
lu
d
e
s

includes

in
c
lu
d
e
s

6.3 Analysis Methods


37 2005 IAS, Universitt Stuttgart
SER
Example: Class diagram for answering machine
Hardware device
#status: integer
+doSelfTest()
1
Microphone
-amplification: integer
+record() : AudioStream
*
Message
+text: AudioStream
+dateAndTime: Date
Announcement
+text: AudioStream
2
Speaker
-volume: integer
+play(AudioStream anAudioStream)
1
MessageRecorder
-messageCount: integer
+recordMessage()
+playMessages()
1
1
AnnouncementRecorder
+recordAnnouncement()
+playAnnouncement(integer operationalMode)
1
1
Answering machine
#operationalMode: integer
+recordAnnouncement()
+playAnnouncement()
+recordMessage()
+playMessages()
1
1
1
1
6.3 Analysis Methods
38 2005 IAS, Universitt Stuttgart
SER
Example: Sequence diagrams for answering machine
aAnnouncementRecorder aSpeaker anAnsweringMachine aModeButton
onPress()
playAnnouncement(currentMode)
changeOperationalMode()
play(announcement)
Use case 4: Change operational mode
Use case 3: Query recorded messages
aMessageRecorder aSpeaker anAnsweringMachine aPlayButton
onPress()
[operational mode = reply and record]
playMessages()
*[for all messages]
play(message)
Conditional
message
Iterative
message
Software Engineering for Real-Time
Systems
39 2005 IAS, Universitt Stuttgart
SER
6 System Analysis
6.1 Basic Principles of System Analysis
6.2 System Models
6.3 Analysis Methods
6.4 Summary
6.4 Summary
40 2005 IAS, Universitt Stuttgart
SER
Summary
System analysis means to demarcate the system from its environment, to
develop a detailed understanding of the system and to create a system
description
System analysis is primarily based on modelling. A model is an abstract
system view. Complementary types of model provide different system
information:
Context models show the position of a system in its environment with
other systems and processes
Data flow models and state machine models may be used to model
the behavior of a system
Semantic data models describe the logical structure of data which is
contained by, imported to or exported by the system
Object models describe logical system entities, their classification and
aggregation
Analysis methods integrate various system modeling approaches to an
overall analysis process

You might also like