SlideShare a Scribd company logo
1 of 25
SE-381
Software Engineering
BEIT-V
Lecture # 22
(Modularity – I - Coupling)
Program and its Components
– Like all other engineering artifacts, programs
are comprised of components.
– Components can be small or large, but all
communicate with each other to achieve the
goal of the program
– A program can have various program
structures; one having small number of Large
components having few links or another
having large number of Small components
having a large number of links between them
to achieve the assigned goal of the program
Component Size Versus Contact
Interactions or Links
How Large Should be a
Component?
– One page (40-50 statements)?
– Only 5-9 statements long? as a human mind
can store 7 2 items in its active memory – a
research from cognitive and psychological
sciences areas.
– Or in between the two sizes.
– Size of components ∞ (no. of Components) - 1
Modularity
Modules’ Cost Vurses Size
Larger the module size higher the cost and vice versa, overall cost of
system is dependent on other costs as well, like Module Integration cost
Why Modularity?
• Modularity is to partition the software system into
number of components, whereas a Component
could be a method, a class, a package or a
module.
• Modularity is important throughout the SD
including Design and Maintenance.
• Ideally each component should be self
contained and have as few references to other
modules as possible.
• Correlation with other Engineering artifacts
• Modularity has consequences for
– Architectural Design
– Component or Detailed Design
– Debugging
– Testing
– Maintenance
– Independent Development
– Damage Control and
– Software Reuse
Types of Components
• Generically for sake of discussion,
components could be classified as per
their roles as:
– Computation Only (retain no data, math
methods or filters in Unix)
– Memory (persistent data maintenance & use)
– Manager
– Controller
– Link (UI or Main Pipes)
Coupling and Cohesion
• Coupling and Cohesion are the terms that
describe the character of the interaction
between components and within components
respectively.
• These are complimentary.
• Strong Coupling and Weak Cohesion are bad,
Weak Coupling and Strong Cohesion are good
• These terms provide a terminology for
qualitative analysis of Modularity
Coupling and Cohesion
Coupling
• Coupling is the degree of interaction
between two modules.
• It is of 5 types
1. Content Coupling (Bad or Undesirable)
2. Common Coupling
3. Control Coupling
4. Stamp Coupling
5. Data Coupling (Good or the Desirable)
6. Data Stream Coupling (Good and Desirable)
Content Coupling
• The two modules are Content-Coupled if
one can change the others contents
• Earlier programming languages had constructs to
perform such tricky things, but realizing problems
this sort of coupling may cause, these constructs
have been abolished, Eg alter in earlier versions of
COBOL has now been removed. Currently only
Assembly Language can do it.
• Maintainability and reuse problems
Global Data (Common) Coupling
• When two or more modules have (read as
well as write) access to global data they are
said to be Common Coupled
• ‘Common’ comes from FORTRAN COMMON
statement, initiated to relinquish long
parameter lists, and to share data; COMMON
in FORTRAN and global in COBOL-80,
Public data or methods in modern languages
• Problems:
• Most data (Shared data) passed to the modules thru
COMMON blocks not thru the parameter lists, so
modules are difficult to comprehend and read
• Any module having access can change it so difficult to
determine ‘who changed when’ in case of problem, so
difficult to debug and maintain
Common Coupling .
• Data is un-necessarily exposed to modules where it should
not be, thus compromising the Security
• Maintenance changes made in one of the modules to the
declaration (say array size) of a global variable, then that
change has to be made in every module that has access to
that variable
• Common-coupled modules are difficult to reuse, since
identical list of global variables has to be supplied each time
the module is reused
– Despite problems, one can benefit from the gains of
COMMON statement, if applied carefully and
Access levels of different modules to different
blocks are well documented, and the set
guidelines for Common use are strictly
implemented by the Management
Global Data
Common Coupling Example
Control Coupling
• When a module passes control or switch to
another module then it explicitly controls the
logic of the other module, then these are called
as control-coupled modules
– Ex
• Call io (command, device, buffer, length), where command
can have values 0, 1 and 2 for operations read, write and
open
• This called module io and its calling module will be control-
coupled, calling module needs to know the internal structure
of io, or it’s controlling the logic of called module
• Instead io should be replaced by three modules of read, write
and open like
Call read(device, buffer, length)
Control coupling.
• Two modules are not independent, the calling has
to be aware of internal structure and the logic of
the called module, reuse not possible
• Generally Control Coupling is associated with
modules that have logical Cohesion, and so
difficulties with logical cohesion are also present
Stamp Coupling
• Two modules are Stamp-coupled if the calling
module passes on data structure to the called
module, which uses only some individual
components of the data structure
– Eg
• Calculate withholding (employee_record), where
employee_record data structure contains all data related to
employee, his name, contact, qualification, but only salary is
used to calculate withholding
• Insecurity, called module will have access to not
needed data
• Use of data structures as arguments is
recommended provided they are fully used
Data Coupling
• Two modules are data-coupled if all arguments
are homogeneous data items. Every item can
either be a data structure or a simple element,
but should be used in called module
– Ex
• Calculate withholding (employee_salary), where
employee_salary is the salary of employee
• This is the most desired coupling, results in
independent, easily maintainable and re-usable
modules
Stream Coupling
• Passing of a serial data stream,
• This is the weakest or the best coupling
achieved without any transfer of control between
components.
• It is like one component is out puting information
to a serial file and other component is reading
from there.
• New languages like Java have library functions
like java.io.PipedInputStream and
java.io.PipedOutputStream; Ada also have
similar constructs
Coupling Example
References
1. Douglas Bell (2005); Software Engineering for Students; 4th
Edition, Pearson Education, Ch-6, Modularity, pp 67-86
2. Stephen R Schach (2007); Software Engineering, 7th Edition,
Tata McGraw-Hill Publishing Company Limited, New Delhi,
Ch-7 From Modules to Objects, pp 177 - 218
3. Pankaje Jalote (2004); An Integrated Approach to Software
Engineering, 2nd Edition; Narosa Publishing House, New Delhi;
Ch – 5
4. S A Kelkar (2007); Software Engineering – A Concise Study;
Prentice-Hall of India, New Delhi, pp 548-550

