Unit 3 Software engineering
Unit 3 Software engineering
UNIT-3
Topics to be
covered...
Concept of Software Design
Architectural and Procedural Design
Modularization
Design Structure Charts
Pseudo Codes
Coupling and Cohesion Measures
Function Oriented Design
Object Oriented Design
Top-Down and Bottom-Up Design
Measurement and Metrics
Halestead’s Software Science
Function Point (FP) Based Measures
Cyclomatic Complexity Measures
Happy Ending!
Concept of
Software Design
Concept of Software
Design
Software design is a mechanism to transform user requirements into some suitable
form, which helps the programmer in software coding and implementation.
It allows the software engineer to create the model of the software that is to be
developed.
The software design phase is the first step in SDLC (Software Design Life
Cycle), which moves the concentration from the problem domain to the
solution domain.
General task involved in design process:
1. Design the overall the system processes.
2. Segmenting the system into smaller
modules. 3. Designing the database
structure.
4. Documenting the system design.
Concept of Software
Design
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.
Concepts of Software Design:
The software design concept simply means the idea or principle behind the design.
It describes how you plan to solve the problem of designing software, the logic, or
thinking behind how you will design software. It allows the software engineer to
create the model of the system or software or product that is to be developed or
built.
Architectural and
Procedural Design
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 output of this design process is a description of the software
architecture. Architectural design is an early stage of the system
design process.
It represents the link between specification and design processes and is often
carried out in parallel with some specification activities.
The tree shows the relationship between modules, showing data transfer
between the models. Data being passed from module to module that needs
to be processed.
Structure chart is a chart derived from a Data Flow Diagram. It represents the
system in more detail than DFD. It breaks down the entire system into lowest
functional modules, describes functions and sub-functions of each module of the
system to a greater detail than DFD.
Design Structure
Charts
Pseudo Codes
Pseudo Codes
Pseudo code uses the vocabulary of one language i.e, English and syntax of
another i.e, any structured programming language.
Pseudo code is a combination of algorithm written in a simple language and
programming language statements.
Using Pseudo code, the designer design describes system characteristics
structured by keywords such as IF-THEN-ELSE, while-do and end.
Advantages of Pseudo
Codes
Converting a Pseudo code to a programming language is much easier as
compared to converting to flowchart or decision table.
It is easier to modify whenever programmer modification are
necessary. Take less time to writing as compared to drawing
flow chart.
Done easily on Word Processor
Coupling
and Cohesion
Measures
Coupling
The coupling is the degree of interdependence between software modules. Two
modules that are tightly coupled are strongly dependent on each other. However,
two modules that are loosely coupled are not dependent on each other. Uncoupled
modules have no interdependence at all within them.
A good design is the one that has low coupling. Coupling is measured by the
number of relations between the modules. That is, the coupling increases as the
number of calls between modules increase. Thus, it can be said that a design with
high coupling will have more errors.
Coupling
Types of Module Coupling:
Coupling
Data Coupling:
When data of one module is passed to another module, this is called data coupling.
Stamp Coupling:
Two modules are stamp coupled if they communicate using composite data items
such as structure, objects, etc.
When the module passes entire structure to another module, they are said to be
stamp coupled. For example, passing structure variable in C or object in C++
language to a module.
Coupling
Control Coupling:
Control Coupling exists among two modules if data from one module is used to
direct the structure of instruction execution in another.
External Coupling:
External Coupling arises when two modules share an externally imposed data
format, communication protocols, or device interface. This is related to
communication to external tools and devices.
Common Coupling:
Two modules are common coupled if they share information through some global data
items.
Cohesion
Cohesion shows the relationship within
the module.
Cohesion is an ordinal type of measurement and is generally described as "high
cohesion" or "low cohesion."
Types of
Cohesion
Cohesion
1. Functional Cohesion: Functional Cohesion is said to exist if the different
elements of a module, cooperate to achieve a single function.
2. Sequential Cohesion: If the element of a module form the components of
the sequence, where the output from one component of the sequence is
input to the next.
3. Communicational Cohesion: If all tasks of the module refer to or update
the same data structure, e.g., the set of functions defined on an array or a
stack.
4. Procedural Cohesion: If the set of purpose of the module are all parts of
a procedure in which particular sequence of steps has to be carried out for
achieving a goal, e.g., the algorithm for decoding a message.
5. Temporal Cohesion: When a module includes functions that are associated
by the fact that all the methods must be executed in the same time.
6. Logical Cohesion: If all the elements of the module perform a similar
operation. For example Error handling, data input and data output, etc.
7. Coincidental Cohesion: If it performs a set of tasks that are associated with
each other very loosely, if at all.
Coupling Cohesion
Coupling is also called Inter-Module Cohesion is also called Intra-Module
Binding. Binding.
Coupling shows the relationships Cohesion shows the relationship within
between modules. the module.
In coupling, modules are linked to the In cohesion, the module focuses on a
other modules. single thing.
Function Oriented
Design
Function Oriented
Design
Function Oriented Design is an approach to software design where the design
is decomposed into a set of interacting units where each unit has a clearly
defined function.
Function Oriented
Design
Techniques used by Function Oriented
Design are:
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
Object Oriented
Design
Object-oriented design is the process of planning a system of interacting
objects for the purpose of solving a software problem. It is one approach to
software design.
In the object-oriented design method, the system is viewed as a collection of
objects (i.e., entities).
Top-Down
and Bottom-
Up Design
Top-Down and Bottom-Up Design
Measurement
and
Metrics
Measurement
A software metric is a measure of software characteristics which are
measurable or countable. Software metrics are valuable for many reasons,
including measuring software performance, planning work items, measuring
productivity, and many other uses.
Within the software development process, many metrics are that are all connected.
Software metrics are similar to the four functions of management: Planning,
Organization, Control, or Improvement.
Process Metrics:
Process metrics pay particular attention on enhancing the long term process of
the team or organization.
Project Metrics:
The project matrix describes the project characteristic and execution
process. Number of software developer
Staffing pattern over the life cycle of
software Cost and schedule
Productivity
Halestead’s
Software
Science
Halestead’s Software
Science
Measurement
Advantages:
Predicts error rate.
Predicts maintenance
effort Simple to
calculate
Measure overall
quality Used for any
language
Disadvantages:
Depends on complete code
Complexity increases as program level
decreases Difficult to compute
Function Point
(FP) Based
Measures
Function Point (FP) Based Measures
Function point is used in the estimation of software development cost which is the
most important potential use of function point data.
Organizations that use function point method develop criteria for determining
whether a particular entry is low, average or high.
Function Point (FP) Based Measures
There are three types of transaction functions.
External Inputs
External
Outputs
External
Inquiries
Advantages:
Size oriented
metrics
Language
dependent
Understood by the non technical user
To estimate cost and resources required for software development
Disadvantages:
Manually Counting
Process Difficult to
Understand
Requires Experience
Function Point (FP) Based Measures
Cyclomatic
Complexity
Measures
Cyclomatic Complexity Measures
Cyclomatic complexity is a software metric used to measure the complexity of a
program. It gives the quantitative measure of logical complexity of the program.
Disadvantages:
Measures program’s control complexity and not the data
complexity Nested conditional structures are harder to
understand
Ignore the size of the program