0% found this document useful (0 votes)
24 views29 pages

Unit 3

Uploaded by

velvetpie24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views29 pages

Unit 3

Uploaded by

velvetpie24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 29

Unit-3

Software Design Process –


What is Software Design
Process?
The process of designing software is called Software Design
Process. In this process, the design document is created
based on the requirements of the user.
Using the software design process, a programmer can write
and implement code.
Software design is the first phase of the SDLC (Software
Development Life Cycle) .
The software design process is used in every SDLC model. In
this, an SRS (Software Requirement Specification) document
is created to identify the user requirements.
The output of the software design process can be used in
programming languages. The concept of software design
process was introduced by Mr. It was introduced by Mitch
Kapoor.

Levels of Software Design


Process – Levels of Software
Design Process
It has three levels:-
1- Architectural Design
The architecture of software tells about the entire structure
of the software. Architectural design describes how the
components of software interact with each other.
In this, different types of components communicate with
each other. In this, all types of components share or
exchange information or data with each other.
2- High-level design
This is the second level of the software design process in
which structure chart and UML techniques are used.
In high level design, the software is divided into different
modules and relationships between these modules are
identified.
3- Detailed design
This is the third and last phase of software design in which
each module is examined to design the data structure and
algorithm.
The detailed design contains information related to how the
components of the system will share information among
themselves.
Objectives of Software Design
– Objectives of Software
Design
It has the following objectives:-
1- Correctness
The design should always be correct.
2- Efficiency
All resources related to software should be used
efficiently. This includes things like time, cost and resources.
3- Understandability
A good software design is one that can be easily understood
by the user.
4- Completeness
A good software should include all the components of design
like:- data structure, module and external interface etc.
5- Maintainability
A good software design is one that can be easily changed.
Software Design Principles

Software design is a very important phase in the Software


Development Life Cycle (SDLC) . Software design principles
facilitate handling the complexity of the design process
effectively. Due to this, the effort required in designing is also
reduced and the errors occurring during design are also
reduced.
Following are the software design principles.
1:- Problem Partitioning
When a problem is small, we can solve it in one go. But when
there is a big problem, then that problem is divided into small
pieces and these pieces are solved separately.
Benefits of problem partitioning
 With this the software can be understood easily.
 Software becomes simple.
 Software is easy to test.
 The software can be easily modified.
 Maintaining the software becomes easy.
 Software is easy to expand.
But the thing to be noted here is that the more the
number of pieces increases, the more will be the cost
and complexity involved in them.
2:- Abstraction
Getting information about software parts from outside is
called abstraction. This is a tool that the designer uses for
elements in the abstraction level.
Through abstraction, the important information is extracted
and the remaining information is removed.
There are two types of abstraction:-
 Functional abstraction:- It consists of a collection of
subprograms which are called groups. The routines
present in these groups are either visible or
hidden. Visible routine can be used in outside groups
also but we cannot use hidden routine in outside groups
because it is hidden for other groups.
 Data abstraction:- In this, the details (information) of
data elements are not visible to the users of the data.

3:- Modularity
Modularity is achieved by dividing software into components
with a specific name and address. These components are
also called modules. The modules are later integrated to
obtain functional software. It is very difficult to understand
and read very large programs.

Advantages of modularity:-
 Through this, different people can write a big program.
 Through this, you can create the most commonly used
programs and save them in the library. So that it can be
used in other programs.
 This makes the process of loading large programs
easier.
 It provides a framework for complete testing.
 It provides well-designed and easy-to-read programs.

:- Design strategy
There are two types of design strategy:-
 top-down approach
 bottom-up approach
In top down approach, first the main components are
identified and then they are divided into sub-components. In
the bottom-up approach, it starts from the bottom up.

Modular design – What is