More Related Content

What's hot

Software Design
Software DesignSoftware Design
Software DesignHa Ninh
 
Software Design 1: Coupling & cohesion
Software Design 1: Coupling & cohesionSoftware Design 1: Coupling & cohesion
Software Design 1: Coupling & cohesionAttila Magyar
 
Pressman ch-11-component-level-design
Pressman ch-11-component-level-designPressman ch-11-component-level-design
Pressman ch-11-component-level-designOliver Cheng
 
Unit iii(part d - component level design)
Unit   iii(part d - component level design)Unit   iii(part d - component level design)
Unit iii(part d - component level design)BALAJI A
 
Design process and concepts
Design process and conceptsDesign process and concepts
Design process and conceptsSlideshare
 
Pressman ch-11-component-level-design
Pressman ch-11-component-level-designPressman ch-11-component-level-design
Pressman ch-11-component-level-designOliver Cheng
 
Software Design and Modularity
Software Design and ModularitySoftware Design and Modularity
Software Design and ModularityDanyal Ahmad
 
Software design principles
Software design principlesSoftware design principles
Software design principlesRitesh Singh
 
Chapter 4 software design
Chapter 4  software designChapter 4  software design
Chapter 4 software designCliftone Mullah
 
Design Concept software engineering
Design Concept software engineeringDesign Concept software engineering
Design Concept software engineeringDarshit Metaliya
 
Coupling and cohesion
Coupling and cohesionCoupling and cohesion
Coupling and cohesionSutha31
 
Cohesion and coupling in software design
Cohesion and coupling in software designCohesion and coupling in software design
Cohesion and coupling in software designAhmed Saad Khames
 
Design concepts and principles
Design concepts and principlesDesign concepts and principles
Design concepts and principlessaurabhshertukde
 
Coupling coheshion tps
Coupling coheshion tpsCoupling coheshion tps
Coupling coheshion tpsPreeti Mishra
 
Software Designing - Software Engineering
Software Designing - Software EngineeringSoftware Designing - Software Engineering
Software Designing - Software EngineeringPurvik Rana
 
Function oriented design
Function oriented designFunction oriented design
Function oriented designVidhun T
 
