Modularity-Information
Hiding and functional
independence
PRESENTED BY,
GEETHU.T
ROLL NO.:12
Software Design Concepts
1. Abstraction
2. Architecture
3. Design Patterns
4. Modularity
5. Information Hiding
6. Functional Independence
7. Refinement
8. Refactoring
9. Object –Oriented Design Concept
MODULARITY
 Modularity simply means dividing the system or project into smaller parts to
Reduce the complexity of the system or project.
 After developing the modules ,they are integrated together to meet The
software requirements .
 Modularising a design helps to effective development , accommodate
changes easily, Conduct testing, debugging efficiently and Conduct
maintenance work easily.
Modularity
Information Hiding
Modules should be specified and Designed in such a way that the data
structures and algorithm details of one module are not accessible to other
modules
They pass only that much information to each other, which is required to
accomplish the software functions.
 The way of hiding unnecessary details in modules is referred to as
information hiding.
 Modules must be specified and designed so that the information like
algorithm and data presented in a module is not accessible for other
modules not requiring that information.
Information Hiding
Functional Independence
 The functional independence is the concept of separation and related to the concept of
modularity, abstraction and information hiding.
Criteria 1: Coupling
• Coupling is an indication of interconnection between modules in a structure of
software
• The degree in which module is "connected" to other module in the system.
• Low Coupling necessary in good software,
Criteria 2: Cohesion
• Cohesion is an extension of the information hiding concept
• The degree in which module perform functions in inner module in the system .
• High Cohesion necessary in good software.
Functional Independence
Coupling and Cohesion
COUPLING
 Coupling is the measure of the degree of interdependence or number of
relations between software modules .
 A good software will have low coupling.
 High coupling generates more errors because they shared large number of
data.
 Two modules that are tightly coupled are strongly dependent on each
other.
Types Of Coupling
1.Data Coupling
 When data are passed from one modules to another module via
argument list or parameters through functional blocks.
 If the dependency between the modules is based on the fact that they
communicate by passing only data, then the modules are said to be data
coupled.
 In data coupling, the components are independent to each other and
communicating through data.
 Example-customer billing system
1.Data Coupling
2.Stamp Coupling
 In stamp coupling, the complete data structure is passed from one
module to another module.
 Two modules are stamp coupled if they communicate using composite
data items such as Complete Data Structure & objects.
 No junk or unused data shared between the two coupling modules.
2.Stamp Coupling
3.Control Coupling
 If the modules communicate by passing control information, then they are
said to be control coupled.
 It can be bad if parameters indicate completely different behaviour and
good if parameters allow factoring and reuse of functionality.
 Control coupling handle functional flow between software modules.
 Example: Module 1- Set Flag = 1 then only Module 2 perform action.
3.Control Coupling
4.External Coupling
 In external coupling, the modules depend on other modules, external to the
software being developed or to a particular type of hardware.
 When two modules share an externally import data format, communication
protocols or device interface.
 This is related to communication to external tools and devices.
 Example-Protocol, external file, device format, etc.
5.Common Coupling
 Two modules are common coupled if they share information through some
global data items.
 The modules have shared data such as global data structures. The changes
in global data mean tracing back to all modules which access that data to
evaluate the effect of the change.
 So it has got disadvantages like difficulty in reusing modules, reduced ability
to control data accesses and reduced maintainability.
5.Common Coupling
6.Content Coupling
Here, Two modules are connected as they share the same content like functions,
methods.
 When a change is made in one module the other module needs to be
updated as well.
 In a content coupling, one module can modify the data of another module or
control flow is passed from one module to the other module.
 This is the worst form of coupling and should be avoided
6.Content Coupling
Cohesion
Cohesion defines to the degree to which the elements of a module belong together
or interrelated.
Thus, cohesion measures the strength of relationships between pieces of functionality
within a given module.
 A good software design will have high cohesion.
Or
 Cohesion is a measure of the degree to which the elements of the module are
functionally related. It is the degree to which all elements directed towards
performing a single task are contained in the component. Basically, cohesion is
the internal glue that keeps the module together. A good software design will
have high cohesion.
Types of Cohesion
1.Functional Cohesion
 Every essential element for a single computation is contained in the
component.
 A functional cohesion performs the task and functions.
 It is an ideal situation.
 If a single module aims to perform all the similar types of functionalities
