Download presentation
Presentation is loading. Please wait.
1
1 SOFTWARE DESIGN QUALITY COHESION and COUPLING (Part I)
2
2 Goals and Concepts of Structured Analysis and Design: structured development of software: –methodology –notation (DFD, SC) integration of analysis and design quality control (cohesion, coupling) based on the flow of information (data) provides proven heuristics
3
3 Quality Characteristics for Design modular design achieved by –abstraction decomposition/aggregation specialisation/generalisation –stepwise refinement [N. Wirth] –information hiding [D.L. Parnas] ===> independent modules
4
4 Quality Characteristics for Modules independent modules –avoid aggregation of multiple functions per module –single-minded function ===> high COHESION –minimal interaction with other modules –simple interface ===> low COUPLING [Steven, Myers, Constantine]
5
5 Module COHESION quality of a single module based on the module’s internal functionality cohesion should be high types of cohesion (low to high):
6
6 Coincidental Cohesion characteristics: –functions relate very loosely to each other –“random” selection of multiple functions example(s): –result of post-facto “modularization” –result of poor maintenance problems: –multiple functions –no logical connection between functions
7
7 Logical Cohesion characteristics: –combines similar functions –implements a set of functions for “all purposes” example(s): –pack/unpack records for telecommunication –central error-handling module problems: –multiple functions –wide interface (with control parameters) –bad reusability, maintainability
8
8 Temporal / Classical Cohesion characteristics: –combines similar functions and all of them are always executed at the same time example(s): –open-all-files module –initialise-all-variables problems: –multiple functions –bad reusability, maintainability –violation of the principle of “local scope”
9
9 Procedural Cohesion characteristics: –tasks must be executed in a specific sequence and are related by the flow of control example(s): –combine decision making & task execution, e.g. error-detection and error handling –local optimisation problems: –fixed combination and order of tasks –bad reusability, maintainability
10
10 Communicational Cohesion characteristics: –tasks that use the same data (parameters) –sharing (portions) of a data structure example(s): –monthly-employee-statistic and write-paycheque, both functions using the employee-record problems: –wide interface (with stamp data coupling) –code sharing is tempting –bad reusability, maintainability
11
11 Communicational Cohesion Module X task A task B D R1 R2 D’ D”
12
12 Sequential Cohesion characteristics: –tasks execute in a specific sequence and are related by the flow of data –tasks transform data in a multitude of steps example(s): –calculate-taxes and write-paycheque problems: –hidden interface(s) –fixed combination and order of tasks –bad reusability, maintainability
13
13 Sequential Cohesion Module X task Atask B DR D’
14
14 Functional Cohesion characteristics: –single-minded function –cannot be decomposed any further (in a meaningful way) –not based on control or data flow –algorithmic behaviour / description –simple interface = good parameters (no stamp coupling, no control) problems: –cannot always be achieved
15
15 End of Section 4a coming up: coupling
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.