Slides chapters 28-32
Slides chapters 28-32Slides chapters 28-32
Slides chapters 28-32Priyanka Shetty
 

What's hot (20)

Software Design
Software DesignSoftware Design
Software Design
 
Software Design 1: Coupling & cohesion
Software Design 1: Coupling & cohesionSoftware Design 1: Coupling & cohesion
Software Design 1: Coupling & cohesion
 
Design final
Design finalDesign final
Design final
 
Pressman ch-11-component-level-design
Pressman ch-11-component-level-designPressman ch-11-component-level-design
Pressman ch-11-component-level-design
 
Unit iii(part d - component level design)
Unit   iii(part d - component level design)Unit   iii(part d - component level design)
Unit iii(part d - component level design)
 
Design process and concepts
Design process and conceptsDesign process and concepts
Design process and concepts
 
Pressman ch-11-component-level-design
Pressman ch-11-component-level-designPressman ch-11-component-level-design
Pressman ch-11-component-level-design
 
Software Design and Modularity
Software Design and ModularitySoftware Design and Modularity
Software Design and Modularity
 
Design Principles
Design PrinciplesDesign Principles
Design Principles
 
Software design principles
Software design principlesSoftware design principles
Software design principles
 
Chapter 4 software design
Chapter 4  software designChapter 4  software design
Chapter 4 software design
 
Design Concept software engineering
Design Concept software engineeringDesign Concept software engineering
Design Concept software engineering
 
Coupling and cohesion
Coupling and cohesionCoupling and cohesion
Coupling and cohesion
 
Cohesion and coupling in software design
Cohesion and coupling in software designCohesion and coupling in software design
Cohesion and coupling in software design
 
Design concepts and principles
Design concepts and principlesDesign concepts and principles
Design concepts and principles
 
Coupling coheshion tps
Coupling coheshion tpsCoupling coheshion tps
Coupling coheshion tps
 
SE UNIT-3.pdf
SE UNIT-3.pdfSE UNIT-3.pdf
SE UNIT-3.pdf
 
Software Designing - Software Engineering
Software Designing - Software EngineeringSoftware Designing - Software Engineering
Software Designing - Software Engineering
 
Function oriented design
Function oriented designFunction oriented design
Function oriented design
 
Slides chapters 28-32
Slides chapters 28-32Slides chapters 28-32
Slides chapters 28-32
 

Similar to Se 381 - lec 22 - 24 - 12 may15 - modularity - i - coupling

System software design1
System software design1System software design1
System software design1PrityRawat2
 
effective modular design.pptx
effective modular design.pptxeffective modular design.pptx
effective modular design.pptxDr.Shweta
 
EFFECTIVE MODULAR DESIGN.pptx
EFFECTIVE MODULAR DESIGN.pptxEFFECTIVE MODULAR DESIGN.pptx
EFFECTIVE MODULAR DESIGN.pptxDrTThendralCompSci
 
Unit-III(Design).pptx
Unit-III(Design).pptxUnit-III(Design).pptx
Unit-III(Design).pptxFajar Baskoro
 
Sharbani Bhattacharya SE design & Implementation
Sharbani Bhattacharya SE design & ImplementationSharbani Bhattacharya SE design & Implementation
Sharbani Bhattacharya SE design & ImplementationSharbani Bhattacharya
 
Software Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptxSoftware Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptxgauriVarshney8
 
2.Modular Design.pptx
2.Modular Design.pptx2.Modular Design.pptx
2.Modular Design.pptxREALGROUPS
 
Fundamental design concepts
Fundamental design conceptsFundamental design concepts
Fundamental design conceptssrijavel
 
Modules and modularization criteria
Modules and modularization criteriaModules and modularization criteria
Modules and modularization criteriaUmaselvi_R
 
Software engineering
Software engineeringSoftware engineering
Software engineeringMuhammad Yasir
 
Software design, software engineering
Software design, software engineeringSoftware design, software engineering
Software design, software engineeringRupesh Vaishnav
 
software engineering
software engineeringsoftware engineering
software engineeringAbinaya B
 
System design process.pptx
System design process.pptxSystem design process.pptx
System design process.pptxNajibMuhammad16
 
software engineering
software engineeringsoftware engineering
software engineeringVijay Bhadouria
 
