Download as pdf or txt
Download as pdf or txt
You are on page 1of 47

Software Engineering

INT2208E
Lecture 05: System Modeling

1
System modeling

• System modeling is the process of developing abstract models of a


system, with each model presenting a different view or perspective of that
system
• Graphical notation, UML

• System modeling helps the analyst to understand the functionality of the


system and models are used to communicate with customers
• clarify what the existing system does and can be used as a basis for discussing its strengths and
weaknesses

2
System perspectives

• External perspective, where you model the context or environment of the


system.
• Interaction perspective, where you model the interactions between a
system and its environment or between its components.
• Structural perspective, where you model the organization of a system, or
the structure of the data processed by the system.
• Behavior perspective, where you model the dynamic behavior of the
system and how it responds to events.

3
External perspective
Box

• Context models are used to


illustrate the operational context of
a system - they show what lies
outside the system boundaries
• Process models reveal how the
system being developed is used in
broader business processes (UML Connector
activity diagrams) Labels

4
Interaction perspective

• Interaction models: user interaction and system-to-system interaction


• User interaction: it helps to identify user requirements.
• System-to-system interaction: the communication problems that may arise

6
Structural perspective

• Structural models display a


system's organization in terms of
the components that make up that
system and their relationships
• Structural models: static or
dynamic
• Class diagrams are used when
developing an object-oriented
system model to show the classes
in a system and the associations
between these classes
7
Behavioral perspective
Blood sugar Get sensor Sensor Compute Blood sugar
sensor value data sugar level level

Calculate
insulin

• Behavioral models are models of Calculate


delivery

the dynamic behavior of a system Insulin


pump
Control
pump
Pump control
commands
pump
commands
Insulin
requirement

as it is executing Purchase officer Supplier

• They show what happens or what is «datastore»


supposed to happen when a system :Order Budget
Orders

responds to a stimulus from its environment Fillin ( )


Validate ( )

• Behavioral models: Data-driven [validation ok]

and Event-driven Update (amount)

Save ( )
Send ( )

8
State diagram of a microwave oven
Full
power Full power
do: set power
= 600

Timer
Waiting
Number
do: display Operation
Full Set time
time
power do: get number do: operate
exit: set time oven
Half
Half power
Door
power Cancel
Timer closed
Start
Door
open Door
Half power Enabled Waiting
open
do: set power Door do: display do: display
= 300 closed 'Ready' time

Disabled
do: display
'Waiting'

30/10/2014 Chapter 5 System Modeling 9


Model-driven engineering

10
Key points

• A model is an abstract view of a system that ignores system details.


Complementary system models can be developed to show the system’s context,
interactions, structure and behavior.
• Context models show how a system that is being modeled is positioned in an
environment with other systems and processes.
• Use case diagrams and sequence diagrams are used to describe the interactions
between users and systems in the system being designed. Use cases describe
interactions between a system and external actors; sequence diagrams add more
information to these by showing interactions between system objects.
• Structural models show the organization and architecture of a system. Class
diagrams are used to define the static structure of classes in a system and their
associations.

12
Key points

• Behavioral models are used to describe the dynamic behavior of an


executing system. This behavior can be modeled from the perspective of
the data processed by the system, or by the events that stimulate
responses from a system.
• Activity diagrams may be used to model the processing of data, where
each activity represents one process step.
• State diagrams are used to model a system’s behavior in response to
internal or external events.
• Model-driven engineering is an approach to software development in which
a system is represented as a set of models that can be automatically
transformed to executable code.

13
Software Engineering

INT2208E
Lecture 06: Architectural Design

14
Today…

• Architectural design decisions


• Architectural views
• Architectural patterns
• Application architectures

15
Architectural design

• Architectural design is concerned


with understanding how a software
system should be organized and
designing its overall structure
• Architectural design is the critical link
between design and requirements
engineering, as it identifies the main
structural components in a system
and the relationships between them
• The output of the architectural design
process is an architectural model

16
Autonomous Driving Car

18
Autonomous Driving Car

