ADVANCED SOFTWARE ENGINEERING MTSE-101 VARDAN NIKHIL M.TECH - I st YEAR BABA SAHEB BHIMRAO AMBEDKAR UNIVERSITY LUCKNOW
Cohesion And It's Type
Table Of Content What is Cohesion Why Cohesion Is So Important Type Of Cohesion Visual Representation Of Cohesion Conclusion
What Is Cohesion In Software Engineering , Cohesion refers to the measure of how closely the components within a module or modules itself are related to one another. High Cohesion implies that element within a module are strongly related and contribute to perform single well defined task. While Low Cohesion suggest that the components are lossely related and perform their own separate task. In good software system , Level of cohesion must be high.
Why Cohesion Is So Important Cohesion is important because it is the one of the standard measurement of high quality software. It also ensure that the software system is meantainable , extensible, reusable and more understandable. High cohesion leads to modular, understandable code, making it easier to debug, modify, and scale.
Type Of Cohesion T ypes of cohesion can be categorized from high to low as follows Functional Cohesion Sequential Cohesion Communicational Cohesion Procedural Cohesion Temporal Cohesion Logical Cohesion Coincidental Cohesion
Functional Cohesion: Modules exhibit functional cohesion if they perform a single, well-defined task. All elements within the module contribute to accomplishing that specific function. Sequential Cohesion: Elements in a module with sequential cohesion are related in a step-by-step sequence. This type of cohesion is often found in modules where the output of one element is the input for the next. Communicational Cohesion: Modules with communicational cohesion perform multiple tasks, but these tasks are related and share the same data. This cohesion type focuses on the shared data among the module's elements. Procedural Cohesion: Procedural cohesion occurs when elements within a module are grouped together because they follow a specific sequence of steps, even if they perform different functions.
Temporal Cohesion: Temporal cohesion involves grouping elements that are related by time. This can include operations that need to be performed at the same time or within the same time frame. Logical Cohesion: Modules with logical cohesion group elements that are logically related but might not fit the other cohesion types. This type is more abstract and depends on the nature of the problem being solved. Coincidental Cohesion When elements within a module are grouped together without having any relationship know as Coincidental Cohesion.
Visual Representation Of Cohesion
Conclusion In simple terms, cohesion is like the glue that holds ele ments together. cohesion makes everything more efficient and effective. cohesive code isn't just a best practice; it's a fundamental principle that underpins the resilience and adaptability of software systems.