SlideShare a Scribd company logo
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 & cohesion
Attila Magyar
 
Design final
Design finalDesign final
Design final
Indu Sharma Bhardwaj
 
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 Modularity
Danyal Ahmad
 
Design Principles
Design PrinciplesDesign Principles
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 engineering
Darshit Metaliya
 
Coupling and cohesion
Coupling and cohesionCoupling and cohesion
Coupling and cohesion
Sutha31
 
Cohesion and coupling in software design
Cohesion and coupling in software designCohesion and coupling in software design
Cohesion and coupling in software design
Ahmed 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 tps
Preeti Mishra
 
SE UNIT-3.pdf
SE UNIT-3.pdfSE UNIT-3.pdf
SE UNIT-3.pdf
Dr. Radhey Shyam
 
Software Designing - Software Engineering
Software Designing - Software EngineeringSoftware Designing - Software Engineering
Software Designing - Software Engineering
Purvik Rana
 
Function oriented design
Function oriented designFunction oriented design
Function oriented design
Vidhun T
 

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 design1
PrityRawat2
 
effective modular design.pptx
effective modular design.pptxeffective modular design.pptx
effective modular design.pptx
Dr.Shweta
 
EFFECTIVE MODULAR DESIGN.pptx
EFFECTIVE MODULAR DESIGN.pptxEFFECTIVE MODULAR DESIGN.pptx
EFFECTIVE MODULAR DESIGN.pptx
DrTThendralCompSci
 
Unit 2
Unit 2Unit 2
Unit-III(Design).pptx
Unit-III(Design).pptxUnit-III(Design).pptx
Unit-III(Design).pptx
Fajar Baskoro
 
Sharbani Bhattacharya SE design & Implementation
Sharbani Bhattacharya SE design & ImplementationSharbani Bhattacharya SE design & Implementation
Sharbani Bhattacharya SE design & Implementation
Sharbani Bhattacharya
 
Software Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptxSoftware Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptx
gauriVarshney8
 
2.Modular Design.pptx
2.Modular Design.pptx2.Modular Design.pptx
2.Modular Design.pptx
REALGROUPS
 
Fundamental design concepts
Fundamental design conceptsFundamental design concepts
Fundamental design concepts
srijavel
 
Modules and modularization criteria
Modules and modularization criteriaModules and modularization criteria
Modules and modularization criteria
Umaselvi_R
 
Software engineering
Software engineeringSoftware engineering
Software engineering
Muhammad Yasir
 
Software design, software engineering
Software design, software engineeringSoftware design, software engineering
Software design, software engineering
Rupesh Vaishnav
 
software engineering
software engineeringsoftware engineering
software engineering
Abinaya B
 
System design process.pptx
System design process.pptxSystem design process.pptx
System design process.pptx
NajibMuhammad16
 
software engineering
software engineeringsoftware engineering
software engineering
Vijay 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.pptx
SRKkkr1
 
Software Design - SDLC Model
Software Design - SDLC ModelSoftware Design - SDLC Model
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.pptx
ssuser8c0d24
 

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 Sockets
babak danyal
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streams
babak 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 Java
babak danyal
 
Tcp sockets
Tcp socketsTcp sockets
Tcp sockets
babak danyal
 
block ciphers and the des
block ciphers and the desblock ciphers and the des
block ciphers and the des
babak danyal
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network security
babak danyal
 
Lecture10 Signal and Systems
Lecture10 Signal and SystemsLecture10 Signal and Systems
Lecture10 Signal and Systems
babak danyal
 
Lecture8 Signal and Systems
Lecture8 Signal and SystemsLecture8 Signal and Systems
Lecture8 Signal and Systems
babak danyal
 
Lecture7 Signal and Systems
Lecture7 Signal and SystemsLecture7 Signal and Systems
Lecture7 Signal and Systems
babak danyal
 
Lecture6 Signal and Systems
Lecture6 Signal and SystemsLecture6 Signal and Systems
Lecture6 Signal and Systems
babak danyal
 
Lecture5 Signal and Systems
Lecture5 Signal and SystemsLecture5 Signal and Systems
Lecture5 Signal and Systems
babak danyal
 
Lecture4 Signal and Systems
Lecture4  Signal and SystemsLecture4  Signal and Systems
Lecture4 Signal and Systems
babak danyal
 
Lecture3 Signal and Systems
Lecture3 Signal and SystemsLecture3 Signal and Systems
Lecture3 Signal and Systems
babak danyal
 
Lecture2 Signal and Systems
Lecture2 Signal and SystemsLecture2 Signal and Systems
Lecture2 Signal and Systems
babak 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 Systems
babak danyal
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniques
babak danyal
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Security
babak 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

The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 

Recently uploaded (20)

The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 

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