19
Levels of Autonomous Driving
How ADV works?
Mapping out every
intersection, sign,
and signal
Keeping an eye
on everything, all
at once
Predicting things
before they
happen
Planning for the
safest outcome
Seeing the road in multiple dimensions
Seeing the road in multiple dimensions
Lidar
Camera
Rada
Apollo - Architecture

32
“PasteBin” Service

• User enters a block of text and gets a randomly generated URL


• Expiration: Default – not expire; Optionally set timed expiration

• User enters a paste’s URL and views the contents


• User is anonymous
• Service tracks analytics of pages: Monthly visit stats
• Service deletes expired pastes
• Service has high availability

33
Facts

• Traffic is not evenly distributed


• Following a short link should be fast
• Pastes are text only
• Page view analytics do not need to be real-time
• 10 million users
• 10 million paste writes per month
• 100 million paste reads per month
• 10:1 read to write ratio
35
Give your architectural design in 20’

• Simple, informal block diagrams showing entities and relationships


• Informal explanations about the entities and their relationships

36
Analysis

• Size per paste


• 1 KB content per paste
• shortlink - 7 bytes
• expiration_length_in_minutes - 4 bytes
• created_at - 5 bytes
• paste_path - 255 bytes
• total = ~1.27 KB

• 1.27 KB * 10 million pastes per month = 12.7 GB content per month


• ~450 GB of new paste content in 3 years
• 360 million shortlinks in 3 years
• Assume most are new pastes instead of updates to existing ones

• 4 paste writes per second on average


• 40 read requests per second on average

37
Bottlenecks?
Architectural design decisions
Is there a generic application
How will the system be
architecture that can act as a What architectural patterns or
distributed across hardware
template for the system that is styles might be used?
cores or processors?
being designed?

What will be the fundamental What strategy will be used to


approach used to structure
the system? ? control the operation of the
components in the system?

How will the structural What architectural organization How should the architecture
components in the system be is best for delivering the of the system be
decomposed into non-functional requirements documented?
sub-components? of the system?
40
Architecture and system characteristics

• Performance
• Localise critical operations and minimise communications. Use large rather than fine-grain
components.

• Security
• Use a layered architecture with critical assets in the inner layers.

• Safety
• Localise safety-critical features in a small number of sub-systems.

• Availability
• Include redundant components and mechanisms for fault tolerance.

• Maintainability
• Use fine-grain, replaceable components.

41
Architectural views

42
Architectural patterns

43
The organization of the Model-View-Controller

Controller View View


selection
Maps user actions Renders model
to model updates Requests model updates
Selects view Sends user events to
User events controller

Change
notification
State State query
change
Model

Encapsulates application
state
Notifies view of state
changes

44
A generic layered architecture

User interface

User interface management


Authentication and authorization

Core business logic/application functionality


System utilities

System support (OS, database etc.)

45
A repository architecture for an IDE

UML Code
editors generators

Java
editor
Design Project
translator repository
Python
editor

Design Report
analyzer generator

47
Which one should be used?

48
Use of application architectures

• As a starting point for architectural design.


• As a design checklist.
• As a way of organising the work of the development team.
• As a means of assessing components for reuse.
• As a vocabulary for talking about application types.

49
Key points

• A software architecture is a description of how a software system is


organized.
• Architectural design decisions include decisions on the type of application,
the distribution of the system, the architectural styles to be used.
• Architectures may be documented from several different perspectives or
views such as a conceptual view, a logical view, a process view, and a
development view.
• Architectural patterns are a means of reusing knowledge about generic
system architectures. They describe the architecture, explain when it may
be used and describe its advantages and disadvantages.

50
Key points

• Models of application systems architectures help us understand and


compare applications, validate application system designs and assess
large-scale components for reuse.
• Transaction processing systems are interactive systems that allow
information in a database to be remotely accessed and modified by a
number of users.
• Language processing systems are used to translate texts from one
language into another and to carry out the instructions specified in the input
language. They include a translator and an abstract machine that executes
the generated language.

51
Next class

• Design & Implementation


• Discussion: UI/UX Design
• Discussion: Clean code

52

You might also like