modular design?
Modular design is an approach that breaks a system into
smaller parts called modules. It is created independently and
then used in different systems.
Through this we can customize, repair, upgrade and reuse
the designs.
In other words, “It takes a design and divides it into small
parts and then combines these small parts to form a larger
system.”
Modular design is very beneficial and durable due to
reusability.
By using modular design and reusable patterns in our design
workflow, we can improve the consistency and quality of the
platform.
advantage of modular design
in – its benefits
Its advantages are as follows:-
1. This saves time.
2. It reduces the cost.
3. This design is very safe because the risks in it are very
less.
4. This requires very few resources.
5. Its quality is very high.
6. Due to reusability, we can use it in different systems
which is very beneficial.
Software Engineering | Structure
Charts
Structure Chart represent hierarchical structure of modules. It
breaks down the entire system into lowest functional modules,
describe functions and sub-functions of each module of a system to
a greater detail. Structure Chart partitions the system into black
boxes (functionality of the system is known to the users but inner
details are unknown). Inputs are given to the black boxes and
appropriate outputs are generated.
Modules at top level called modules at low level. Components are
read from top to bottom and left to right. When a module calls
another, it views the called module as black box, passing required
parameters and receiving results.
Symbols used in construction of structured chart
1. Module
It represents the process or task of the system. It is of three
types.
2. Control Module
A control module branches to more than one sub module.
3. Sub Module
Sub Module is a module which is the part (Child) of another
module.
4. Library Module
Library Module are reusable and invokable from any module.

1. Conditional Call
It represents that control module can select any of the sub
module on the basis of some condition.
2. Loop (Repetitive call of module)
It represents the repetitive execution of module by the sub
module.
A curved arrow represents loop in the module.

All the sub modules cover by the loop repeat execution of


module.
3. Data Flow
It represents the flow of data between the modules. It is
represented by directed arrow with empty circle at the end.
4. Control Flow
It represents the flow of control between the modules. It is
represented by directed arrow with filled circle at the end.

What is pseudo code? (What is Pseudo


Code )
Pseudo Code is a text based program design
language, it is a type of language that helps the
developer to understand the algorithms of that code
even before writing the code.

Pseudo code is an informal language, with the help of


which, before writing any code, we can write its
description in our language like English, or any other
language.

“ Pseudo code is also a similar technique, which is


used to plan the logic of a program. Pseudo code is
such instructions with the help of which the developer
can plan the logic of a program even before writing it.
So that it becomes easier for him while writing the
program. ,

Pseudo Code Syntax and Rules -:


There is a structure for writing every code, in which it is
already decided how elements like symbols,
brackets, data types , variables etc. are to be written.
This structure of writing the code is called syntax.
In almost every coding language, every code block has
some syntax, but there is no fixed syntax in pseudo
code .

Pseudo code has to be written in such a way that it can


be understood even by a person who does not have
much knowledge of coding.

Pseudo code does not have any syntax, but there are
some rules for writing it, which we should follow while
writing pseudo code, so that we can write a good
pseudo code and which any person can easily
understand.

The rules we should follow while writing pseudo code


are as follows -:

 While writing pseudo code, we should write only


one statement in a line, writing more than one
statement makes our pseudo code look very ugly
and makes a lot of difference to its readability.
 The initial words of the statement i.e. main
operations should be written in capital letters, so
that the coder can easily understand the main
operations like IF, ELSE etc.
 While writing pseudo code, the steps should be
written very well, so that it can be understood
clearly which step will happen after which step.
 Programming codes should not be written
excessively in statements, simple language should
be used more, writing excessive codes reduces the
readability of pseudo code.
 If there is more than one section in your pseudo
code then you should use end keyword while
ending those sections, this helps the coder to know
where to close the step while coding.
Example of Pseudo Code
To understand Pseudo code better, let us look at an
example, below is a basic Java program which contains
the code of main() function, in which IF, ELSE
statements have been used -:

Code -:
int marks = 30;
if (marks>32){
System.out.println("Congrats, You Are Passed");
}
else{
System.out.println("Sorry, You Are Failed");
}

This is a very basic Java program, the work of this


program is to find out whether a student has passed or
failed in the marks he has got.

Well, in this Java program we can also take input from