through its different elements.
 The purpose of functional cohesion is single minded, high, strong and
focused.
 Example: Railway Reservation System
1.Functional Cohesion
2.Sequential Cohesion
 An element outputs some data that becomes the input for other element, i.e., data
flow between the parts. It occurs naturally in functional program.
 Output of one element treats as an input to the other elements inside the same
module.
 Example: Enter the numbers -> Perform Addition of that numbers -> Display
Addition.
3.Communicational Cohesion
 Two elements operate on the same input data or contribute towards
the same output data.
 If all the elements of a module are working on the same input &
output data and are accessing that data through the same data
structures.
 Example: Update record in the database and send it to the printer.
4.Procedural Cohesion
 Elements of procedural cohesion ensure the order of execution. Actions
are still weakly connected and unlikely to be reusable.
 All parts of a procedure execute in particular sequence of steps for
achieving goal.
 Example: Calling one function to another function, Loop statements.
Reading record, calculate student GPA, print student record, calculate
cumulative GPA, print cumulative GPA.
5.Temporal Cohesion
 The elements are related by their timing involved.
 A module connected with temporal cohesion all the tasks must be executed in the
same time-span.
 This cohesion contains the code for initializing all the parts of the system. Lots of
different activities occur, all at the time.
 The activities related in time, Where all methods executed at same time.
 Temporal cohesion is found in the modules of initialization and termination.
 Example: Counter = 0, Open student file, Clear(), Initializing the array etc.
6.Logical Cohesion
 The elements are logically related and not functionally. Ex- A component reads
inputs from tape, disk, and network.
 All the code for these functions is in the same component. Operations are related,
but the functions are significantly different.
 If all the elements of the module perform a similar operation.
 Example: Error handling, Sorting, If Type of Record Student then Display Student
Record.
7.Coincidental Cohesion
 The elements are not related(unrelated).
 The elements have no conceptual relationship other than location in
source code. It is accidental and the worst form of cohesion.
 It performs a set of tasks that are associated with each other very loosely.
 Example- print next line and reverse the characters of a string in a single
component, Calculator: ADD, SUB, MUL, DIV
THANK YOU.....