Software engineering Questions and Answers
Software engineering Questions and AnswersSoftware engineering Questions and Answers
Software engineering Questions and AnswersBala Ganesh
 
CHAPTER 3.pptx
CHAPTER 3.pptxCHAPTER 3.pptx
CHAPTER 3.pptxSRKkkr1
 
How effective is modularization
How effective is modularizationHow effective is modularization
How effective is modularizationSyedArsal
 
Software Design abtic.pptx
Software Design abtic.pptxSoftware Design abtic.pptx
Software Design abtic.pptxssuser8c0d24
 

Similar to Se 381 - lec 22 - 24 - 12 may15 - modularity - i - coupling (20)

System software design1
System software design1System software design1
System software design1
 
effective modular design.pptx
effective modular design.pptxeffective modular design.pptx
effective modular design.pptx
 
EFFECTIVE MODULAR DESIGN.pptx
EFFECTIVE MODULAR DESIGN.pptxEFFECTIVE MODULAR DESIGN.pptx
EFFECTIVE MODULAR DESIGN.pptx
 
Unit 2
Unit 2Unit 2
Unit 2
 
Unit-III(Design).pptx
Unit-III(Design).pptxUnit-III(Design).pptx
Unit-III(Design).pptx
 
Sharbani Bhattacharya SE design & Implementation
Sharbani Bhattacharya SE design & ImplementationSharbani Bhattacharya SE design & Implementation
Sharbani Bhattacharya SE design & Implementation
 
Software Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptxSoftware Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptx
 
2.Modular Design.pptx
2.Modular Design.pptx2.Modular Design.pptx
2.Modular Design.pptx
 
Fundamental design concepts
Fundamental design conceptsFundamental design concepts
Fundamental design concepts
 
Modules and modularization criteria
Modules and modularization criteriaModules and modularization criteria
Modules and modularization criteria
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Software design, software engineering
Software design, software engineeringSoftware design, software engineering
Software design, software engineering
 
software engineering
software engineeringsoftware engineering
software engineering
 
System design process.pptx
System design process.pptxSystem design process.pptx
System design process.pptx
 
software engineering
software engineeringsoftware engineering
software engineering
 
Software engineering Questions and Answers
Software engineering Questions and AnswersSoftware engineering Questions and Answers
Software engineering Questions and Answers
 
CHAPTER 3.pptx
CHAPTER 3.pptxCHAPTER 3.pptx
CHAPTER 3.pptx
 
Software Design - SDLC Model
Software Design - SDLC ModelSoftware Design - SDLC Model
Software Design - SDLC Model
 
How effective is modularization
How effective is modularizationHow effective is modularization
How effective is modularization
 
Software Design abtic.pptx
Software Design abtic.pptxSoftware Design abtic.pptx
Software Design abtic.pptx
 

More from babak danyal

Easy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client SocketsEasy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client Socketsbabak danyal
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streamsbabak danyal
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Javababak danyal
 
block ciphers and the des
block ciphers and the desblock ciphers and the des
block ciphers and the desbabak danyal
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network securitybabak danyal
 
Lecture10 Signal and Systems
Lecture10 Signal and SystemsLecture10 Signal and Systems
Lecture10 Signal and Systemsbabak danyal
 
Lecture8 Signal and Systems
Lecture8 Signal and SystemsLecture8 Signal and Systems
Lecture8 Signal and Systemsbabak danyal
 
Lecture7 Signal and Systems
Lecture7 Signal and SystemsLecture7 Signal and Systems
Lecture7 Signal and Systemsbabak danyal
 
Lecture6 Signal and Systems
Lecture6 Signal and SystemsLecture6 Signal and Systems
Lecture6 Signal and Systemsbabak danyal
 
Lecture5 Signal and Systems
Lecture5 Signal and SystemsLecture5 Signal and Systems
Lecture5 Signal and Systemsbabak danyal
 
Lecture4 Signal and Systems
Lecture4  Signal and SystemsLecture4  Signal and Systems
Lecture4 Signal and Systemsbabak danyal
 
Lecture3 Signal and Systems
Lecture3 Signal and SystemsLecture3 Signal and Systems
Lecture3 Signal and Systemsbabak danyal
 