the user for marks by using scanner, but in this we
have already assigned 30 marks inside the code so that
those who have less knowledge of coding do not get
confused.

So now you have seen the above code, let us now


know how to write its pseudo code ?

So we can write the pseudo code of this program


in this way -:
// Program for Finding Whether Student is Pass or Failed:
IF marks is greater than 32
PRINT “Congrats, You Are Passed”
ELSE
PRINT “Sorry, You Are Failed”
IF END
Flowchart – What is flowchart?
 Displaying an algorithm or program in the form of
pictures is called Flowchart. That is, in the flowchart, the
algorithm or program is displayed with the help of
pictures.

 Flowcharts prove to be very useful in writing programs,


through this we can understand difficult programs
easily.

 Many symbols are used in the flowchart which show the


flow of the program.

 It helps the user to understand complex processes. It


helps to understand and solve a problem step by step.

 Flowcharts are used in programming to perform many


tasks such as – in creating programs, debugging
programs, and solving difficult programs.
Flowchart Symbols – Symbols
of Flowchart
It has many symbols which are given below: -
Start/Stop Symbol - This symbol is used at the beginning
and end of each algorithm. This is the first and last symbol of
each flowchart. Its picture is oval. It is also known as terminal
symbol.

start-stop symbol
Input/Output Symbol – In this the input symbol is used to
represent the input and the output symbol is used to
represent the output. Its picture is a parallelogram
(parallelogram).

input output symbol


Processing Symbol – It is used to represent mathematical
operations such as – multiplying, dividing, adding,
subtracting etc. Its picture is a rectangle.

processing
symbol
Decision Symbol – It is used to take a decision. There are
decisions like true / false or yes / no. Its picture is diamond
(rhombus).
decision symbol
Connector Symbol – This symbol is used to connect two or
more parts of the flowchart. Its picture is circle.

connector symbol

Flow Line Symbol - It is used to display the sequence of the


flowchart. Its picture is arrow (arrow) and the direction of this
arrow can be up, down, right, left.
flow line symbol
Hexagon Symbol – This symbol is also called preparation
symbol. It is used to introduce for loop, while loop, or other
loops. Its picture is a hexagon.

hexagon symbol
Document Symbol - It is used to display the document. Its
picture is given below.

document symbol
Advantages of Flowchart
1- It helps to understand the logic of a program.
2- Through this we can easily design any program and
software.
3- Flowchart helps in debugging.
4- Using this the program can be easily analyzed.
5- It helps the programmer to write the code of high-level
language like- Java, C, C++ etc.
6- It helps in maintaining the documents.
7- Documents can be collected and stored using flowcharts.
8- It helps in testing of software .
9- With the help of flowchart, it is easy to maintain the
program.
Rules for creating a flowchart
There are some rules for making flowchart which we should
follow.
 There can be only one start and stop symbol in a
flowchart.
 Only conventional symbols should be used in this.
 Name and variable should be used in flowchart.
 If the flowchart is large and difficult, then connector
symbols should be used in it.
Example of flowchart –
The flowchart of sum and average of three numbers is given
below:-
Questions asked in the exam
What is flowchart?

This is the graphical representation of the program. It is used


to display the program through diagrams.
How many symbols are there in flowchart?

It has many symbols such as start/stop, rectangle etc.

coupling and cohesion


If the design of the software is good then the software
quality is better and there are many ways to analyze the
software design like-coupling, cohesion, factoring, system
shape etc.
Cohesion-

Cohesion is a measurement that defines the degree of intra-


dependability of elements within a module.
That is, in cohesion it is seen how closely the elements of a
module are related to each other. That is, how deep is the
relationship of the elements of the modules with each other.
The more cohesion there is, the better the software design
will be.
The greater the cohesion of the module, the lesser will be the
coupling between modules.
Types of cohesion -

Cohesion is of the following types.


1- coincidental

2- logical

3- temporal

4- procedural

5- communicational

6- sequential