Seminar presentation by geethu..Software engineering .pptx

  • 1.
  • 2.
    Software Design Concepts 1.Abstraction 2. Architecture 3. Design Patterns 4. Modularity 5. Information Hiding 6. Functional Independence 7. Refinement 8. Refactoring 9. Object –Oriented Design Concept
  • 3.
    MODULARITY  Modularity simplymeans dividing the system or project into smaller parts to Reduce the complexity of the system or project.  After developing the modules ,they are integrated together to meet The software requirements .  Modularising a design helps to effective development , accommodate changes easily, Conduct testing, debugging efficiently and Conduct maintenance work easily.
  • 4.
  • 5.
    Information Hiding Modules shouldbe specified and Designed in such a way that the data structures and algorithm details of one module are not accessible to other modules They pass only that much information to each other, which is required to accomplish the software functions.  The way of hiding unnecessary details in modules is referred to as information hiding.  Modules must be specified and designed so that the information like algorithm and data presented in a module is not accessible for other modules not requiring that information.
  • 6.
  • 7.
    Functional Independence  Thefunctional independence is the concept of separation and related to the concept of modularity, abstraction and information hiding. Criteria 1: Coupling • Coupling is an indication of interconnection between modules in a structure of software • The degree in which module is "connected" to other module in the system. • Low Coupling necessary in good software, Criteria 2: Cohesion • Cohesion is an extension of the information hiding concept • The degree in which module perform functions in inner module in the system . • High Cohesion necessary in good software.
  • 8.
  • 9.
    Coupling and Cohesion COUPLING Coupling is the measure of the degree of interdependence or number of relations between software modules .  A good software will have low coupling.  High coupling generates more errors because they shared large number of data.  Two modules that are tightly coupled are strongly dependent on each other.
  • 10.
  • 11.
    1.Data Coupling  Whendata are passed from one modules to another module via argument list or parameters through functional blocks.  If the dependency between the modules is based on the fact that they communicate by passing only data, then the modules are said to be data coupled.  In data coupling, the components are independent to each other and communicating through data.  Example-customer billing system
  • 12.
  • 13.
    2.Stamp Coupling  Instamp coupling, the complete data structure is passed from one module to another module.  Two modules are stamp coupled if they communicate using composite data items such as Complete Data Structure & objects.  No junk or unused data shared between the two coupling modules.
  • 14.
  • 15.
    3.Control Coupling  Ifthe modules communicate by passing control information, then they are said to be control coupled.  It can be bad if parameters indicate completely different behaviour and good if parameters allow factoring and reuse of functionality.  Control coupling handle functional flow between software modules.  Example: Module 1- Set Flag = 1 then only Module 2 perform action.
  • 16.
  • 17.
    4.External Coupling  Inexternal coupling, the modules depend on other modules, external to the software being developed or to a particular type of hardware.  When two modules share an externally import data format, communication protocols or device interface.  This is related to communication to external tools and devices.  Example-Protocol, external file, device format, etc.
  • 18.
    5.Common Coupling  Twomodules are common coupled if they share information through some global data items.  The modules have shared data such as global data structures. The changes in global data mean tracing back to all modules which access that data to evaluate the effect of the change.  So it has got disadvantages like difficulty in reusing modules, reduced ability to control data accesses and reduced maintainability.
  • 19.
  • 20.
    6.Content Coupling Here, Twomodules are connected as they share the same content like functions, methods.  When a change is made in one module the other module needs to be updated as well.  In a content coupling, one module can modify the data of another module or control flow is passed from one module to the other module.  This is the worst form of coupling and should be avoided
  • 21.
  • 22.
    Cohesion Cohesion defines tothe degree to which the elements of a module belong together or interrelated. Thus, cohesion measures the strength of relationships between pieces of functionality within a given module.  A good software design will have high cohesion. Or  Cohesion is a measure of the degree to which the elements of the module are functionally related. It is the degree to which all elements directed towards performing a single task are contained in the component. Basically, cohesion is the internal glue that keeps the module together. A good software design will have high cohesion.
  • 23.
  • 24.
    1.Functional Cohesion  Everyessential element for a single computation is contained in the component.  A functional cohesion performs the task and functions.  It is an ideal situation.  If a single module aims to perform all the similar types of functionalities through its different elements.  The purpose of functional cohesion is single minded, high, strong and focused.  Example: Railway Reservation System
  • 25.
  • 26.
    2.Sequential Cohesion  Anelement outputs some data that becomes the input for other element, i.e., data flow between the parts. It occurs naturally in functional program.  Output of one element treats as an input to the other elements inside the same module.  Example: Enter the numbers -> Perform Addition of that numbers -> Display Addition.
  • 27.
    3.Communicational Cohesion  Twoelements operate on the same input data or contribute towards the same output data.  If all the elements of a module are working on the same input & output data and are accessing that data through the same data structures.  Example: Update record in the database and send it to the printer.
  • 28.
    4.Procedural Cohesion  Elementsof procedural cohesion ensure the order of execution. Actions are still weakly connected and unlikely to be reusable.  All parts of a procedure execute in particular sequence of steps for achieving goal.  Example: Calling one function to another function, Loop statements. Reading record, calculate student GPA, print student record, calculate cumulative GPA, print cumulative GPA.
  • 29.
    5.Temporal Cohesion  Theelements are related by their timing involved.  A module connected with temporal cohesion all the tasks must be executed in the same time-span.  This cohesion contains the code for initializing all the parts of the system. Lots of different activities occur, all at the time.  The activities related in time, Where all methods executed at same time.  Temporal cohesion is found in the modules of initialization and termination.  Example: Counter = 0, Open student file, Clear(), Initializing the array etc.
  • 30.
    6.Logical Cohesion  Theelements are logically related and not functionally. Ex- A component reads inputs from tape, disk, and network.  All the code for these functions is in the same component. Operations are related, but the functions are significantly different.  If all the elements of the module perform a similar operation.  Example: Error handling, Sorting, If Type of Record Student then Display Student Record.
  • 31.
    7.Coincidental Cohesion  Theelements are not related(unrelated).  The elements have no conceptual relationship other than location in source code. It is accidental and the worst form of cohesion.  It performs a set of tasks that are associated with each other very loosely.  Example- print next line and reverse the characters of a string in a single component, Calculator: ADD, SUB, MUL, DIV
  • 32.