Lecture2 Signal and Systems
Lecture2 Signal and SystemsLecture2 Signal and Systems
Lecture2 Signal and Systemsbabak danyal
 
Lecture1 Intro To Signa
Lecture1 Intro To SignaLecture1 Intro To Signa
Lecture1 Intro To Signababak danyal
 
Lecture9 Signal and Systems
Lecture9 Signal and SystemsLecture9 Signal and Systems
Lecture9 Signal and Systemsbabak danyal
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniquesbabak danyal
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Securitybabak danyal
 

More from babak danyal (20)

applist
applistapplist
applist
 
Easy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client SocketsEasy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client Sockets
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streams
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Java
 
Tcp sockets
Tcp socketsTcp sockets
Tcp sockets
 
block ciphers and the des
block ciphers and the desblock ciphers and the des
block ciphers and the des
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network security
 
Lecture10 Signal and Systems
Lecture10 Signal and SystemsLecture10 Signal and Systems
Lecture10 Signal and Systems
 
Lecture8 Signal and Systems
Lecture8 Signal and SystemsLecture8 Signal and Systems
Lecture8 Signal and Systems
 
Lecture7 Signal and Systems
Lecture7 Signal and SystemsLecture7 Signal and Systems
Lecture7 Signal and Systems
 
Lecture6 Signal and Systems
Lecture6 Signal and SystemsLecture6 Signal and Systems
Lecture6 Signal and Systems
 
Lecture5 Signal and Systems
Lecture5 Signal and SystemsLecture5 Signal and Systems
Lecture5 Signal and Systems
 
Lecture4 Signal and Systems
Lecture4  Signal and SystemsLecture4  Signal and Systems
Lecture4 Signal and Systems
 
Lecture3 Signal and Systems
Lecture3 Signal and SystemsLecture3 Signal and Systems
Lecture3 Signal and Systems
 
Lecture2 Signal and Systems
Lecture2 Signal and SystemsLecture2 Signal and Systems
Lecture2 Signal and Systems
 
Lecture1 Intro To Signa
Lecture1 Intro To SignaLecture1 Intro To Signa
Lecture1 Intro To Signa
 
Lecture9 Signal and Systems
Lecture9 Signal and SystemsLecture9 Signal and Systems
Lecture9 Signal and Systems
 
Lecture9
Lecture9Lecture9
Lecture9
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniques
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Security
 

Recently uploaded

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 

Recently uploaded (20)

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 

