Software Eng Unit 3
Software Eng Unit 3
Objectives:
1. Correctness:Software design should be correct as per
requirement.It should correctly implement all the functionalities of the
system.
2. Completeness:The design should have all components like data
structures, modules, and external interfaces, etc.
3. Efficiency:Resources should be used efficiently by the program.
4. Flexibility:Able to modify on changing needs.
5. Consistency:There should not be any inconsistency in the design.
6. Maintainability: The design should be so simple so that it can be
easily maintainable by other designers.
• Architectural Design - :
➢ 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 architectural design is the highest abstract version of the
system. It identifies the software as a system with many
components interacting with each other. At this level, the
designers get the idea of proposed solution domain.
• High-level Design- The high-level design breaks the ‘single entity-multiple
component’ concept of architectural design into less-abstracted view of
sub-systems and modules and depicts their interaction with each other.
High-level design focuses on how the system along with all of its
components can be implemented in forms of modules. It recognizes
modular structure of each sub-system and their relation and interaction
among each other.
• Detailed Design(Low Level Design)- Detailed design deals with the
implementation part of what is seen as a system and its sub-systems in the
previous two designs. It is more detailed towards modules and their
implementations. It defines logical structure of each module and their
interfaces to communicate with other modules.
Layered architecture:
Modularization:
• Modularization is a technique to divide a software system into
multiple discrete and independent modules, which are
expected to be capable of carrying out task(s) independently.
These modules may work as basic constructs for the entire
software. Designers tend to design modules such that they can
be executed and/or compiled separately and independently.
• Modular design unintentionally follows the rules of ‘divide and
conquer’ problem-solving strategy. This is because there are
many other benefits attached with the modular design of a
software.
Modularity has several key benefits:
• Reusability
If you discover you need the same functionality in a new project, you
can package the existing functionality into something reusable by
multiple projects without copying and pasting the code.
• Extensibility
Your software now runs as a set of independent components
connected by an abstraction layer.
Advantage of modularization:
a. Control Module
A control module branches to more than one sub module.
b. Sub Module
Sub Module is a module which is the part (Child) of another
module.
c. 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.
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.
5. Physical Storage
Physical Storage is that where all the information are to be stored.
Pseudo Codes:
Examples:
Advantages:
• Easily modified
• Implements structured concepts
• Done easily on Word Processor
Disadvantages:
• Not visual
• No accepted standard,varies from company to company
Flow Charts:
• Graphical representation of an Algorithm.
• First design tool to be widely used,but unfortunately they do not
reflect some of the concepts of structured programming very well.
• A traditional graphical tool with standardized symbols
Rules for Flowchart:
Advantages:
• Standardized
• Visual
Disadvantages:
• Hard to Modify
• Structured design elements not implemented
• Special software required
• It tells at what level the modules interfere and interact with each
other. The lower the coupling, the better the program.
• The degree of interdependence between two modules”
• Coupling is a measure that defines the level of inter- dependability
among modules of a program. It tells at what level the modules
interfere and interact with each other. The lower the coupling, the
better the program.
• Coupling is the measure of the interdependence of one module to
another. Modules should have low coupling.
• Low coupling minimizes the "ripple effect" where changes in one
module cause errors in other modules
Design Strategies:
• Data Flow Diagram(A data flow diagram (DFD) maps out the flow of
information for any process or system. )
• Data Dictionaries(Data dictionaries are simply repositories to store
information about all data items defined in DFDs. At the requirement
stage, data dictionaries contain data items.)
• Structure Charts(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)
• Pseudo Codes(It uses keywords and indentation. Pseudo codes are
used as replacement for flow charts. It decreases the amount of
documentation required.)
Object Oriented Design,
• 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 the object-oriented approach, the focus is on capturing the
structure and behavior of information systems into small modules that
combine both data and process. The main aim of Object Oriented
Design (OOD) is to improve the quality and productivity of system
analysis and design by making it more usable.
Top-Down and Bottom-Up Design:
Top Down Design
• We know that a system is composed of more than one subsystem
and it contains a number of components. Further, these subsystems
and components may have their own set of sub-system and
components and create hierarchical structure in the system.
• Top-down design takes the whole software system as one entity and
then decomposes it to achieve more than one sub-system or
component based on some characteristics. Each sub-system or
component is then treated as a system and decomposed further.
• This process keeps on running until the lowest level of the system in
the top-down hierarchy is achieved.
• They allow us to quickly and efficiently specify, design, synthesize
and verify designs ready for fabrication. The key to these
methodologies is synthesis, which relies on a mapping between the
logical functions we use in a design and the physical circuits that
realize the functions.
Advantages:
• The main advantage of the top-down approach is that its strong focus
on requirements helps to make a design responsive according to its
requirements.
Disadvantages:
• Project and system boundaries tend to be application specification-
oriented. Thus it is more likely that advantages of component reuse
will be missed.
• The system is likely to miss, the benefits of a well-structured, simple
architecture.
Bottom-up Design
• The bottom up design model starts with most specific and basic
components. It proceeds with composing higher level components by
using basic or lower level components.
• It keeps creating higher level components until the desired system is
not evolved as one single component. With each higher level, the
amount of abstraction is increased.
• Any design method in which the most primitive operations are
specified first and the combined later into progressively larger units
until the whole problem can be solved: the converse of TOP-DOWN
DESIGN.
• For example, a communications program might be built by first
writing a routine to fetch a single byte from the communications port
and working up from that.
• Bottom-up strategy is more suitable when a system needs to be
created from some existing system, where the basic primitives can
be used in the newer system.
• Both, top-down and bottom-up approaches are not practical
individually. Instead, a good combination of both is used.
Top Down Bottom Up
It starts from the bottom of the
A module cannot be tested in hierarchy. First the modules at the
isolation because they invoke very bottom, which have no
some other modules. To allow the subordinates, are tested. Then these
modules to be tested before their modules are combined with higher-
subordinates have been coded, level modules for testing. At any
stubs simulate the behavior of the stage of testing all the subordinate
subordinates. modules exist and have been tested
earlier.
Metrics:
Objectives of FPA
The basic and primary purpose of the functional point analysis is to measure and
provide the software application functional size to the client, customer, and the
stakeholder on their request. Further, it is used to measure the software project
development along with its maintenance, consistently throughout the project
irrespective of the tools and the technologies.
Types of FP Attributes
Examples
Measurements Parameters
2. FP characterizes the complexity of the software system and hence can be used to depict the
project time and the manpower requirement.
3. The effort required to develop the project depends on what the software does.
5. FP method is used for data processing systems, business systems like information systems.
6. The five parameters mentioned above are also known as information domain
characteristics.
7. All the parameters mentioned above are assigned some weights that have
been experimentally determined and are shown in Table
The functional complexities are multiplied with the corresponding weights against
each function, and the values are added up to determine the UFP (Unadjusted
Function Point) of the subsystem.
Here that weighing factor will be simple, average, or complex for a measurement
parameter type.
EI 3 4 6
EO 4 5 7
EQ 3 4 6
ILF 7 10 15
EIF 5 7 10
Cyclomatic Complexity
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.
For example, 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
• Print C
Control Flow Graph of above code
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.
Use of Cyclomatic Complexity:
• Determining the independent path executions thus proven to be very
helpful for Developers and Testers.
• It can make sure that every path have been tested at least once.
• Thus help to focus more on uncovered paths.
• Code coverage can be improved.
• Risk associated with program can be evaluated.
• These metrics being used earlier in the program helps in reducing the
risks.
Advantages of Cyclomatic Complexity:.
• It can be used as a quality metric, gives relative complexity of various
designs.
• It is able to compute faster than the Halstead’s metrics.
• It is used to measure the minimum effort and best areas of
concentration for testing.
• It is able to guide the testing process.
• It is easy to apply.
Disadvantages of Cyclomatic Complexity:
• It is the measure of the programs’s control complexity and not the data
complexity.
• In this, nested conditional structures are harder to understand than
non-nested structures.
• In case of simple comparisons and decision structures, it may give a
misleading figure.
• Program Difficulty
The difficulty level or error-proneness (D) of the program is
proportional to the number of the unique operator in the program.D=
(n1/2) * (N2/n2)