Function-Oriented Design
Function-Oriented Design
Module 3
Design
Correctness
• A software design is correct if a system built precisely according to
the requirements of the system
• A design should be verifiable (does an implementation match the
design), complete (does the design address its specified
requirements) and traceable (all design elements can be traced
back to specific requirements)
Efficiency
• Does the design efficiently make use of scarce resources: such as
memory on a wireless sensor
Maintainability and Simplicity
• How easy is it for the design of a system to be understood?
• Simpler designs make it easy for a developer to understand and
then maintain the system
Cost
• Does the design help to reduce costs in later phases of software
development?
• Can one design achieve the same quality as another design while
reducing costs?
Problem analysis Vs Design Principles
Abstraction
Modularity
Coupling
Cohesion
Coupling
“how strongly” different modules are interconnected
By definition,
“Coupling between modules is the strength of interconnections between
modules or a measure of interdependence among modules”
Shows how tightly bound the internal elements of the module are to
one another
Logical
Temporal
Procedural
Communicational
Sequential
Functional High
Details…
Coincidental Cohesion occurs when there is no meaningful
relationship among the elements of a module.
Back
Example 2: DFD for a word-counting
program
Back
Step 2: Identify the input and
output data elements
What we are looking for is the most abstract input elements (MAI)
and the most abstract output elements (MAO)
Figure1 Figure2
Step 3: First-Level Factoring
First-level factoring is the first step towards converting the DFD into
a structure chart
For each MAI data element, specify a subordinate input module that
delivers these items to the main module
Quality metrics
Simplicity – most important design quality attribute
Complexity metrics
Network Metrics
Stability Metrics
Information Flow Metrics
Network Metrics
Network metrics focus on the structure chart of a system
The creators of this metric argue that the higher the stability
of a design, the easier it is to maintain the resulting system
The term (inflow*outflow)2 refers to the total number of input and output
combinations, and this number is squared since the interconnections
between modules are considered more important to determining the
complexity of a module than its code size
Approach 2
Approach 1 depends largely on the amount of information flowing in and
out of the module
fan_in above refers to the number of modules that call this module,
fan_out is the number of modules called by this module
Classification
Neither of these metrics is any good, unless they can tell us when to
consider a module “too complex”
To this end, an approach was developed to compare a module's
complexity against the complexity of the other modules in its system
avg_complexity is defined as the average complexity of the modules
in the current design
std_deviation is defined as the standard deviation in the design
complexity of the modules in the current design
A module can be classified as error prone, complex, or normal using
the following conditions
Dc is the complexity of a particular module
A module is error prone if Dc > avg_complexity +
std_deviation
A module is complex if avg_complexity < Dc <
avg_complexity + std_deviation