next up previous
Next: Message Passing Coupling ( Up: Coupling Previous: Instability ( )


Locality of Data ($ LD$ )

Works with all instances of a common meta-model, regardless of whether they were produced with the Java or the UML front-end. The respective extends (Java) or generalization (UML) relations expressing the inheritance between two classes are mapped onto relations of type inheritance in the common meta-model (and the $ LD$specific view).
Handle
$ LD$
Description
The Locality of Data metric relates the amount of data being local the class to the total amount of data used by the class. This relates to the quality of abstraction embodied by the class and allows conclusions on the reuse potential of the class and testability.
Scope
Class
View
$ {V}^{LD} = ({G}^{LD}, {R}^{LD})$
  • Grammar $ {G}^{LD} = (\{\textrm{class}^{LD}, \textrm{data}^{LD}\}, \emptyset, \textrm{class}^{LD})$
  • Relations $ {R}^{LD}: \{\textrm{uses}^{LD} : \textrm{method}^{LD} \times \textrm{data}^{LD... ...xtrm{containedmethods}^{LD} : \textrm{class}^{LD} \times \textrm{method}^{LD}\}$
  • Mapping $ \alpha^{LD}$:
    $\displaystyle \alpha^{LD}(\textrm{Class})$ $\displaystyle \mapsto$ $\displaystyle \textrm{class}^{LD}$  
    $\displaystyle \alpha^{LD}(\textrm{AVariable})$ $\displaystyle \mapsto$ $\displaystyle \textrm{data}^{LD}$  
    $\displaystyle \alpha^{LD}(\textrm{Method})$ $\displaystyle \mapsto$ $\displaystyle \textrm{method}^{LD}$  
    $\displaystyle \alpha^{LD}(\textrm{IsFieldOf})$ $\displaystyle \mapsto$ $\displaystyle \textrm{isdataof}^{LD}$  
    $\displaystyle \alpha^{LD}(\textrm{IsParameterOf})$ $\displaystyle \mapsto$ $\displaystyle \textrm{isdataof}^{LD}$  
    $\displaystyle \alpha^{LD}(\textrm{IsMethodOf})$ $\displaystyle \mapsto$ $\displaystyle \textrm{ismethodof}^{LD}$  
    $\displaystyle \alpha^{LD}(\textrm{inheritsFrom})$ $\displaystyle \mapsto$ $\displaystyle \textrm{inheritsfrom}^{LD}$  


    $\displaystyle \alpha^{LD}(\textrm{Accessess})$ $\displaystyle \mapsto$ $\displaystyle \textrm{uses}^{LD}$  
    $\displaystyle \alpha^{LD}(\textrm{Invokes})$ $\displaystyle \mapsto$ $\displaystyle \textrm{call}^{LD}$  

Definition
The $ LD$value of a class $ c \in class^{LD}$is defined as:
$\displaystyle S(c)$ $\displaystyle =$ $\displaystyle succ^+(c,\textrm{inheritsfrom}^{LD})$  
    $\displaystyle \textit{-\hspace{1pt}- set of super classes c inherits from,}$  
    $\displaystyle \textit{-\hspace{1pt}- excluding c itself}$  
$\displaystyle V^{super}(c)$ $\displaystyle =$ $\displaystyle \lbrace v_i \vert v_i \in pred(S(c),\textrm{isdataof}^{LD} \wedge$  
    $\displaystyle v_i.visibility = protected ) \rbrace$  
    $\displaystyle \textit{-\hspace{1pt}- set of inherited protected instance variables}$  
    $\displaystyle \textit{-\hspace{1pt}- of super-classes of c}$  
$\displaystyle V(c)$ $\displaystyle =$ $\displaystyle \lbrace v_i \vert v_i \in pred(C(c),\textrm{isdataof}^{LD} \wedge$  
    $\displaystyle v_i.visibility \neq public )\rbrace$  
    $\displaystyle \textit{-\hspace{1pt}- set of all non-public instance variables of c}$  
    $\displaystyle \textit{-\hspace{1pt}- including static variables defined locally in M(c)}$  
$\displaystyle V^{local}(c)$ $\displaystyle =$ $\displaystyle V^{super}(c) \cup V(c)$  
    $\displaystyle \textit{-\hspace{1pt}- set of all non-public class local}$  
    $\displaystyle \textit{-\hspace{1pt}- instance variables of c}$  
$\displaystyle M(c)$ $\displaystyle =$ $\displaystyle pred(c,\textrm{ismethodof}^{LD})$  
    $\displaystyle \textit{-\hspace{1pt}- set of methods contained in c}$  
$\displaystyle M^{*}(c)$ $\displaystyle =$ $\displaystyle \{m_i \vert m_i.isGetterSetter \neq true \wedge m_i \in M(c)\}$  
    $\displaystyle \textit{-\hspace{1pt}- set of methods contained in c,}$  
    $\displaystyle \textit{-\hspace{1pt}- excluding trivial read/write methods}$  
$\displaystyle M^{r/w}(c)$ $\displaystyle =$ $\displaystyle \{m_i \vert m_i.isGetterSetter = true \wedge m_i \in M(c)\}$  
    $\displaystyle \textit{-\hspace{1pt}- set of all read/write methods contained in c}$  
$\displaystyle M^{r/w~used}(c)$ $\displaystyle =$ $\displaystyle \{m_i \vert m_i \in M^{r/w}(c) \cap succ(M^{*}(c), \textrm{call}^{LD})\}$  
    $\displaystyle \textit{-\hspace{1pt}- set of all read/write methods contained in c and}$  
    $\displaystyle \textit{-\hspace{1pt}- called by non-read/write methods contained in c}$  
$\displaystyle T(c)$ $\displaystyle =$ $\displaystyle \{v_i \vert v_i \in succ(M^{*}(c),\textrm{uses}^{LD} )\}$  
    $\displaystyle \textit{-\hspace{1pt}- set of all variables used in $M^{*}(c)$\ of c,}$  
    $\displaystyle \textit{-\hspace{1pt}- excluding local variables defined in $M^{*}(c)$}$  


$\displaystyle L^{direct}(c)$ $\displaystyle =$ $\displaystyle T(c) \cap V^{class-local}(c)$  
    $\displaystyle \textit{-\hspace{1pt}- set of all variables of c directly used in $M^{*}(c)$,}$  
    $\displaystyle \textit{-\hspace{1pt}- excluding local variables, and variable used}$  
    $\displaystyle \textit{-\hspace{1pt}- over getter/setter mtheods}$  
$\displaystyle L^{indirect}(c)$ $\displaystyle =$ $\displaystyle succ(M^{r/w-used}(c),\textrm{uses}^{LD}) \cap V^{class-local}(c)$  
    $\displaystyle \textit{-\hspace{1pt}- set of all variables of c indirectly used in $M^{*}(c)$}$  
    $\displaystyle \textit{-\hspace{1pt}- over read/write methods}$  
$\displaystyle L(c)$ $\displaystyle =$ $\displaystyle L^{direct}(c) \cup L^{indirect}(c)$  
$\displaystyle LD(c)$ $\displaystyle =$ $\displaystyle \frac{L(c)}{T(c)}$  

Scale
Ratio
Domain
Rational in $ 0.0..1.0$.
Highly Related Software Quality Properties
 
Re-Usability 2.4
is positively influenced by coupling.
Understandability for Reuse 2.4.1:
A part of a system that has a high (outgoing) efferent coupling may be highly inversely related to understandability, since it uses other parts of the system which need to be understood as well.

Understandability increases with increasing LD.

Attractiveness 2.4.4:
Parts that have a high (outgoing) efferent coupling may be highly inversely related to attractiveness, since they are using other parts of the system which need to be understood as well, and represent dependencies.

Attractiveness increases with increasing LD.

Maintainability 2.6
decreases with increasing LD.
Analyzability 2.6.1:
Parts that have a high (outgoing) efferent coupling may be highly inversely related to analyzability, since they are using other parts of the system which need to be analyzed as well.

Analyzability increases with increasing LD.

Changeability 2.6.2:
Parts that have a high (outgoing) efferent coupling may be inversely related to changeability, since they are using other parts of the system which might need to be changed as well.

Changeability increases with increasing LD.

Stability 2.6.3:
Parts showing a high (outgoing) efferent coupling may be inversely related to stability, since they are using other parts of the system, which are can affect them.

Stability increases with increasing LD.

Testability 2.6.4:
Parts that have a high (outgoing) efferent coupling may be highly inversely related to testability, since they are using other parts of the system which increase the number of possible test paths.

Testability increases with increasing LD.

Portability 2.7
decreases with increasing LD.
Adaptability 2.7.1:
Parts that have a high (outgoing) efferent coupling may be inversely related to adaptability, since they are using other parts of the system which might need to be adapted as well.

Adaptability increases with increasing LD.

Related Software Quality Properties
 
Functionality 2.1
is both negatively and positively influenced by coupling.
Interoperability 2.1.3:
Parts that have a high (outgoing) efferent coupling may be directly related to interoperability, since they are using/interacting with other parts of the system.

Interoperability might decrease with increasing LD.

Security 2.1.4:
Parts that have a high (outgoing) efferent coupling may be inversely related to security, since they can be affected by security problems in other parts of the system.

Security might decrease with increasing LD.

Reliability 2.2
might decrease with increasing LD.
Fault-tolerance 2.2.2:
Parts that have a high (outgoing) efferent coupling may be inversely related to fault-tolerance, since they can be affected by faults in other parts of the system.

Fault-Tolerance might increase with increasing LD.

Recoverability 2.2.3:
Parts that have a high (outgoing) efferent coupling may be inversely related to recoverability, since their data is distributed in other parts of the system making their recovery difficult.

Recoverability might increase with increasing LD.

Re-Usability 2.4
might decrease with increasing LD.
Learnability for Reuse 2.4.2:
Parts that have a high (outgoing) efferent coupling may be inversely related to learnability, since they are using other parts of the system which need to be understood as well.

Learnability might increase with increasing LD.

Operability for Reuse - Programmability 2.4.3:
Parts that have a high (outgoing) efferent coupling may be inversely related to learnability, since they are using other parts of the system, which represent dependencies.

Programmability might increase with increasing LD.

Efficiency 2.5
might decrease with increasing LD.
Time Behavior 2.5.1:
Parts that have a high (outgoing) efferent coupling may be inversely related to time behavior, since they are using other parts of the system, thus execution during test or operation does not stay local, but might involve huge parts of the system.

Time behavior might increase with increasing LD.

Resource Utilization 2.5.2:
Parts that have a high (outgoing) efferent coupling may be inversely related to resource utilization, since they are using other parts of the system, thus execution during test or operation does not stay local, but might involve huge parts of the system.

Resource utilization might increase with increasing LD.

References
 
  • LD is extensively discussed and evaluated in [11,19,2,12],
  • it is implemented in the VizzAnalyzer Metrics Suite.
Since
Compendium 1.0

next up previous
Next: Message Passing Coupling ( Up: Coupling Previous: Instability ( )
Copyright © 2008-2009, ARiSA AB. Phone: +46-(0)470 70 8495 Email: info@arisa.se Valid CSS! Valid XHTML 1.0 Transitional