Software Design Concepts
Software Design Concepts
Concepts
SDD: What is a software design
document?
IEEE defines software design documentation as “a description of
software created to facilitate analysis, planning, implementation,
and decision-making”. In essence, a software design document
(SDD) explains how a software product or a feature will be built
to meet a set of technical requirements. If the requirements
document describes the “what” of your project, the design
document focuses on the “how”.
Why write a software design document?
Architectural Design:
The architecture of a system can be viewed as the
overall structure of the system & the way in which
structure provides conceptual integrity of the system.
The architectural design identifies the software as a
system with many components interacting with each
other. At this level, the designers get the idea of the
proposed solution domain.
Preliminary or high-level design:
Coupling shows the relationships between modules. Cohesion shows the relationship within the module.
Coupling shows the relative independence between the modules. Cohesion shows the module's relative functional strength.
While creating, you should aim for low coupling, i.e., dependency among While creating you should aim for high cohesion, i.e., a cohesive component/
modules should be less. 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 modules. In cohesion, the module focuses on a single thing.
Cyclomatic complexity of a code section is the
quantitative measure of the number of linearly
independent paths in it. It is a software metric used to
indicate the complexity of a program. It is computed using
the Control Flow Graph of the program. The nodes in the
graph indicate the smallest group of commands of a
program, and a directed edge in it connects the two nodes
i.e. if second command might immediately follow the first
command.
Forexample, if source code contains no control
flow statement then its cyclomatic complexity will
be 1 and source code contains a single path in it.
Similarly, if the source code contains one if
condition then cyclomatic complexity will be 2
because there will be two paths one for true and the
other for false.
Mathematically, for a structured program, the directed graph inside
control flow is the edge joining two basic blocks of the program as
control may pass from first to second.
So, cyclomatic complexity M would be defined as,
M = E – N + 2P
where,
E = the number of edges in the control flow graph
N = the number of nodes in the control flow graph
P = the number of connected components
Steps that should be followed in calculating
cyclomatic complexity and test cases design are:
• Construction of graph with nodes and edges from
code.
• Identification of independent paths.
• Cyclomatic Complexity Calculation
• Design of Test Cases
Let a section of code as such:
A = 10
IF B > C THEN
A = B
ELSE
A = C
ENDIF
Print A
Print B Control Flow
Graph of code:
Print C
The cyclomatic complexity
calculated for above code
will be from control flow
graph. The graph shows
seven shapes(nodes), seven
lines(edges), hence
cyclomatic complexity is 7-
7+2 = 2. (M = E – N + 2P )
Use of Cyclomatic Complexity:
1. Corrective maintenance:
Corrective maintenance of a software product may be essential
either to rectify some bugs observed while the system is in use, or to
enhance the performance of the system.
2. Adaptive maintenance:
This includes modifications and updations when the customers need
the product to run on new platforms, on new operating systems, or
when they need the product to interface with new hardware and
software.
Perfective maintenance:
A software product needs maintenance to support the new features
that the users want or to change different types of functionalities of
the system according to the customer demands.
Preventive maintenance:
This type of maintenance includes modifications and updations to
prevent future problems of the software. It goals to attend
problems, which are not significant at this moment but may cause
serious issues in future.
Reverse Engineering –