7- functional
1- Coincidental cohesion- This cohesion is the lowest level
of cohesion. This occurs when there is no relationship
between the elements of the module. This occurs when the
program is broken into smaller modules.
2- Logical cohesion- Logical cohesion in a module occurs
when there is a logical relationship between the elements of
a module. And elements perform functions placed in the
same logical class.
3- Temporal cohesion- This cohesion is like logical
cohesion but in this the elements should be executed at the
same time. Temporal cohesion is of a higher level than
logical cohesion because elements are processed at the
same time.
4- Procedural cohesion- When the elements of a module
are grouped together, they are executed in a sequence to
complete a task, this is called procedural cohesion.
5- Communicational cohesion- When the elements of a
module are grouped together and executed in sequence to
complete a task and all these elements work on data
(information) at the same time, then it is called
communicational cohesion.
6- Sequential cohesion- When the elements of a module
are grouped together because the output of one element is
like input for another element, then we get sequential
cohesion.
7- Functional cohesion- This is the highest level of
cohesion. All the elements of the module are related to
performing a function.
Coupling-
Coupling is a measurement that defines the level of inter-
dependability between modules of a program.
That is, it is a type of measurement that defines how the
components of the software depend and interact with each
other.
The less coupling the better the software design.
Types of coupling -

Coupling is of the following types:


1- content coupling
2- common coupling
3- external coupling
4- control coupling
5- stamp coupling
6- data coupling
1- Content Coupling- Content Coupling is the highest level
of coupling, it happens when a module depends on the
internal functioning of another module. This means that if
there is any change in another module, there will be a
change in that dependent module also.
2- Common coupling- It is also called global coupling. It
occurs when the same global data is shared by two
modules. In this, changes will occur in both the modules
when changes are made in the global data.
3- External coupling- This type of coupling occurs when the
external data format and communication protocol are shared
by two modules.
4- Control coupling- In this type of coupling, one module
controls the flow of another module and sends data from one
module to another.
5- Stamp coupling – In this type of coupling, many
modules share the same type of data structure and work in
different parts of it.
6- Data coupling- Data coupling between two modules will
happen when data will pass only between them.

Function Oriented Design


Function Oriented design is a method to software design where
the model is decomposed into a set of interacting units or
modules where each unit or module has a clearly defined
function. Thus, the system is designed from a functional
viewpoint.

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 dictionary:-
In a DBMS, a data dictionary is a file or group of files that
stores the metadata of the database.
The data dictionary does not contain the actual data of the
database, rather it only stores information (such as table
names and descriptions, etc.) in the form of ledgers to
manage the data.
Without data dictionary, dbms cannot access data from the
database.
Data dictionary is also called metadata and the data that
provides information about the data is called metadata.

Data dictionary is used to control database operations, data


integrity and accuracy.
There are two types of data dictionary:-
1:-Active data dictionary
2:-Passive data dictionary
1:-Active data dictionary:- The data dictionary which is
automatically updated by the DBMS all the time is called
Active data dictionary.
2:-Passive data dictionary:- Passive data dictionary is also
similar to active data dictionary but in this it is not
automatically updated by DBMS.

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.
Structured Chart is a graphical representation which shows:

o System partitions into modules


o Hierarchy of component modules
o The relation between processing modules
o Interaction between modules
o Information passed between modules

The following notations are used in structured chart:


Object-Oriented Design
In the object-oriented design method, the system is viewed as a
collection of objects (i.e., entities). The state is distributed among
the objects, and each object handles its state data. For example,
in a Library Automation Software, each library representative may
be a separate object with its data and functions to operate on
these data. The tasks defined for one purpose cannot refer or
change data of other objects. Objects have their internal data
which represent their state. Similar objects create a class. In other
words, each object is a member of some class. Classes may
inherit features from the superclass.

The different terms related to object design are:


