Page 136 - DCAP405_SOFTWARE_ENGINEERING
P. 136

Unit 8: Design Engineering




                                                                                                Notes
                                 Figure 8.2: Types of Modules Coupling
                                Data coupling

                                  Stamp coupling
                                Control coupling

                                External coupling
                                Common coupling

                                Content coupling





             Notes  However, if the communication takes place in the form of parameters then the
             internal details of the modules are no required to be modified while making changes in
             the related module.
               Given two procedures X and Y, the type of coupling can be identified in them.

               (a)  Data coupling: When X and Y communicates by passing parameters to one another
                    and not unnecessary data. Thus, if a procedure needs a part of a data structure, it
                    should be passed just that and not the complete thing.
               (b)  Stamp Coupling: Although X and Y make use of the same data type but perform
                    different operations on them.
               (c)  Control Coupling (activating): X transfers control to Y through procedure calls.
               (d)  Common Coupling: Both X and Y use some shared data e.g. global variables. This is the
                    most undesirable, because if we wish to change the shared data, all the procedures
                    accessing this shared data will need to be modified.
               (e)  Content Coupling: When X modifies Y either by branching in the middle of Y or by
                    changing the local data values or instructions of Y.
          3.   Cohesion: Cohesion is the measure of the degree of functional dependence of modules.
               A strongly cohesive module implements functionality that interacts little with the other
               modules. Thus, in order to achieve higher interaction amongst modules a higher cohesion
               is desired. Different types of cohesion are listed in Figure 8.3.
                                 Figure 8.3: Types of Module Cohesion

                                Functional cohesion
                                Sequential cohesion

                                Communication cohesion
                                Procedural cohesion
                                Temporal cohesion
                                  Logical cohesion
                                Coincidental cohesion







                                           LOVELY PROFESSIONAL UNIVERSITY                                   129
   131   132   133   134   135   136   137   138   139   140   141