Unit 3
Unit 3
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.
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.
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.
Code -:
int marks = 30;
if (marks>32){
System.out.println("Congrats, You Are Passed");
}
else{
System.out.println("Sorry, You Are Failed");
}
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).
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
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?
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 -
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.
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:
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.
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.