Page 195 - DCAP305_PRINCIPLES_OF_SOFTWARE_ENGINEERING
P. 195

Unit 9: Metrics



            coupled different modules in a software system are. Different types of data bindings are possible   Notes
            [90]. A potential data binding is defined as a triplet (p,x,q), where p and q are modules and x is
            a variable within the static scope of both p and q. This reflects the possibility that the modules
            p and q may communicate with each other through the shared variable x. This binding does not
            consider the internals of p and q to determine if the variable x is actually accessed in any of the
            modules. This binding is based on data declaration. A used data binding is a potential binding
            where both p and q use the variable x for reference or assignment. This is harder to compute
            than potential data binding and requires more information about the internal logic of a module.
            An actual data binding is a used data binding with the additional restriction that the module p
            assigns a value to x and q references x. It is the hardest to compute, and it signifies the situation
            where information may flow from the module p to module q through the shared variable x.
            Computation of actual data binding requires detailed logic descriptions of modules p and 4.
            All of these data bindings attempt to represent the strength of interconnections among modules.
            The greater the number of bindings between two modules, the higher the interconnection between
            these modules. For a particular type of binding, a matrix can be computed that contains the
            number of bindings between different modules. This matrix can be used for further statistical
            analysis to determine the interconnection strength of the system.
                          Always software metrics are based on code syntax, quantifying the complexity
                          or cohesion of an Implementation by performing calculations based on counting
                          code structures.
            Self Assessment Questions

               1.  ............................... describe the logic structure of software modules.
                 (a)  Flow graph notation        (b)  Cyclomatic complexity
                 (c)  Graph matrices             (d)  Control flow graphs
               2.  ............................ can be characterized as the number of elements of a basis set of control
                 flow paths through the module.
                 (a)  Flow graph notation        (b)  Cyclomatic complexity
                 (c)  Graph matrices             (d)  Control flow graphs
               3.  ........................ are measures that capture the data interaction across portions of a software
                 system.
                 (a)  Graph matrices             (b)  Potential data binding
                 (c)  Data bindings              (d)  Control flow graphs
               4.  Rewriting a single multiway decision to cross a module boundary is not a clear violation
                 of structured design.
                 (a)  True                       (b)  False
               5.  The cyclomatic number in graph theory is defined as n + 1.
                 (a)  n + 1                      (b)  n – 1
                 (c)  (n + 1)2                   (d)  n(n + 1)

            9.3 Cohesion Metric

            Metrics can assist software developers and managers assess the quality of software and pinpoint
            trouble areas in their systems. For instance, a metric may indicate that a class lacks cohesion. A
            cohesive class is one in which all of the members are closely related, focused on a single task.
            A class that lacks cohesion is poorly designed, and therefore is more likely to be error-prone.
            If metrics are used to quickly and automatically find out which classes in software system lack
            cohesion, the programming team can take steps to check those classes and improve them before


                                             LOVELY PROFESSIONAL UNIVERSITY                                   189
   190   191   192   193   194   195   196   197   198   199   200