SEPM Unit-3
SEPM Unit-3
SEPM Unit-3
Software design is a mechanism to transform user requirements into some suitable form, which helps the
programmer in software coding and implementation. It deals with representing the client's requirement, as
described in SRS (Software Requirement Specification) document, into a form, i.e., easily implementable
using programming language.
The software design phase is the first step in SDLC (Software Design Life Cycle), which moves the
concentration from the problem domain to the solution domain. In software design, we consider the
system to be a set of components or modules with clearly defined behaviors & boundaries.
2. Completeness: The design should have all components like data structures, modules, and external
interfaces, etc.
6. Maintainability: The design should be so simple so that it can be easily maintainable by other
designers.
For software design, the goal is to divide the problem into manageable pieces.
Benefits of Problem Partitioning
These pieces cannot be entirely independent of each other as they together form the system. They have to
cooperate and communicate to solve the problem. This communication adds complexity.
Abstraction
An abstraction is a tool that enables a designer to consider a component at an abstract level without
bothering about the internal details of the implementation. Abstraction can be used for existing element as
well as the component being designed.
1. Functional Abstraction
2. Data Abstraction
Functional Abstraction
ii. The details of the algorithm to accomplish the functions are not visible to the user of the function.
Functional abstraction forms the basis for Function oriented design approaches.
Data Abstraction
Details of the data elements are not visible to the users of data. Data Abstraction forms the basis
for Object Oriented design approaches.
Modularity
Modularity specifies to the division of software into separate modules which are differently named and
addressed and are integrated later on in to obtain the completely functional software. It is the only
property that allows a program to be intellectually manageable. Single large programs are difficult to
understand and read due to a large number of reference variables, control paths, global variables, etc.
o Each module is a well-defined system that can be used with other applications.
Advantages of Modularity
o It encourages the creation of commonly used routines to be placed in the library and used by other
programs.
o It simplifies the overlay procedure of loading a large program into main storage.
Disadvantages of Modularity
o More linkage required, run-time may be longer, more source lines must be written, and more
documentation has to be done
Modular Design
Modular design reduces the design complexity and results in easier and faster implementation by allowing
parallel development of various parts of a system. We discuss a different section of modular design in
detail in this section:
3. Information hiding: The fundamental of Information hiding suggests that modules can be
characterized by the design decisions that protect from the others, i.e., In other words, modules
should be specified that data include within a module is inaccessible to other modules that do not
need for such information.
The use of information hiding as design criteria for modular system provides the most significant
benefits when modifications are required during testing's and later during software maintenance.
This is because as most data and procedures are hidden from other parts of the software,
inadvertent errors introduced during modifications are less likely to propagate to different
locations within the software.
Strategy of Design
A good system design strategy is to organize the program modules in such a method that are easy
to develop and latter too, change. Structured design methods help developers to deal with the size
and complexity of programs. Analysts generate instructions for the developers about how code
should be composed and how pieces of code should fit together to form a program.
To design a system, there are two possible approaches:
1. Top-down Approach
2. Bottom-up Approach
1. Top-down Approach: This approach starts with the identification of the main components and
then decomposing them into their more detailed sub-components.
2. Bottom-up Approach: A bottom-up approach begins with the lower details and moves towards
up the hierarchy, as shown in fig. This approach is suitable in case of an existing system.
Module Coupling
In software engineering, the coupling is the degree of interdependence between software modules. Two modules
that are tightly coupled are strongly dependent on each other. However, two modules that are loosely coupled
are not dependent on each other. Uncoupled modules have no interdependence at all within them.
2. Data Coupling: When data of one module is passed to another module, this is called data coupling.
3. Stamp Coupling: Two modules are stamp coupled if they communicate using composite data items such as
structure, objects, etc. When the module passes non-global data structure or entire structure to another module,
they are said to be stamp coupled. For example, passing structure variable in C or object in C++ language to a
module.
4. Control Coupling: Control Coupling exists among two modules if data from one module is used to direct the
structure of instruction execution in another.
5. External Coupling: External Coupling arises when two modules share an externally imposed data format,
communication protocols, or device interface. This is related to communication to external tools and devices.
6. Common Coupling: Two modules are common coupled if they share information through some global data
items.
7. Content Coupling: Content Coupling exists among two modules if they share code, e.g., a branch from one
module into another module.
Module Cohesion
In computer programming, cohesion defines to the degree to which the elements of a module belong together.
Thus, cohesion measures the strength of relationships between pieces of functionality within a given module. For
example, in highly cohesive systems, functionality is strongly related.
Cohesion is an ordinal type of measurement and is generally described as "high cohesion" or "low cohesion."
Types of Modules Cohesion
1. Functional Cohesion: Functional Cohesion is said to exist if the different elements of a module, cooperate
to achieve a single function.
2. Sequential Cohesion: A module is said to possess sequential cohesion if the element of a module form the
components of the sequence, where the output from one component of the sequence is input to the
next.
0
00
3. Communicational Cohesion: A module is said to have communicational cohesion, if all tasks of the
module refer to or update the same data structure, e.g., the set of functions defined on an array or a
stack.
4. Procedural Cohesion: A module is said to be procedural cohesion if the set of purpose of the module are
all parts of a procedure in which particular sequence of steps has to be carried out for achieving a goal,
e.g., the algorithm for decoding a message.
5. Temporal Cohesion: When a module includes functions that are associated by the fact that all the
methods must be executed in the same time, the module is said to exhibit temporal cohesion.
6. Logical Cohesion: A module is said to be logically cohesive if all the elements of the module perform a
similar operation. For example Error handling, data input and data output, etc.
7. Coincidental Cohesion: A module is said to have coincidental cohesion if it performs a set of tasks that are
associated with each other very loosely, if at all.
Coupling Cohesion
Coupling is also called Inter-Module Binding. Cohesion is also called Intra-Module Binding.
Coupling shows the relationships between modules. Cohesion shows the relationship within the
module.
Coupling shows the relative independence between Cohesion shows the module's
the modules. relative functional strength.
While creating, you should aim for low coupling, While creating you should aim for high
i.e., dependency among modules should be less. cohesion, i.e., a cohesive component/ module
focuses on a single function (i.e., single-
mindedness) with little interaction with other
modules of the system.
In coupling, modules are linked to the other In cohesion, the module focuses on a single
modules. thing.
Design Notations
Design Notations are primarily meant to be used during the process of design and
are used to represent design or design decisions. For a function-oriented design, the
design can be represented graphically or mathematically by the following:
Data-flow diagrams are a useful and intuitive way of describing a system. They are generally
understandable without specialized training, notably if control information is excluded. They show end-
to-end processing. That is the flow of processing from when data enters the system to where it leaves the
system can be traced.
Data-flow design is an integral part of several design methods, and most CASE tools support data-flow
diagram creation. Different ways may use different icons to represent data-flow diagram entities, but their
meanings are similar.
Data Dictionaries
A data dictionary lists all data elements appearing in the DFD model of a system. The data items listed contain all
data flows and the contents of all data stores looking on the DFDs in the DFD model of a system.
A data dictionary lists the objective of all data items and the definition of all composite data elements in terms of
their component data items. For example, a data dictionary entry may contain that the data grossPay consists of
the parts regularPay and overtimePay.
For the smallest units of data elements, the data dictionary lists their name and their type.
A data dictionary plays a significant role in any software development process because of the following reasons:
o A Data dictionary provides a standard language for all relevant information for use by engineers working
in a project. A consistent vocabulary for data items is essential since, in large projects, different engineers
of the project tend to use different terms to refer to the same data, which unnecessarily causes confusion.
o The data dictionary provides the analyst with a means to determine the definition of various data
structures in terms of their component elements.
Structured Charts
It partitions a system into block boxes. A Black box system that functionality is known to the user without the
knowledge of internal design.
Pseudo-code notations can be used in both the preliminary and detailed design phases. Using pseudo-code, the
designer describes system characteristics using short, concise, English Language phases that are structured by
keywords such as If-Then-Else, While-Do, and End.
Introduction: The software needs the architectural design to represents the design of
software. IEEE defines architectural design as “the process of defining a collection of
hardware and software components and their interfaces to establish the framework for the
development of a computer system.” The software that is built for computer-based systems
can exhibit one of these many architectural styles.
Each style will describe a system category that consists of :
Semantic models that help the designer to understand the overall properties of the
system.
The use of architectural styles is to establish a structure for all the components of the
system.
A data store will reside at the center of this architecture and is accessed frequently
by the other components that update, add, delete or modify the data present within
the store.
The figure illustrates a typical data centered style. The client software access a
central repository. Variation of this approach are used to transform the repository
into a blackboard when data related to client or data of interest for the client change
the notifications to client software.
This data-centered architecture will promote integrability. 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.
This kind of architecture is used when input data is 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 lines.
Pipes are used to transmitting 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 neighboring 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 does not allow applications that require greater user
engagement.
It is not easy to coordinate two different but related streams
3] Call and Return architectures: It is used to create a program that is easy to scale
and modify. Many sub-styles exist within this category. Two of them are explained below.
Other objects are aware of the implementation details of the object, allowing
changes to be made without having an impact on other objects.
5] Layered architecture:
A number of different layers are defined with each layer performing a well-defined
set of operations. Each layer will do some operations that becomes closer to
machine instruction set progressively.
At the outer layer, components will receive the user interface operations and at the
inner layers, components will perform the operating system
interfacing(communication and coordination with OS)
In SA/SD, the software development process is divided into two phases: Structured
Analysis and Structured Design. During the Structured Analysis phase, the problem to be
solved is analyzed and the requirements are gathered. The Structured Design phase
involves designing the system to meet the requirements that were gathered in the
Structured Analysis phase.
2. Data Flow Diagrams (DFDs): SA/SD uses DFDs to model the flow of data through
the system. DFDs are graphical representations of the system that show how data
moves between the system’s various components.
4. Structured Design: SA/SD uses structured design techniques to develop the system’s
architecture and components. It involves identifying the major components of the
system, designing the interfaces between them, and specifying the data structures
and algorithms that will be used to implement the system.
Some advantages of SA/SD include its emphasis on structured design and documentation,
which can help improve the clarity and maintainability of the system. However, SA/SD
has some disadvantages, including its rigidity and inflexibility, which can make it difficult
to adapt to changing business requirements or technological trends. Additionally, SA/SD
may not be well-suited for complex, dynamic systems, which may require more agile
development methodologies.
3. Data Modeling: During this phase, a data model is created to represent the data used
in the system and the relationships between data elements.
4. Process Modeling: During this phase, the processes within the system are modeled
using flowcharts and data flow diagrams.
5. Input/Output Design: During this phase, the inputs and outputs of the system are
designed, including the user interface and reports.
6. Structured Design: During the Structured Design phase, the system is designed to
meet the requirements gathered in the Structured Analysis phase. This may include
selecting appropriate hardware and software platforms, designing databases, and
defining data structures.
SA/SD has been largely replaced by more modern software development methodologies,
but its principles of structured analysis and design continue to influence current software
development practices. The method is known for its focus on breaking down complex
systems into smaller components, which makes it easier to understand and manage the
system as a whole.
Basically, the approach of SA/SD is based on the Data Flow Diagram. It is easy to
understand SA/SD but it focuses on well-defined system boundary whereas the JSD
approach is too complex and does not have any graphical representation.
SA/SD is combined known as SAD and it mainly focuses on the following 3 points:
1. System
2. Process
3. Technology
1. Analysis Phase:
Analysis Phase involves data flow diagram, data dictionary, state transition diagram, and
entity-relationship diagram.
For example, if we have to choose between two paths of a process we can add an operator
or and if two data flows are necessary for a process we can add an operator. The input of
the process “check-order” needs the credit information and order information whereas the
output of the process would be a cash-order or a good-credit-order.
2. Data Dictionary:
The content that is not described in the DFD is described in the data dictionary. It
defines the data store and relevant meaning. A physical data dictionary for data
elements that flow between processes, between entities, and between processes and
entities may be included. This would also include descriptions of data elements that
flow external to the data stores.
A logical data dictionary may also be included for each such data element. All system
names, whether they are names of entities, types, relations, attributes, or services, should
be entered in the dictionary.
4. ER Diagram:
ER diagram specifies the relationship between data store. It is basically used in
database design. It basically describes the relationship between different entities.
2. Design Phase:
1. Structure Chart:
It is created by the data flow diagram. Structure Chart specifies how DFS’s
processes are grouped into tasks and allocated to the CPU. The structured chart does
not show the working and internal structure of the processes or modules and does
not show the relationship between data or data flows. Similar to other SASD tools, it
is time and cost-independent and there is no error-checking technique associated
with this tool. The modules of a structured chart are arranged arbitrarily and any
process from a DFD can be chosen as the central transform depending on the
analysts’ own perception. The structured chart is difficult to amend, verify,
maintain, and check for completeness and consistency.
1. Clarity and Simplicity: The SA/SD method emphasizes breaking down complex
systems into smaller, more manageable components, which makes the system easier
to understand and manage.
4. Better Testability: The SA/SD method provides a clear definition of the inputs and
outputs of a system, which makes it easier to test the system and ensure that it meets
its requirements.
2. Inflexibility: Once a system has been designed using the SA/SD method, it can be
difficult to make changes to the design, as the process is highly structured and
documentation-intensive.
3. Limited Iteration: The SA/SD method is not well-suited for iterative development,
as it is designed to be completed in a single pass.