lecture - 5-Software analysis
lecture - 5-Software analysis
D.M.K.D Dissanayake
MSc-IT(Cyber security), PGDIT, BSc(Hons),HR(Dip)
SOFTWARE ANALYSIS
SOFTWARE ANALYSIS AND MODELS
Software analysis and design includes all activities, which help the transformation of
requirement specification into implementation.
Software design is a process to transform user requirements into some suitable form, which
helps the programmer in software coding and implementation.
FUNDAMENTAL DESIGN CONCEPTS
Abstraction - data, procedure, control
Refinement - elaboration of detail for all
abstractions
Modularity - compartmentalization of data
and function (divided into components
called modules)
Architecture - overall structure of the software
• Structural properties
• Extra-structural properties
• Styles and patterns
• Data design is the first (and sometimes the most important) of the four design activities
that are conducted in software engineering.
• The data design activity translates data object (entities) defined as part of analysis model
into data structures at the software component level, and when necessary, a database
architecture at the application level.
• In some situations, a database must be designed and built specifically for a new system.
In others, one or more existing databases are used
DATA DESIGN
• Transforms the information domain model created during analysis into the data structures
that will be required to implement the software.
• The data objects and relationships defined in the Entity Relationship Diagram (ERD)
and the detailed data content depicted in the Data Dictionary provide the basis for the
data design activity.
DATA DESIGN : ER DIAGRAM
Attributes - name a data object instance, describe its characteristics, or make reference to
another data object
Relationships - indicate the manner in which data objects are connected to one another
DATA DESIGN : ER DIAGRAM
For example, in a University database, we might have entities for Students, Courses, and
Lecturers.
Students entity can have attributes like Rollno, Name, and DeptID.
Relationship is nothing but an association among two or more entities. E.g., Tom works in
the Chemistry department.
ATTRIBUTES
Defines the numerical attributes of the relationship between two entities or entity sets.
One-to-one:
One entity from entity set X can be associated with at most one entity of entity set Y and
vice versa.
CARDINALITY
One-to-many:
One entity from entity set X can be associated with multiple entities of entity set Y, but an
entity from entity set Y can be associated with at least one entity.
CARDINALITY
Many to One
More than one entity from entity set X can be associated with at most one entity of entity
set Y. However, an entity from entity set X may or may not be associated with more than
one entity from entity set X.
CARDINALITY
Many to Many:
One entity from X can be associated with more than one entity from Y and vice versa.
DATA DESIGN
ER- DIAGRAM NOTATIONS
ER- Diagram is a visual representation of data that describe how data is related to each
other.
ATM
DATA DICTIONARY
Data dictionary is an organized listing of all data elements that are relavant to the system,
with precise, rigorous definitions so that both user and system analyst will have a common
understanding of inputs, outputs, components of stores and [even] intermediate
calculations
Advantages
• Documentation : It is valuable reference in any organization
• Improve analyst and user communication
• It is important step in building a database
ITEMS TO BE DEFINED DATA DICTIONARY
Data elements : smallest unit of data that provides for no further decomposition
Data structure : Group of data element handled as a unit
Eg : phone is a data structure consisting of 4data elements.
Area
Code
Exchange number
extention
DATA DICTIONARY CONTENTS
ITEMS TO BE DEFINED DATA DICTIONARY
41
ARCHITECTURAL STYLES
ARCHITECTURAL STYLES
The software that is built for computer-based systems can exhibit one of these many
architectural styles.Each style describes a system category that encompasses:
(1) a set of components (e.g., a database, computational modules) that perform a
function required by a system,
(2) a set of connectors that enable “communication, coordination and cooperation”
among components,
(3) constraints that define how components can be integrated to form the system,
and
(4) semantic models that enable a designer to understand the overall properties of a
system by analyzing the known properties of its constituent parts.
ARCHITECTURAL STYLES
The use of architectural styles is to establish a structure for all the components of the
system.
• Data-centered architectures
• Data flow architectures
• Call and return architectures
• Object-oriented architectures
• Layered architectures
DATA-CENTERED / REPOSITORY ARCHITECTURE
• A data store will reside at the centre of this architecture and is accessed frequently by the
other components that update, add, delete or modify the data present within the store.
• This means that the existing components can be changed and new client components can
be added to the architecture without the permission or concern of other clients.
DATA-CENTERED / REPOSITORY ARCHITECTURE
When large amounts of data are to be shared, the repository model of sharing is most
commonly used a this is an efficient data sharing mechanism.
DATA-CENTERED / REPOSITORY ARCHITECTURE
DATA-CENTERED / REPOSITORY ARCHITECTURE
IDE
DATA-CENTERED / REPOSITORY ARCHITECTURE
Name Repository
Description All data in a system is managed in a central repository that is accessible to all system
components. Components do not interact directly, only through the repository.
Example Figure is an example of an IDE where the components use a repository of system design
information. Each software tool generates information which is then available for use by
other tools.
When used You should use this pattern when you have a system in which large volumes of
information are generated that has to be stored for a long time. You may also use it in
data-driven systems where the inclusion of data in the repository triggers an action or
tool.
Advantages Components can be independent—they do not need to know of the existence of other
components. Changes made by one component can be propagated to all components.
All data can be managed consistently (e.g., backups done at the same time) as it is all in
one place.
Disadvantages The repository is a single point of failure so problems in the repository affect the whole
system. May be inefficiencies in organizing all communication through the repository.
Distributing the repository across several computers may be difficult.
DATA FLOW ARCHITECTURE/ PIPE AND FILTER ARCHITECTURE
• This kind of architecture is used when input data to be transformed into output data
through a series of computational manipulative components.
• The figure represents pipe-and-filter architecture since it uses both pipe and filter and it
has a set of components called filters connected by pipes.
• Pipes are used to transmit data from one component to the next.
• Each filter will work independently and is designed to take data input of a certain
form and produces data output to the next filter of a specified form. The filters don’t
require any knowledge of the working of neighbouring filters.
• If the data flow degenerates into a single line of transforms, then it is termed as batch
sequential. This structure accepts the batch of data and then applies a series of
sequential components to transform it.
DATA FLOW ARCHITECTURE/ PIPE AND FILTER ARCHITECTURE
DATA FLOW ARCHITECTURE/ PIPE AND FILTER ARCHITECTURE
DATA FLOW ARCHITECTURE/ PIPE AND FILTER ARCHITECTURE
• Distributed system model which shows how data and processing is distributed across a
range of components.
o Can be implemented on a single computer.
• Set of stand-alone servers which provide specific services such as printing, data
management, etc.
• Set of clients which call on these services.
• Network which allows clients to access servers.
A CLIENT–SERVER ARCHITECTURE FOR A FILM LIBRARY
THE CLIENT–SERVER PATTERN
Name Client-server
Description In a client–server architecture, the functionality of the system is organized
into services, with each service delivered from a separate server. Clients are
users of these services and access servers to make use of them.
Example Figure 6.11 is an example of a film and video/DVD library organized as a
client–server system.
When used Used when data in a shared database has to be accessed from a range of
locations. Because servers can be replicated, may also be used when the
load on a system is variable.
Advantages The principal advantage of this model is that servers can be distributed
across a network. General functionality (e.g., a printing service) can be
available to all clients and does not need to be implemented by all services.
Disadvantages Each service is a single point of failure so susceptible to denial of service
attacks or server failure. Performance may be unpredictable because it
depends on the network as well as the system. May be management
problems if servers are owned by different organizations.
OBJECT-ORIENTED DESIGN
Property
OPERATIONS
- size: Size
- pos: Position
+ figureCounter: Integer
+ draw( )
+ resize(percentX: Integer=25, percentY=30)
+ returnPosition( ): Position
+ incrementCounter( ): Integer
• multiple
Class super classes.
diagram allows inheriting
8
from
INHERITANCE : ZOO SYSTEM
7
8
INHERITANCE : ZOO SYSTEM
7
9
INHERITANCE : ZOO SYSTEM
8
0
INHERITANCE : ZOO SYSTEM
8
1
INHERITANCE
• To model inheritance on a class diagram, a solid line is drawn from the child
class (the class inheriting the behavior) with a closed, unfilled arrowhead (or
triangle) pointing to the super class. Consider types of bank accounts:
8
8
ASSOCIATION
8
5
ASSOCIATION
• In this example, the relationship between student and college is shown which
is studies.
8
6
DEPENDENCY
• Here, the college class will remain even if the student is not available.
8
9
AGGREGATION : ZOO SYSTEM
9
0
COMPOSITION
• The college could contain many students, while each student belongs to
only one college.
9
3
COMPOSITION
10
1
COMPOSITION
10
2
COMPOSITION
9
6
MULTIPLICITY
• students.
3
MULTIPLICITY
9
8
MULTIPLICITY
9
9
UML RELATION NOTATIONS
1
0
0
EXAMPLE OF UML CLASS DIAGRAM
• However, there are multiple security layers that any ATM system needs to
pass.
banking 7
ARCHITECTURAL PATTERN
Architectural patterns are similar to software design pattern but have a broader
scope.
10
7
ARCHITECTURAL PATTERN
• Layered pattern
• Client-server pattern
• Master-slave pattern
• Pipe-filter pattern
• Broker pattern
• Peer-to-peer pattern
• Event-bus pattern
• Model-view-controller pattern
• Blackboard pattern
• Interpreter pattern
10
7
4+1 ARCHITECTURAL VIEW MODEL
10
7
4+1 ARCHITECTURAL VIEW MODEL
• Viewpoint modelling has become an effective approach for dealing with the
inherent complexity of large distributed systems. 10
7
4+1 ARCHITECTURAL VIEW MODEL
The views are used to describe the system from the viewpoint of different
stakeholders, such as end-users, developers and project managers.
10
7
4+1 ARCHITECTURAL VIEW MODEL
Logical View
(Object-oriented Decomposition)
Viewer : End-user
Considers : Functional requirements- What the system should provide in terms
of services to its users.
• This view shows the components (objects) of the system as well as their
interactions / relationships.
Process View
(The process decomposition)
Viewer : Integrators
Considers : Non - functional requirements (concurrency, performance, scalability)
• The process view shows the processes / workflow rules of a system and how
those processes communicate with each other.
Development View
(Subsystem decomposition)
• It gives a building block view of the system. Eg: Packages Used, Execution
Environments, Class Libraries and Sub systems utilized.
Physical Views
(Mapping the software to the Hardware)
10
7
4+1 ARCHITECTURAL VIEW MODEL
10
7
RELATIONSHIP AMONG THE VIEWS
• Concurrency is not addressed in the logical view, to achieve the process view,
we need to map classes and their objects onto tasks and processes addressing
concurrency and synchronization.
• The processes and process groups are mapped onto the processing nodes of a
physical computer network to obtain the physical view. For each dependency
between components, there must be a corresponding link between nodes.
• The logical view is also the basis for the development view. Normally each
class corresponds to a module. Large classes may be decomposed into
packages. Collections of classes are grouped into subsystems. 10
7
IS IT IMPORTANT?
• The 4 + 1 approach makes it possible for stakeholders to get the parts of the
model that are relevant to them.
10
7
INTERFACE DESIGN
INTERFACE DESIGN
• Describes how the software communicates within itself, to systems that inter-
operates with it, and with humans who use it.
• The Data and Control Flow Diagrams provide the information required for
interface design.
10
7
DATA FLOW DIAGRAMS
• A data flow diagram shows the way information flows through a process or
system.
• It includes data inputs and outputs, data stores, and the various subprocesses
the data moves through.
• DFDs are built using standardized symbols and notation to describe various
entities and their relationships.
10
7
PHYSICAL AND LOGICAL DATA FLOW DIAGRAMS
• The processes described in a logical DFD are business activities—a logical DFD
doesn’t delve into the technical aspects of a process or system.
• Depending on the methodology (Gane and Sarson vs. Yourdon and Coad), DFD
symbols vary slightly.
• There are four basic elements of a data flow diagram: processes, data stores,
external entities, and data flows.
• The picture below shows the standard shapes for both methodologies.
10
7
DATA FLOW DIAGRAM SYMBOLS AND NOTATION
10
7
DATA FLOW DIAGRAM : ATM
10
7
DATA FLOW DIAGRAM LEVELS
• Starting with the most basic, level 0, DFDs get increasingly complex as the
level increases.
• As you build your own data flow diagram, you will need to decide which level
your diagram will be.
10
7
LEVEL 0 : DATA FLOW DIAGRAM
• Level 0 DFDs, also known as context diagrams, are the most basic data flow
diagrams.
• They provide a broad view that is easily digestible but offers little detail.
• Level 0 data flow diagrams show a single process node and its connections to
external entities.
10
7
LEVEL 0 : DATA FLOW DIAGRAM
10
7
LEVEL 1 : DATA FLOW DIAGRAM
• Level 1 DFDs are still a general overview, but they go into more detail than a
context diagram.
• In a level 1 data flow diagram, the single process node from the context
diagram is broken down into subprocesses.
• As these processes are added, the diagram will need additional data flows and
data stores to link them together.
10
7
DATA FLOW DIAGRAM : ATM
10
7
LEVEL 1 : DATA FLOW DIAGRAM
10
7
LEVEL 2+ : DATA FLOW DIAGRAM
10
7
PROCEDURAL DESIGN
PROCEDURAL DESIGN
• Information obtained from the Process and Control Specifications and the
State Transition Diagrams serve as a basis for procedural design
10
7
STATE TRANSITION DIAGRAMS
• The STD focuses on the time-dependent behaviour of the system and regards
it as a whole.
• Its purpose is to identify the possible states of the system (as a whole), how it
gets from one state to another, how these transitions are triggered and what
the system ‘does’ during the transition
10
7
STATE TRANSITION DIAGRAMS
10
7
STATE TRANSITION DIAGRAMS
10
7
STATE TRANSITION DIAGRAMS : ATM
10
7
STATE TRANSITION DIAGRAMS : ATM
10
7
STATE TRANSITION DIAGRAMS : ATM
10
7
STATE TRANSITION DIAGRAMS : ATM
10
7