Professional Documents
Culture Documents
Topics covered
◇Context models
System Modeling
◇Interaction models
◇Structural models
◇Behavioural models
◇Model-driven engineering
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 369 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 370
◇System modeling is the process of developing ◇ Models of the existing system are used during requirements
abstract models of a system, with each model engineering.
presenting a different view or perspective of that ▪ They help clarify what the existing system does and can be used as a
basis for discussing its strengths and weaknesses.
system. ▪ These then lead to requirements for the new system.
◇S y s t e m m o d e l i n g h a s n o w c o m e t o m e a n ◇ Models of the new system are used during requirements
representing a system using some kind of graphical engineering to help explain the proposed requirements to
other system stakeholders.
notation, which is now almost always based on ▪ Engineers use these models to discuss design proposals and to
notations in the Unified Modeling Language (UML). document the system for implementation.
◇System modelling helps the analyst to understand ◇ In a model-driven engineering process, it is possible to
generate a complete or partial system implementation from the
the functionality of the system and models are used system model.
to communicate with customers.
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 371 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 372
1
2/24/2023
◇ An external perspective, where you model the context or ◇ Activity diagrams, which show the activities involved in
environment of the system. a process or in data processing.
◇ An interaction perspective, where you model the ◇ Use case diagrams, which show the interactions between
interactions:
▪ between a system and its environment, or
a system and its environment.
▪ between the components of a system. ◇ Sequence diagrams, which show interactions between
◇A structural perspective, where you model the actors and the system and between system components.
organisation of a system or the structure of the data ◇ Class diagrams, which show the object classes in the
that is processed by the system. system and the associations between these classes.
◇ A behavioural perspective, where you model the
dynamic behaviour of the system and how it responds to ◇ State diagrams, which show how the system reacts to
events. internal and external events.
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 373 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 374
◇As a means of facilitating discussion about an ◇Context models are used to illustrate the
existing or proposed system operational context of a system - they
▪Incomplete and incorrect models are OK as their role show what lies outside the system
is to support discussion. boundaries.
◇As a way of documenting an existing system ◇Social and organisational concerns may
▪Models should be an accurate representation of the
affect the decision on where to position
system but need not be complete.
system boundaries.
◇As a detailed system description that can be
used to generate a system implementation ◇Architectural models show the system
▪Models have to be both correct and complete. and its relationship with other systems.
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 375 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 376
2
2/24/2023
Process perspective
Process perspective UML Activity Diagram Symbols
3
2/24/2023
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 381 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 382
◇Modeling user interaction is important as it helps to ◇Use cases were developed originally to support
identify user requirements. requirements elicitation and are now incorporated
◇Modeling system-to-system interaction highlights into the UML.
the communication problems that may arise. ◇Each use case represents a discrete (distinct) task
◇M o d e l i n g c o m p o n e n t i n t e r a c t i o n h e l p s u s that involves external interaction with a system.
understand if a proposed system structure is likely ◇Actors in a use case may be people or other
to deliver the required system performance and systems.
dependability. ◇Represented
▪Emergent properties… ▪diagramatically to provide an overview of the use case
◇Use case diagrams and sequence diagrams may and
be used for interaction modeling. ▪in a more detailed textual form.
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 383 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 384
4
2/24/2023
5
2/24/2023
source: www.sciencedirect.com
389 390
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract)
6
2/24/2023
Structural models
◇S t r u c t u r a l m o d e l s o f s o f t w a r e d i s p l a y t h e
Context models organisation of a system in terms of the
components that make up that system and their
Interaction models relationships.
◇Structural models may be
Structural models ▪static models, which show the structure of the system
design, or
▪dynamic models, which show the organisation of the
Behavioural models system when it is executing.
◇You create structural models of a system when you
Model-driven engineering are discussing and designing the system
© Ian Sommerville
architecture.
© Ian Sommerville 394
Software Engineering, 9th ed. Chapter 5 System Modelling (extract)
393 Software Engineering, 9th ed. Chapter 5 System Modelling (extract)
7
2/24/2023
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 397
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 398
Key points
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 399 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 400
8
2/24/2023
Generalisation Generalisation
◇ Generalisation is an everyday technique that we use to ◇ In modeling systems, it is often useful to examine the classes in a
system to see if there is scope for generalisation.
manage complexity. ▪ If changes are proposed, then you do not have to look at all classes in the
◇ Rather than learn the detailed characteristics of every system to see if they are affected by the change.
entity that we experience, we place these entities in more ◇ In object-oriented languages, such as Java, generalisation is
general classes (animals, cars, houses, etc.) and learn implemented using the class inheritance mechanisms built into
the characteristics of these classes. the language.
◇ In a generalisation, the attributes and operations associated with
◇ This allows us to infer that different members of these
higher-level classes are also associated with the lower-level
classes have some common characteristics e.g. moles classes.
and rats are rodents.
◇ The lower-level classes are subclasses and inherit the
attributes and operations from their superclasses.
▪ These lower-level classes then add more specific attributes and operations.
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 401 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 402
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 403 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 404
9
2/24/2023
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 405 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 406
◇ Behavioural models are models of the dynamic ◇Many business systems are data-processing
behaviour of a system as it is executing. systems that are primarily driven by data.
▪ They show what happens or what is supposed to happen when a
system responds to a stimulus from its environment.
▪They are controlled by the data input to the system,
with relatively little external event processing.
◇ You can think of these stimuli as being of two types:
▪ Data ◇Data-driven models show the sequence of
• Some data arrives that has to be processed by the system. actions involved in processing input data and
▪ Events generating an associated output.
• Some event happens that triggers system processing.
• Events may have associated data, although this is not always the ◇They are particularly useful during requirements
case.
analysis as they can be used to show end-to-
– Real-time systems are often event-driven, with minimal data
processing. end processing in a system.
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 407 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 408
10
2/24/2023
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 409 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 410
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 411 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 412
11
2/24/2023
State diagram / State Chart of a microwave oven States and stimuli for the microwave oven (a)
State Description
Waiting The oven is waiting for input. The display shows the current time.
Half power The oven power is set to 300 watts. The display shows ‘Half power’.
Full power The oven power is set to 600 watts. The display shows ‘Full power’.
Set time The cooking time is set to the user’s input value. The display shows
the cooking time selected and is updated as the time is set.
Disabled Oven operation is disabled for safety. Interior oven light is on. Display
shows ‘Not ready’.
Enabled Oven operation is enabled. Interior oven light is off. Display shows
‘Ready to cook’.
Operation Oven in operation. Interior oven light is on. Display shows the timer
countdown. On completion of cooking, the buzzer is sounded for five
seconds. Oven light is on. Display shows ‘Cooking complete’ while
buzzer is sounding.
‘Not ready’
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 413 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 414
States and stimuli for the microwave oven (b) Microwave oven operation
Stimulus Description
Half power The user has pressed the half-power button.
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 415 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 416
12
2/24/2023
◇ Model-driven engineering (MDE) is an approach to ◇ Model-driven engineering is still at a relatively early stage
software development where the principal outputs of the of development
development process are models rather than programs. ▪ it is unclear whether or not it will have a significant effect on
software engineering practice.
◇ The programs that execute on a hardware/software
◇ Pros
platform are then generated automatically from the
▪ Allows systems to be considered at higher levels of abstraction
models. ▪ Generating code automatically means that it is cheaper to adapt
◇ Proponents of MDE argue that this raises the level of systems to new platforms.
abstraction in software engineering ◇ Cons
▪ engineers no longer have to be concerned with programming ▪ Models for abstraction and not necessarily right for implementation.
language details or the specifics of execution platforms. ▪ Savings from generating code may be outweighed by the costs of
developing translators for new platforms.
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 417 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 418
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 419 420
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract)
13
2/24/2023
Types of Model Driven Development (MDD) Types of Model Driven Development (MDD)
System Models System Models
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 421 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 422
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 423 424
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract)
14
2/24/2023
A Computation Independent Model (activity diagram) for an ATM A Computation Independent Model (statechart diagram) for an ATM
425 426
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 427 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 428
15
2/24/2023
◇To create an executable subset of UML requires ◇ Behavioural models are used to describe the dynamic
behaviour of an executing system.
3 model types: ▪ This behaviour can be modeled from the perspective of the data
▪Domain models (CIM) that identify the principal processed by the system, or by the events that stimulate responses from
a system.
concerns in a system. ◇ Activity diagrams may be used to model the processing of data,
• Defined using UML class diagrams and include objects, where each activity represents one process step.
attributes and associations. ◇ State diagrams are used to model a system’s behaviour in
▪Class models in which classes are defined, along with response to internal or external events.
their attributes and operations. ◇ Model-driven engineering is an approach to software
▪State models in which a state diagram is associated development in which a system is represented as a set of
models that can be automatically transformed to executable
with each class and is used to describe the life cycle of code.
the class.
© Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 431 © Ian Sommerville Software Engineering, 9th ed. Chapter 5 System Modelling (extract) 432
16