Software Engineering Unit-3 - 1
Software Engineering Unit-3 - 1
(KCS 601)
Lecture Notes
SOFTWARE DESIGN
Software design is the practice of taking a specification of externally observable behavior
and adding details needed for actual computer system implementation, including human
interaction, taskmanagement, and data management details.
Software design is a kind of problem solving. Thinking about design as problem solving has
many advantages.
First it suggests that information may be partitioned between the problem and the solution.
A second advantage of thinking about design as problem solving is the perspective it gives on
the design activity.
A third advantage of thinking about design as problem solving is that it suggests the use of
time honoured general problem solving techniques in design.
Design must specify systems that satisfy product requirements in accord with
designconstraints.
Designs must specify systems that can be constructed on time and within budget
Designs that specify systems that are easy to change are better.
Modules should not be too big
Software design problems and solutions are often complex, and many aspects of software
systems mustbe modelled.
Static Models
o These models represent aspects of software systems that do not change during execution.
Examples – object and class diagrams, use case diagrams, data structure pictures,
implementationdiagrams.
Dynamic Model
Examples – interaction diagrams, state charts, DFDs, decision trees and tables, mini specs.
The software design process can be decomposed mainly into the following three levels of design:
a) Interface Design
b) Architecture Design
c) Detailed Design
a) Interface Design
Interface design is the specification of the interaction between a system its environment.
This phase proceeds at a high level of abstraction with respect to inner workings of the
system.
Attention is focused on the dialogues between target system and the users, devices,
and other systemswith which interacts.
b) Architectural Design
Large systems are always decomposed into subsystems that provide some related set of services.
The initial design process of identifying these sub-systems and establishing a framework for sub-
system control and communication is called architectural design.
Architectural design methods look into various alternate architectural style of designing a system.
These are:
Data centric architecture approach involves the use of a central database operations of
inserting, updating it in the form of a table.
Data flow architecture is applied when input data takes the form of output after passing
through various phases of transformations. These transformations can be through various
computations done on data.
In Object oriented architecture, the software design moves around the classes and objects of
the system. The class encapsulates the data and methods.
Layered approach defines the number of layers and each layer performs tasks. The
outermost layer handles the functionality of user interface and the innermost layer handles
interaction with the hardware.
c) Detailed Design
Also known as Low Level Design. It is the specification of the internal elements of all major system
components, their structure properties,relationships, processing and other their algorithms and
data structures.
Modularization
Modularization is the process of separating the functionality of a program into independent,
interchangeable modules, such that each contains everything necessary to execute only one
aspect of the desired functionality.
With modularization, we can easily work on adding separate and smaller modules to a
program without being hindered by the complexity of its other functions.
Advantages of Modularity
Modular systems are easier to understand and explain because their parts make
sense and canstand on their own.
They are easier to document because each part can be documented as an independent
unit.
Well composed modules are more reusable because they are more likely to
comprise part of a solution to many problems.
Algorithm
An Algorithm is a sequence of computational steps that transform the input into the output.
The algorithm describes a specific computational procedure for achieving that input/output
describes a specific computational procedure for achieving thatinput/ output relationship.
Characteristics of Algorithm
1. Finiteness. An algorithm must always terminate after a finite number of steps.
2. Definiteness. Each step of an algorithm must be precisely defined; the actions to be carried
out must be rigorously and unambiguously specified for each case.
3. Input. An algorithm has zero or more inputs, i.e., quantities which are given to it initially
before the algorithm begins.
4. Output. An algorithm has one or more outputs i.e., quantities which have a specified relation
to the inputs.
5. Effectiveness. An algorithm is also generally expected to be effective. This means that all of
the operations to be performed in the algorithm must be sufficiently basic that they can in
principle be done exactly and in a finite length of time.
Algorithm Design Documentation Tools
• Flowcharts
• Structure Charts
Pseudocode
A pseudocode is an informal way of writing a program. However, it is not a computer program. It
only represents the algorithm of the program in natural language and mathematical notations.
Besides, there is no particular programming language to write a pseudocode. Unlike in regular
programming languages, there is no syntax to follow when writing a pseudocode. Furthermore, it is
possible to use pseudocodes using simple English language statements.
Sum_Of_Two_Numbers()
Begin
Set sum =0;
Read: number 1, number 2;
Set sum = number1 + number 2;
Print sum;
End
Area_of_Trinagle()
Begin
Read: base, height;
Set area = 0.5 * base * height;
Print area;
End
So, after writing the pseudocode, we can write the actual program using that pseudocode. Moreover,
as it represents the algorithm, we can implement it using any programming language.
Advantages
• It is easy to understand even a complex program
• It does not follow any programming language syntax
• Programs can be easily generated by pseudo-code
• It allows us to understand the logic of a program very quickly
• Pseudo-code can be modified easily
Disadvantages
• Unlike the programs, a pseudo-code cannot be compiled or interpreted from which errors
cannot be identified
• As pseudo-code can be written in any order, so it becomes difficult to understand the flow of
a program
Flowchart
A flowchart represents an algorithm using a diagram. Flow charts, use rectangles, ovals, diamonds
and potentially numerous other shapes to define the type of step, along with connecting arrows to
define flow and sequence. They are widely used in multiple fields to document, study, plan, and
communicate often complex processes in clear, easy-to-understand diagrams.
In it, the oval shape denotes the start and end. And, the rhombus shape represents inputs and
outputs. Entering marks is an input while displaying marks is an output. Further, the diamond shape
symbol represents the decision selection. Depending on the decision, the correct output will be
displayed.
Flow Chart
In overall, a flow chart represents the sequence of steps to follow in order to solve the problem.
Thus, the flowchart diagrams are easier to draw and understand.
Advantages of Flowchart
• Effective Communication: Flowcharts are better way of communicating the logic of the
system.
• Effective Analysis: Flowchart which gives broad idea about the logic so that problem can be
analyzed more efficiently.
• Easy Debugging and Efficient Testing: The Flowchart helps in debugging and testing process.
• Efficient Coding: The flowcharts are very useful during program development phase.
• Proper Documentation: Flowcharts serves as a good program documentation, which is
needed for various purposes.
• Efficient Program Maintenance: Maintenance of operating programs becomes easy with the
help of flowchart.
Disdvantages of Flowchart
• Complex Logic: For complicated logic, flowchart becomes complex and clumsy.
• Difficulty in Modifications: If change is required in the logic then flowchart needs to be
redrawn and requires a lot of time.
Structure Charts
A Structure Chart is a chart which shows the breakdown of a system to its lowest manageable parts.
They are used in structured programming to arrange program modules into a tree. Each module is
represented by a box, which contains the module's name. The tree structure visualizes the
relationships between modules, showing data transfer between modules using arrows. Structured
Charts are an example of a top-down design where a problem (the program) is broken into its
components. The tree shows the relationship between modules, showing data transfer between the
models.
• Condition - It is represented by small diamond at the base of module. It depicts that control
module can select any of sub-routine based on some condition.
• Jump - An arrow is shown pointing inside the module to depict that the control will jump in
the middle of the sub-module.
• Loop - A curved arrow represents loop in the module. All sub-modules covered by loop
repeat execution of module.
• Data flow - A directed arrow with empty circle at the end represents data flow.
• Control flow - A directed arrow with filled circle at the end represents control flow.