Se 381 - lec 22 - 24 - 12 may15 - modularity - i - coupling

  • 1. SE-381 Software Engineering BEIT-V Lecture # 22 (Modularity – I - Coupling)
  • 2. Program and its Components – Like all other engineering artifacts, programs are comprised of components. – Components can be small or large, but all communicate with each other to achieve the goal of the program – A program can have various program structures; one having small number of Large components having few links or another having large number of Small components having a large number of links between them to achieve the assigned goal of the program
  • 3. Component Size Versus Contact Interactions or Links
  • 4. How Large Should be a Component? – One page (40-50 statements)? – Only 5-9 statements long? as a human mind can store 7 2 items in its active memory – a research from cognitive and psychological sciences areas. – Or in between the two sizes. – Size of components ∞ (no. of Components) - 1
  • 5. Modularity Modules’ Cost Vurses Size Larger the module size higher the cost and vice versa, overall cost of system is dependent on other costs as well, like Module Integration cost
  • 6.
  • 7. Why Modularity? • Modularity is to partition the software system into number of components, whereas a Component could be a method, a class, a package or a module. • Modularity is important throughout the SD including Design and Maintenance. • Ideally each component should be self contained and have as few references to other modules as possible. • Correlation with other Engineering artifacts
  • 8. • Modularity has consequences for – Architectural Design – Component or Detailed Design – Debugging – Testing – Maintenance – Independent Development – Damage Control and – Software Reuse
  • 9. Types of Components • Generically for sake of discussion, components could be classified as per their roles as: – Computation Only (retain no data, math methods or filters in Unix) – Memory (persistent data maintenance & use) – Manager – Controller – Link (UI or Main Pipes)
  • 10. Coupling and Cohesion • Coupling and Cohesion are the terms that describe the character of the interaction between components and within components respectively. • These are complimentary. • Strong Coupling and Weak Cohesion are bad, Weak Coupling and Strong Cohesion are good • These terms provide a terminology for qualitative analysis of Modularity
  • 12. Coupling • Coupling is the degree of interaction between two modules. • It is of 5 types 1. Content Coupling (Bad or Undesirable) 2. Common Coupling 3. Control Coupling 4. Stamp Coupling 5. Data Coupling (Good or the Desirable) 6. Data Stream Coupling (Good and Desirable)
  • 13. Content Coupling • The two modules are Content-Coupled if one can change the others contents • Earlier programming languages had constructs to perform such tricky things, but realizing problems this sort of coupling may cause, these constructs have been abolished, Eg alter in earlier versions of COBOL has now been removed. Currently only Assembly Language can do it. • Maintainability and reuse problems
  • 14. Global Data (Common) Coupling • When two or more modules have (read as well as write) access to global data they are said to be Common Coupled • ‘Common’ comes from FORTRAN COMMON statement, initiated to relinquish long parameter lists, and to share data; COMMON in FORTRAN and global in COBOL-80, Public data or methods in modern languages • Problems: • Most data (Shared data) passed to the modules thru COMMON blocks not thru the parameter lists, so modules are difficult to comprehend and read • Any module having access can change it so difficult to determine ‘who changed when’ in case of problem, so difficult to debug and maintain
  • 15. Common Coupling . • Data is un-necessarily exposed to modules where it should not be, thus compromising the Security • Maintenance changes made in one of the modules to the declaration (say array size) of a global variable, then that change has to be made in every module that has access to that variable • Common-coupled modules are difficult to reuse, since identical list of global variables has to be supplied each time the module is reused – Despite problems, one can benefit from the gains of COMMON statement, if applied carefully and Access levels of different modules to different blocks are well documented, and the set guidelines for Common use are strictly implemented by the Management
  • 18. Control Coupling • When a module passes control or switch to another module then it explicitly controls the logic of the other module, then these are called as control-coupled modules – Ex • Call io (command, device, buffer, length), where command can have values 0, 1 and 2 for operations read, write and open • This called module io and its calling module will be control- coupled, calling module needs to know the internal structure of io, or it’s controlling the logic of called module • Instead io should be replaced by three modules of read, write and open like Call read(device, buffer, length)
  • 19. Control coupling. • Two modules are not independent, the calling has to be aware of internal structure and the logic of the called module, reuse not possible • Generally Control Coupling is associated with modules that have logical Cohesion, and so difficulties with logical cohesion are also present
  • 20. Stamp Coupling • Two modules are Stamp-coupled if the calling module passes on data structure to the called module, which uses only some individual components of the data structure – Eg • Calculate withholding (employee_record), where employee_record data structure contains all data related to employee, his name, contact, qualification, but only salary is used to calculate withholding • Insecurity, called module will have access to not needed data • Use of data structures as arguments is recommended provided they are fully used
  • 21. Data Coupling • Two modules are data-coupled if all arguments are homogeneous data items. Every item can either be a data structure or a simple element, but should be used in called module – Ex • Calculate withholding (employee_salary), where employee_salary is the salary of employee • This is the most desired coupling, results in independent, easily maintainable and re-usable modules
  • 22. Stream Coupling • Passing of a serial data stream, • This is the weakest or the best coupling achieved without any transfer of control between components. • It is like one component is out puting information to a serial file and other component is reading from there. • New languages like Java have library functions like java.io.PipedInputStream and java.io.PipedOutputStream; Ada also have similar constructs
  • 24.
  • 25. References 1. Douglas Bell (2005); Software Engineering for Students; 4th Edition, Pearson Education, Ch-6, Modularity, pp 67-86 2. Stephen R Schach (2007); Software Engineering, 7th Edition, Tata McGraw-Hill Publishing Company Limited, New Delhi, Ch-7 From Modules to Objects, pp 177 - 218 3. Pankaje Jalote (2004); An Integrated Approach to Software Engineering, 2nd Edition; Narosa Publishing House, New Delhi; Ch – 5 4. S A Kelkar (2007); Software Engineering – A Concise Study; Prentice-Hall of India, New Delhi, pp 548-550