1. Objects: All entities involved in the solution design are
known as objects. For example, person, banks, company,
and users are considered as objects. Every entity has some
attributes associated with it and has some methods to
perform on the attributes.
2. Classes: A class is a generalized description of an object. An
object is an instance of a class. A class defines all the
attributes, which an object can have and methods, which
represents the functionality of the object.
3. Messages: Objects communicate by message passing.
Messages consist of the integrity of the target object, the
name of the requested operation, and any other action
needed to perform the function. Messages are often
implemented as procedure or function calls.
4. Abstraction In object-oriented design, complexity is
handled using abstraction. Abstraction is the removal of the
irrelevant and the amplification of the essentials.
5. Encapsulation: Encapsulation is also called an information
hiding concept. The data and operations are linked to a
single unit. Encapsulation not only bundles essential
information of an object together but also restricts access to
the data and methods from the outside world.
6. Inheritance: OOD allows similar classes to stack up in a
hierarchical manner where the lower or sub-classes can
import, implement, and re-use allowed variables and
functions from their immediate superclasses.This property of
OOD is called an inheritance. This makes it easier to define a
specific class and to create generalized classes from specific
ones.
7. Polymorphism: OOD languages provide a mechanism
where methods performing similar tasks but vary in
arguments, can be assigned the same name. This is known
as polymorphism, which allows a single interface is
performing functions for different types. Depending upon
how the service is invoked, the respective portion of the
code gets executed.

What is system
design?
System design is a process of defining the architecture,
modules, interfaces and data for a system.
In other words, “System design is the process of defining the
elements of a system. Such as:- architecture, modules, and
components”
It is the process of defining, developing, and designing
systems to meet the specific needs of a business or
organization.
The main objective of system design is to provide adequate
data and information about the system. And the system
elements have to be implemented well with the models and
views of the architecture.
Elements of a system
(Elements of a system)
 Architecture:- It is a conceptual model that defines the
structure, behavior and views of a system. We can use
flowcharts to present and explain architecture.
 Modules:- These are components that handle a
particular type of tasks in the system. The combination
of modules forms a system.
 Components: – It provides any one function or group of
related functions. These are made up of modules.
 Interfaces: – This is the boundary through which the
components of the system exchange information among
themselves.
 Data:- This is the management of information and data
flow.

Techniques for performing


system design
There are many techniques to perform system design which
are as follows:-
1. Bottom Up Approach
In this approach the design starts with the lowest level
components and subsystems. Using these components,
further higher level components are created. This process
continues until all the components and subsystems are
combined into a single component. Which we call a fully
formed system.
The more abstraction increases in this, the higher the level of
design will be.
Its benefits:-
 In this the components can be reused.
 It is easy to identify the risk in this.
 It can be used to hide low-level details of
implementation. And can merge with top-down
technology.
2. Top Down Approach
In this, each system is divided into many subsystems and
components. And further each subsystem is also divided into
groups of subsystems and components.
This process of dividing helps in forming a hierarchical
structure of the system.
In simple words, “In this the system gets divided into many
subsystems and components and the same happens with
each subsystem. This process continues until the lowest level
system is reached.”
In this, a complete system is defined at the beginning of the
design. And after that the definitions of subsystems and
components are continuously entered. And when all the
definitions come together. So it becomes a complete system.
Its advantages:-
 Its main advantage is that its entire focus is on the
requirements so that a responsive design can be
created as per the needs.
 Errors coming in the interface can be easily handled,

McCabe’s Complexity
McCabe's complexity is called cyclomatic complexity. This is
a software metric. This complexity is used to determine the
complexity of a software program.
Cyclomatic complexity measures the number of independent
paths directly through the program's source code. The
greater the number of independent paths, the more complex
the code will be.
Independent paths are those paths which have at least one
edge and which have not been traversed before.
This complexity was proposed by Thomas McCabe in 1976.
This can be understood mathematically as follows:-
[McCabe's complexity V(G) = E – N + 2]
where;
E=number of edges
N=number of vertices
P=number of disconnected paths.
Fig:-ex of cyclomatic complexity

properties of McCabe’s
complexity:-
It has the following properties:-
1:- V (G ) >= 1
2:- V(G) is the maximum number of independent paths in the
graph.
3:-If V(G)=1 then there will be only one path in the graph.
4:-It reduces the complexity by 10.

You might also like