Chapter 1

advertisement
Chapter 1 (Part 2)
Introduction to Requirements
Modeling
Winter 2012
SEG2106 - Chapter 1
1
What is a System?
• A system is part of real world that a person or
group of persons during some time interval and for
some purpose choose to regard as a whole,
consisting of interrelated components, each
component characterized by properties that are
selected as being relevant to the purpose.
• A system is a purposeful collection of interrelated
components that work together to achieve some
objective.
[Braek]
Winter 2012
SEG2106 - Chapter 1
2
What is a System (2)
• A system is part of the real world.
• What constitutes a system is a matter of
definition.
• Each component of a system may also be
regarded as a system.
• A system is not just any unordered
collection of components.
• A system has purpose.
Winter 2012
SEG2106 - Chapter 1
3
System Hierarchy
Town
Street
Building
Winter 2012
Heating
system
Power
system
Water
system
Security
system
Lighting
system
Waste
system
SEG2106 - Chapter 1
4
A Simple Intruder Alarm System
Door
sensors
Movement
sensors
Alarm
contr oller
Siren
Winter 2012
Voice
synthesizer
SEG2106 - Chapter 1
Telephone
caller
External
control centre
5
System Description
• Two purposes
– To describe the functional behavior so that it
can be fully understood
– To describe the realization so that the system
may be produced
• Two aspects
– (static) structure
– (dynamic) behavior
Winter 2012
SEG2106 - Chapter 1
6
Behavior
• The behavior of a system is the development of
states and state transitions generated by actions of
the system during the time interval in which it is
studied.
• Behavior is a dynamic development over time.
• Actually occurring in real world.
• Approximation: behavior consists of actions that
change state (value) of variables.
Winter 2012
SEG2106 - Chapter 1
7
Structure
• The structure of a system is the aspects of
the system which stay invariant during the
time interval in which it is studied.
• Structure is the way things hold together for
some time.
Winter 2012
SEG2106 - Chapter 1
8
Techniques to Manage
Complexity
Abstraction:
• To ignore some aspects of a phenomenon in order to
describe (and understand) others more clearly.
• Opposite of concrete or physical.
• The abstractions should be clear and precise, lead to
efficient implementation, and support the
continuing development and reuse.
Technique
Structure
Abstraction
#
Aggregation and partition
#
Projection
#
#
Generalization, specialization
Winter 2012
Behavior
#
SEG2106 - Chapter 1
#
9
Aggregation and Partitioning
• All non-trivial systems are composed from
components.
• The process of lumping components
together to form a whole is called
aggregation.
• The opposite process of decomposing a
whole into parts is called partitioning.
Winter 2012
SEG2106 - Chapter 1
10
Projection
• In projections we look at the system from
different angles.
• A projection is a description of a system as
it is observed at subset of its interfaces.
• Only the observable interfaces are visible,
while the others are hidden.
Winter 2012
SEG2106 - Chapter 1
11
Generalization and Specialization
• In the real world there are huge amounts of similar
subjects.
• Rather than describing and understanding all
individuals in full detail, we may describe and
understand them in terms of similarity.
• Types are conceptual entities that we use to
structure our descriptions and thoughts.
– Types are called “Classes “ in UML
Winter 2012
SEG2106 - Chapter 1
12
A Generalization Hierarchy
Employee
Ma nager
Programmer
budgetsControlled
dateAppointed
project
progLanguage
Project
Ma nag er
projects
Winter 2012
De pt.
Ma nager
dept
SEG2106 - Chapter 1
Strategic
Ma nag er
responsibilities
13
A system specification includes
assumptions and guarantees
In general, a system specification has the following form: If
certain assumptions about the environment are satisfied,
then the system will provide certain guarantees to the
environment
Example of a sorting program – Specification A: If the input
list of integer numbers has less than 1000 entries, then the
output list will contain the same integer numbers in
ascending order, however, the list may be shorter if some
number occurred several times in the input list. – Note: no
guarantee is given for the case that the input list contains
1000 entries or more.
Winter 2012
SEG2106 - Chapter 1
14
Possibilities of replacement and
reuse
Theorem for component-based development:
Given a specification S = AS  GS (assumption implies
guarantee) for a component within a given system
structure and an implementation satisfying the
specification I = AI  GI . The implementation
can be used for realizing this component iff AI is
weaker than AS and GI is stronger than GS .
One sometimes says that I “conforms“ to S.
Winter 2012
SEG2106 - Chapter 1
15
Example
Given implementation of a sorting program which satisfies the following
Specification B: If the input list of integer numbers has less than 2000
entries, then the output list will contain the same integer numbers in
ascending order, each number only once, even if the input list contains
some number multiple times.
Assumption (B): there is an input list of less than 2000 integers.
Guarantee (B): the output list contains the same integer numbers in
ascending order, each number only once.
Notes:
• Assumption (B) of less than 2000 is weaker than less than the
assumption (less than 1000) of Specification A.
• Guarantee (B) of having each number only once is stronger than the
guarantee of Specification A.
• The guarantee of Specification A is non-deterministic: it allows for
different multiplicities of numbers in the output list.
Winter 2012
SEG2106 - Chapter 1
16
Different kinds of specialization
• The specification I of an implementation that conforms to a
given component specification S is a (conforming)
specialization
• If an OO class I inherits from a class S, this means that all
methods provided by S (guarantees) are also provided by I,
that is, the guarantees of I are stronger than the guarantees
of S. This is a special kind of conforming specialization.
• An implemention of the sorting function that is specialized
(and optimized) for numbers between 0 and 255 can be
called a “specialization” of the implementation considered
above. However, it is not a conforming specification,
because it has a stronger assumption (namely, the the
sorted values are smaller than 255).
Winter 2012
SEG2106 - Chapter 1
17
Behavior Description: the Problem
• The quality of a real-time system is determined to
a very large extent by its behavior.
• Behavior is the most difficult system aspect to
describe, due to its dynamic and transient nature.
• How can we represent a dynamic and possibly
infinite behavior in a static and finite way?
See next chapter of this course.
Winter 2012
SEG2106 - Chapter 1
18
Download