SFT Eng Unit 4 1.4
SFT Eng Unit 4 1.4
SFT Eng Unit 4 1.4
Context models
Interaction models
Structural models
Behavioural models
Model-driven engineering
Architectural views
Architectural patterns
Application architectures
Chapter objective
1) Introducing a number of system models that may be developed during the requirements
engineering process.
2) Understand how graphical models can be used to represent software systems and to
establish the boundaries of a system and model its context.
3) Introduced the notations defined in the Unified Modeling Language (UML) and
understand how these notations may be used to develop system models.
System model: The most significant feature of a system model is that it lacks detail. A
system model is an abstraction of the system under study, not an alternate representation.
Various methods of abstraction serve as the foundation for various kinds of system models.
For instance, a data-flow model focuses on the movement of data and the functional
modifications made to that data. It omits information on the data structures.
System Modelling
System modeling is the process of developing abstract models of a system, with each
model presenting a different view or perspective of that system.
System modelling helps the analyst to understand the functionality of the system and
models are used to communicate with customers.
System modeling typically involves employing graphical notations based on the Unified
Modeling Language (UML).
Documenting the system specification as a collection of system models is one popular
method.
Models for the existing system: Models of the existing system are utilized in requirements
engineering. They clarify the system's function and serve as a foundation for discussing its
advantages and disadvantages. This leads to requirements for the new system.
Models of the new system: Models of the new system are used in requirements engineering
to communicate suggested requirements to stakeholders. Engineers use these models to
review design concepts and record systems for implementation.
Based on the system model, model-driven engineering enables full or partial system
implementation.
The following are some examples of system models you could develop when doing the
analysis:
A data- flow model: Data-flow models show how data is processed at different stages in
the system.
A composition model: A composition or aggregation model shows how entities in the
system are composed of other entities.
An architectural model: Architectural models show the principal sub-systems that make
up a system.
A classification model: Object class/inheritance diagrams show how entities have
common characteristics.
A stimulus-response model: A stimulus-response model, or state transition diagram,
shows how the system reacts to internal and external events.
The UML provides several diagram kinds, allowing for the design of various system models.
Most UML users believed that five diagram kinds were sufficient to represent the essence of
a system.
Activity diagrams, which show the activities involved in a process or in data processing.
Activity diagrams may be used to model the processing of data, where each activity
represents one process step.
Use case diagrams, which show the interactions between a system and its environment.
Sequence diagrams, which show interactions between actors and the system and
between system components.
Class diagrams, which show the object classes in the system and the associations
between these classes.
State diagrams, which show how the system reacts to internal and external events. State
diagrams are used to model a system’s behavior in response to internal or external events.
Context Models
Context models show how a system that is being modeled is positioned in an environment
with other systems and processes. They help define the boundaries of the system to be
developed.
Context models are used to illustrate the boundaries of a system. This involves working
with system stakeholders to distinguish what is the system and what is the system’s
environment. You should make these decisions early in the process to limit the system
costs and the time needed for analysis.
Shows the scope and boundaries of a system at a glance including the other systems that
interface with it.
Context models provide an overview (abstraction) of an entire system, and shows the
most important aspects. Context models highlight the key elements of a system. Details
are not included.
Context models typically indicate that the environment involves multiple automated
systems.
Context models typically indicate the presence of multiple more automated systems in the
environment. They do not, however, depict the kinds of connections that exist between
the system under specification and the systems in its surroundings.
Determining the boundaries of a system should be done early in the specification process.
This entails deciding what features belong in the system and what the system's
environment provides in collaboration with system stakeholders. Collaboration with
stakeholders determines system functionality and environment requirements.
Understanding the diagram does not necessitate or require technical understanding.
Because of its concise notation, it is simple to draw and edit.
Context models normally show that the environment includes several other automated
systems. However, they do not show the types of relationships between the systems in the
environment and the system that is being specified. External systems might produce data
for or consume data from the system. They might share data with the system, or they
might be connected directly, through a network or not connected at all. They might be
physically co-located or located in separate buildings. All of these relations may affect the
requirements and design of the system being defined and must be taken into account.
Therefore, simple context models are used along with other models, such as business
process models.
Determining that context and the dependencies a system has on its surroundings is a part of
the analysis process, once the limits of the system have been decided upon. Creating a basic
architectural model is typically the first phase of this undertaking.
Figure below is a simple context model that shows the patient information system and the
other systems in its environment.
Figure: The context of the MHC-PMS
Here in the above diagram we are creating the specification for a patient information system
in mental healthcare.
This system manages information on mental health clinic patients and their prescribed
treatments.
In above system we must determine when creating the system's specification if the system
should just be used to gather data about consultations or whether it should additionally get
private patient data.
From figure above, we can see that the MHC-PMS is connected to an appointments system
and a more general patient record system with which it shares data.
The system is also connected to systems for management reporting and hospital bed
allocation and a statistics system that collects information for research.
Contextual models are used with other models, including business process models. These
refer to human and automated processes that utilize certain software platforms.
Figure: Process model of involuntary detention
The figure above is a UML activity diagram. Activity diagrams depict the activities in a
system process and the control flow between them. A filled circle marks the beginning and
end of a procedure. Rectangles with round corners symbolize activities, or required sub-
processes.
Arrows in a UML activity diagram indicate the flow of work from one activity to another. A
solid bar is used to show activity coordination. When many activities result in a solid bar,
they must all be completed before progress is possible. When a solid bar triggers multiple
actions, they can run simultaneously.
Therefore, the operations of informing social care and next of kin, as well as updating the
detention register, may occur concurrently.
In figure above, you can see guards showing the flows for patients who are dangerous and
not dangerous to society. Patients who are dangerous to society must be detained in a secure
facility. However, patients who are suicidal and so are a danger to themselves may be
detained in an appropriate ward in a hospital.
Context models of ATM system
Figure above is an architectural model that illustrates the structure of the information system
that includes a bank auto-teller network.
We see that each ATM is connected to an account database, a local branch accounting
system, a security system and a system to support machine maintenance.
The system is also connected to a usage database that monitors how the network of ATMs is
used and to a local branch counter system.
This local branch counter system provides services such as backup and printing.
Simple architectural models are typically enhanced by additional models, such as process
models, which illustrate the system-supported process activities. The data that is transmitted
between the system and other systems in its environment can also be displayed using data-
flow models.
The figure below shows a process model for acquiring equipment in an organization. The
process includes specifying equipment, selecting suppliers, ordering, receiving, and testing it.
When specifying computer support for this process, determine which activities will be
supported. Other actions occur outside of the system. In figure below, the dotted line
encloses the activities that are within the system boundary.
Figure: Process model of equipment procurement
Interaction models
There is some sort of interaction in every system. This can be system-to-system or system-
component interaction, involving user inputs and outputs, or interaction between the system
under development and other systems. Creating Models, user contact is crucial because it
facilitates the identification of user needs. System-to-system interaction modeling brings to
light potential communication issues.
We can determine whether a suggested system structure is likely to provide the necessary
system performance and reliability by modeling the interaction between the components.
1) Use case modeling, which is mostly used to model interactions between a system and
external actors (users or other systems).
2) Sequence diagrams, which are used to model interactions between system components,
although external agents may also be included.
Notes: Use case diagrams and sequence diagrams are used to describe the interactions
between user the system being designed and users/other systems. Use cases describe
interactions between a system and external actors; sequence diagrams add more information
to these by showing interactions between system objects. Use case models and sequence
diagrams present interaction at different levels of detail and so may be used together.
1) Use case modeling: Use case modeling is commonly used to facilitate requirements
elicitation. A use case is a simple scenario that describes a user's expectations from a
technology. Each use case refers to a specific task that requires external interaction with
the system.
A use case is depicted as an ellipse, with actors portrayed as stick figures. Figure below
illustrates a use case for transferring data from the MHC-PMS to a more comprehensive
patient records system.
Notice that there are two actors in this use case: the operator who is transferring the data and
the patient record system.
Use case diagrams give a fairly simple overview of an interaction so you have to provide
more detail to understand what is involved. This detail can either be a simple textual
description, a structured description in a table, or a sequence diagram.
Figure below shows all of the use cases in the MHC-PMS in which the actor ‘Medical
Receptionist’ is involved.
Figure: Use cases involving the role ‘medical receptionist’
2) Sequence diagrams
The main purposes of sequence diagrams in the UML are to represent the interactions that
take place within a system between its objects and its actors.
A sequence diagram shows the sequence of interactions that take place during a particular use
case or use case instance.
The diagram below models the interactions involved in the View patient information use
case, where a medical receptionist can see some patient information.
The objects and actors involved are listed along the top of the diagram, with a dotted line
drawn vertically from these. Interactions between objects are indicated by annotated arrows.
The rectangle on the dotted lines indicates the lifeline of the object concerned (i.e., the time
that object instance is involved in the computation).
The notes on the arrows indicate the calls to the objects, their parameters, and the return
values.
Here for alternatives notation. A box named alt is used with the conditions indicated in
square brackets.
Figure: Sequence diagram for View patient information
From above sequence diagram we can see that the medical receptionist calls the ViewInfo
method on an instance P of the PatientInfo object type, passing the patient's identity (PID).
P is a user interface object that displays a form with patient information.
Instance P requests information from the database and provides the receptionist's identifier
for security checks (the origin of the UID is unimportant at this point).
The database checks with an authorization system that the user is authorized for this action.
If authorized, the patient information is returned and a form on the user’s screen is filled in. If
authorization fails, then an error message is returned.
Structural models
Software structural models show how a system is organized in terms of its constituent parts
and their interrelationships. Structural models can be either dynamic or static. Static models,
which show the structure of the system design and dynamic models, which show the
organization of the system when it is executing.
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.
We create structural models of a system when you are discussing and designing the system
architecture.
Class diagrams
Object /Class Modeling
Class – Template to define specific instances or objects
Object – Instantiation of a class
Attributes – Describes the object
Behaviors – specify what object can do
The UML Class diagram is a graphical notation used to construct and visualize object
oriented systems. A class diagram in the Unified Modeling Language (UML) is a type of
static structure diagram that describes the structure of a system by showing the
system's:classes, their attributes, operations (or methods), and the relationships among
objects.
Class Name
Set of attributes
Set of operations(or methods)
Visibility of the class
Association:
Aggregation:
refers to the formation of a particular class as a result of one class being aggregated or
built as a collection.
draw a line from the parent class to the child class with a diamond shape near the parent
class.
Eg: College and Student, Library and books, Room and walls, Computer and mouse,
hospitals and doctors
Composition:
Example: Room is part of building. If building collapse room also collapse. So it is strong
form of aggregation. If college is not functioning all student also affecting directly.
Dependency
A dependency means the relation between two or more classes in which a change in one
may force changes in the other. However, it will always create a weaker relationship.
Dependency indicates that one class depends on another.
Example: Student has a dependency on College
Inheritance(Generalization/specialization)
Realization
Denotes the implementation of the functionality defined in one class by another class.
A broken line with an unfilled solid arrowhead is drawn from the class that defines the
functionality of the class that implements the function
Eg: the printing preferences that are set using the printer setup interface are being
implemented by the printer.
Cardinality/multiplicity
Exactly one – 1
Zero or one - 0..1
Many - 0..* or *
One or more - 1..*
Exact Number - e.g. 3..4 or 6
Or a complex relationship - e.g. 0..1, 3..4, 6. * would mean any number of objects other
than 2 or 5
Roles
Behavioural models
Behavioural models are used to describe the overall behaviour of the system. They show
what happens or what is supposed to happen when a system responds to a stimulus from its
environment.
Behavioral models are used to describe the dynamic behavior of an executing system. This
can be modeled from the perspective of the data processed by the system or by the events that
stimulate responses from a system.
Behavioural model here: data-flow models, which model the data processing in the system
and state machine models, which model how the system reacts to events.
These models may be used separately or together, depending on the type of system that is
being developed.
1) Data-flow models
A dataflow model may be all that is needed to represent the behaviour of these systems.
Data-flow models are an intuitive way of showing how data is processed by a system. At the
analysis level, they should be used to model the way in which data is processed in the
existing system.
Data-flow models are used to show how data flows through a sequence of processing steps.
Data-flow models are valuable because tracking and documenting how the data associated
with a particular process moves through the system helps analysts understand what is going
on.
Data-flow models give a functional viewpoint in which every transformation stands in for a
distinct process or function. They are very helpful for demonstrating end-to-end system
processing during requirements analysis.
The notation used in Data-flow models represents functional processing (rounded rectangles),
data stores (rectangles) and data movements between functions (labelled arrows).
Diabetes is a relatively common condition where the human pancreas is unable to produce
sufficient quantities of a hormone called insulin. Insulin metabolises glucose in the blood.
The conventional treatment of diabetes involves regular injections of genetically engineered
insulin.
Diabetics measure their blood sugar levels using an external meter and then calculate the dose
of insulin that they should inject.
The problem with this treatment is that the level of insulin in the blood does not just depend
on the blood glucose level but is a function of the time when the insulin injection was taken.
This can lead to very low levels of blood glucose (if there is too much insulin) or very high
levels of blood sugar (if there is too little insulin).
Low blood sugar is, in the short term, a more serious condition, as it can result in temporary
brain malfunctioning and, ultimately, unconsciousness and death.
In the long term, continual high levels of blood sugar can lead to eye damage, kidney
damage, and heart problems.
Current advances in developing miniaturised sensors have meant that it is now possible to
develop automated insulin delivery systems. These systems monitor blood sugar levels and
deliver an appropriate dose of insulin when required.
Insulin delivery systems like this already exist for the treatment of hospital patients. In the
future, it may be possible for many diabetics to have such systems permanently attached to
their bodies.
Figure above is a data-flow model that illustrates how an input blood sugar level is
transformed to a sequence of pump control commands.
There are two high-level dependability requirements for this insulin pump system:
2. The system shall perform reliably and deliver the correct amount of insulin to counteract
the current level of blood sugar.
Failure of the system could, in principle, cause excessive doses of insulin to be delivered and
this could threaten the life of the user. It is particularly important that overdoses of insulin
should not occur.
A state machine model is the most effective way to represent real-time systems which are
often event-driven with minimal data processing.
It is based on the assumption that a system has a finite number of states and that events
(stimuli) may cause a transition from one state to another.
Event-driven modeling shows how a system responds to external and internal events. It is
based on the assumption that a system has a finite number of states and that events (stimuli)
may cause a transition from one state to another.
Case:
ATM is initially turned off. After the power is turned on, ATM performs startup action and
enters Self Test state. If the test fails, ATM goes into Out of Service state, otherwise there is
triggerless transition to the Idle state. In this state ATM waits for customer interaction.
The ATM state changes from Idle to Serving Customer when the customer inserts banking or
credit card in the ATM's card reader. On entering the Serving Customer state, the entry action
readCard is performed. Note, that transition from Serving Customer state back to the Idle
state could be triggered by cancel event as the customer could cancel transaction at any time.
Fig: State diagram of ATM System
Figure below is a state diagram for the weather station system that shows how it responds to
requests for various services.
In the Running state, the system expects further messages. If a shutdown() message is
received, the object returns to the shutdown state.
If a reportStatus() message is received, the system moves to the Testing state, then the
Transmitting state, before returning to the Running state.
If a signal from the clock is received, the system moves to the Collecting state, where it
collects data from the instruments. Each instrument is instructed in turn to collect its data
from the associated sensors.
Model-driven engineering:
The programs that execute on a hardware/software platform are then generated automatically
from the models.
Model-driven engineering and model-driven architecture are often seen as the same thing.
But MDA focuses on the design and implementation stages of software development whereas
MDE is concerned with all aspects of the software engineering process. (model-based
requirements engineering, software processes for model-based development, and model-
based testing are part of MDE but not, currently, part of MDA.)
Model-based engineering is still in its early stages of development, and its impact on software
engineering practice remains uncertain.
The techniques have been used successfully in the development of large, long-lifetime
software systems such as air traffic management systems.
MDE allows engineers to think about systems at a high level of abstraction, without
concern for the details of their implementation.
This reduces the likelihood of errors, speeds up the design and implementation process,
and allows for the creation of reusable, platform-independent application models.
By using powerful tools, system implementations can be generated for different platforms
from the same model. Therefore, to adapt the system to some new platform technology, it
is only necessary to write a translator for that platform. When this is available, all
platform-independent models can be rapidly rehosted on the new platform.
MDE bad aspect
It does not always follow that the abstractions that are supported by the model are the right
abstractions for implementation.
The CIM also called domain models describes a system conceptually i.e models the important
domain abstractions used in the system. CIM reflect the different views of the system. Example,
security CIM.
The PIM describes the computational aspects of a system without reference to the
technologies that may be used to implement it. PIM models the operation of the system
without reference to its implementation. The PIM is usually described using UML models
that show the static system structure and how it responds to external and internal events.
The PSM provides the technical details necessary to implement the system.
Transformations between these above models may be defined and applied automatically by
software tools.
A transformation is applied to the PSM to generate executable code that runs on the
designated software platform.
At the time of writing, automatic CIM to PIM translation is still at the research prototype
stage. It is unlikely that completely automated translation tools will be available in the near
future. Human intervention, indicated by a stick figure in figure above, will be needed for the
foreseeable future.
The translation of PIMs to PSMs is more mature and several commercial tools are available
that provide translators from PIMs to common platforms such as .NET and J2EE. There
may be several PSMs for each PIM in the system.
In some cases (e.g., for user interface generation), completely automated PIM to PSM
translation may be impossible.
Architectural design:
Large systems are typically divided into sub-systems that offer related services.
Architectural design is the first design process that identifies these sub-systems and creates
a framework for sub-system control and communication.
The output of design process is a description of the software architecture which represents a
critical link between the design and requirements engineering processes.
Architectural design involves creating a framework that identifies system components and
their interactions (communication).
This tool is vital for managing complexity. Designers can focus on crucial system
abstractions by removing unnecessary details.
Sub-system development: The subsystems found during system design are put into practice
during sub-system development. For certain subsystems, this can entail initiating a new
system engineering process; alternatively, if the subsystem is software, it might entail
initiating a software process that encompasses requirements, design, implementation, and
testing.
A sub-system design is an abstract decomposition of a system into large-grain components,
each of which may be a substantial system in its own right. Block diagrams are often used to
describe sub-system designs where each box in the diagram represents a sub-system. Boxes
within boxes indicate that the sub-system has itself been decomposed to sub-systems.
Arrows mean that data and or control signals are passed from sub-system to sub-system in the
direction of the arrows. Block diagrams present a high-level picture of the system structure,
which people from different disciplines who are involved in the system development process
can readily understand.
But for technical and managerial purposes, an incremental integration process where sub-
systems are integrated one at a time is the best approach.
Architecture of an air traffic control system: Figure below shows the architecture of a
much larger system for air traffic control. Several major sub-systems shown are themselves
large systems. The arrowed lines that link these systems show information flow between
these sub-systems.
Figure: An architectural model of an air traffic control system
An abstract model of the architecture for a packing robot system: This robotic
system can pack different kinds of object. It uses a vision sub-system to pick out objects on a
conveyor, identify the type of object and select the right kind of packaging. The system then
moves objects from the delivery conveyor to be packaged.
Door sensors: Detects door opening in the external doors of the building
Voice synthesizer: Synthesises a voice message giving the location of the suspected intruder
Telephone caller: Makes external calls to notify security, the police, etc.
Figure: A simple burglar alarm system
Architectural design is a creative process where you try to establish a system organization
that will satisfy the functional and non-functional system requirements.
System architects must make crucial decisions during the architectural design process that
impact the system's evolution.
Is there a generic application architecture that can act as a template for the system that is
being designed?
How will the system be distributed across a number of processors?
What architectural style or styles are appropriate for the system?
What will be the fundamental approach used to structure the system?
How will the structural units in the system be decomposed into modules?
What strategy will be used to control the operation of the units in the system?
How will the architectural design be evaluated?
How should the architecture of the system be documented?
The product of the architectural design process is an architectural design document. This may
include a number of graphical representations of the system along with associated descriptive
text. It should describe how the system is structured into sub-systems, the approach adopted
and how each sub-system is structured into modules. The graphical models of the system
present different perspectives on the architecture. Architectural models that may be
developed may include:
A static structural model that shows the sub-systems or components that are to be
developed as separate units.
A dynamic process model that shows how the system is organised into processes at run-
time. This may be different from the static model.
An interface model that defines the services offered by each sub-system through its public
interface.
Relationship models that shows relationships, such as data flow, between the sub-
systems.
A distribution model that shows how sub-systems may be distributed across computers.
Architectural views
Architectural models of a software system can be used to focus discussion about the software
requirements or design.
Although it can be used as a basis for more comprehensive design and execution, and for the
future evolution of the system, architectural models can have two relevant issues:
1) What views or perspectives are useful when designing and documenting a system’s
architecture?
2) What notations should be used for describing architectural models?
An architecture model depicts the breakdown of a system into modules, the interactions
between run-time processes, and the distribution of system components throughout a
network. All of them are useful at different times, hence, in both design and documentation,
you frequently need to give multiple views of the software architecture.
Krutchen's (1995) 4+1 perspective model of software architecture proposes four essential
architectural views, which are related using use cases or scenarios.
1) A logical view, which shows the key abstractions in the system as objects or object
classes. It should be possible to relate the system requirements to entities in this
logical view.
2) A process view, which shows how, at run-time, the system is composed of interacting
processes. This view is useful for making judgments about nonfunctional system
characteristics such as performance and availability.
3) A development view, which shows how the software is decomposed for development,
that is, it shows the breakdown of the software into components that are implemented
by a single developer or development team. This view is useful for software managers
and programmers.
4) A physical view, which shows the system hardware and how software components are
distributed across the processors in the system. This view is useful for systems
engineers planning a system deployment.
5) Conceptual view. This view is an abstract view of the system that can be the basis for
decomposing high-level requirements into more detailed specifications, help
engineers make decisions about components that can be reused, and represent a
product line rather than a single system. Figure above, which describes the
architecture of a packing robot, is an example of a conceptual system view.
Architectural patterns
Architectural patterns were proposed in the 1990s under the name ‘architectural styles’.
These are the reusable solutions to commonly occurring architectural problems. They capture
the essence of proven architectural design principles and practices to address specific
concerns in system design. Architectural patterns provide high-level guidelines and templates
for designing the overall structure and organization of software systems.
Architectural patterns should include information of when it is and is not appropriate to use
that pattern, and the pattern’s strengths and weaknesses.
Architectural patterns describe the architecture utilized in various software systems. When
making architectural decisions, it's important to understand typical patterns, their application,
and their strengths and limitations of a system.
Figure (b): Web application architecture using the MVC pattern (possible run-time
architecture)
This above MVC pattern is the basis of interaction management in many web-based systems.
Figure (b) above shows the architecture of a web-based application system organized using
the MVC pattern.
The MVC pattern, shown in Figure above, separates elements of a system, allowing them to
change independently. For example, adding a new view or changing an existing view can be
done without any changes to the underlying data in the model.
When used Used when there are multiple ways to view and interact with data. Also used
when the future requirements for interaction and presentation of data are unknown.
Advantages Allows the data to change independently of its representation and vice versa.
Supports presentation of the same data in different ways with changes made in one
representation shown in all of them.
Disadvantages Can involve additional code and code complexity when the data model and
interactions are simple.
Organizes the system into layers with related functionality associated with each layer. A layer
provides services to the layer above it so the lowest-level layers represent core services that
are likely to be used throughout the system.
Here, the system functionality is organized into separate layers, and each layer only relies on
the facilities and services offered by the layer immediately beneath it.
When used Used when building new facilities on top of existing systems; when the
development is spread across several teams with each team responsibility for a layer of
functionality; when there is a requirement for multi-level security.
This is a multi-user, web-based system for providing a film and photograph library. In
this system, several servers manage and display the different types of media. Video
frames need to be transmitted quickly and in synchrony but at relatively low resolution.
They may be compressed in a store, so the video server can handle video compression
and decompression in different formats. Still pictures, however, must be maintained at a
high resolution, so it is appropriate to maintain them on a separate server.
The catalog must be able to deal with a variety of queries and provide links into the web
information system that includes data about the film and video clips, and an e-commerce
system that supports the sale of photographs, film, and video clips.
The client program is simply an integrated user interface, constructed using a web
browser, to access these services.
The most important advantage of the client–server model is that it is a distributed
architecture. Effective use can be made of networked systems with many distributed
processors. It is easy to add a new server and integrate it with the rest of the system or to
upgrade servers transparently without affecting other parts of the system.
Application architectures