Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Techniques"

(Provided smells for Ecore models (to do))
(Provided techniques for UML2 models (to do))
 
(28 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
The following model quality assurance techniques are provided by EMF Refactor.
 
The following model quality assurance techniques are provided by EMF Refactor.
  
== Provided techniques for Ecore models (to do) ==
+
== Provided techniques for Ecore models ==
  
 
EMF Refactor provides the following model quality assurance techniques for Ecore models (nsUri ''http://www.eclipse.org/emf/2002/Ecore'').
 
EMF Refactor provides the following model quality assurance techniques for Ecore models (nsUri ''http://www.eclipse.org/emf/2002/Ecore'').
Line 153: Line 153:
 
</TR>
 
</TR>
  
 +
</TABLE>
 +
 +
=== Provided smells for Ecore models ===
 +
----
 +
 +
<TABLE BORDER=1 CELLPADDING=8 CELLSPACING=5 bgcolor="#ffffff">
 +
 +
<TR>
 +
<TH>Smell</TH>
 +
<TH>Description</TH>
 +
</TR>
 +
 +
<TR>
 +
<TD>Large EClass</TD>
 +
<TD ALIGN=LEFT>The model contains an EClass owning more features (EAttributes and EOperations) than the specified limit.</TD>
 +
</TR>
 +
 +
<TR>
 +
<TD>Speculative Generality EClass</TD>
 +
<TD ALIGN=LEFT>The model contains an abstract EClass that is inherited by one concrete EClass only.</TD>
 +
</TR>
 +
 +
<TR>
 +
<TD>Unnamed EClass</TD>
 +
<TD ALIGN=LEFT>The model contains an EClass without a name.</TD>
 +
</TR>
  
 
</TABLE>
 
</TABLE>
  
=== Provided smells for Ecore models (to do) ===
+
=== Provided refactorings for Ecore models ===
 
----
 
----
  
 
<TABLE BORDER=1 CELLPADDING=8 CELLSPACING=5 bgcolor="#ffffff">
 
<TABLE BORDER=1 CELLPADDING=8 CELLSPACING=5 bgcolor="#ffffff">
  <TR>
 
  <TD COLSPAN=2 ALIGN=CENTER><font size=+1><a name="smells">UML2 Smells</a></font>
 
  </TD>
 
  </TR>
 
  <TR>
 
  <TH>Smell</TH>
 
  <TH>Description</TH>
 
  </TR>
 
  <TR>
 
  <TD>Attribute name overridden</TD>
 
  <TD ALIGN=LEFT>The model contains an attribute with the same name as an inherited attribute.</TD>
 
  </TR>
 
  
=== Provided refactorings for Ecore models (to do) ===
+
<TR>
 +
<TH>Refactoring</TH>
 +
<TH>Description</TH>
 +
</TR>
  
== Provided techniques for UML2 models (to do) ==
+
<TR>
 +
<TD>Add EParameter with EClassifier type</TD>
 +
<TD ALIGN=LEFT>An EOperation needs more information from its callers. Therefore, this refactoring adds an EParameter to an EOperation.</TD>
 +
</TR>
  
=== Provided metrics for UML2 models (to do) ===
+
<TR>
 +
<TD>Create referenced EClass</TD>
 +
<TD ALIGN=LEFT>This refactoring creates an empty EClass and connects it with a new EReference to the source EClass from where it is extracted. The multiplicities of the new association is 1. Usually, refactorings Move EAttribute and Move EOperation are the next steps after this refactoring.</TD>
 +
</TR>
  
=== Provided smells for UML2 models (to do) ===
+
<TR>
 +
<TD>Create sub EClass</TD>
 +
<TD ALIGN=LEFT>An EClass has features (attributes or operations) that are not used features. However, the new subclass has these features. Usually, refactorings Push Down EAttribute and Push Down EOperation are the next steps after this refactoring.</TD>
 +
</TR>
  
=== Provided refactorings for UML2 models (to do) ===
+
<TR>
 +
<TD>Create super EClass</TD>
 +
<TD ALIGN=LEFT>This refactoring can be applied when there are at least two EClasses with similar features (attributes or operations). The refactoring creates a super EClass for this set of EClasses and is normally followed by refactorings Pull Up EAttribute and Pull Up EOperation. So, the refactoring helps to reduce the duplicate common features spread throughout different EClasses.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Move EAttribute</TD>
 +
<TD ALIGN=LEFT>An EAttribute is better placed in another EClass which is associated to this EClass. This refactoring moves this EAttribute to the associated EClass.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Move EOperation</TD>
 +
<TD ALIGN=LEFT>This refactoring moves an EOperation of ab EClass to an associated EClass. It is often applied when some EClass has too much behavior or when EClasses collaborate too much.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Pull up EAttribute</TD>
 +
<TD ALIGN=LEFT>This refactoring removes an EAttribut) from an EClass or a set of EClasses and inserts it to one of its super EClasses.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Pull up EOperation</TD>
 +
<TD ALIGN=LEFT>This refactoring pulls an EOperation of an EClass to its super EClass. It is used internally on several EClasses which inherit from the same super EClass. The aim of this refactoring is often to extract identical EOperations.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Push down EAttribute</TD>
 +
<TD ALIGN=LEFT>An EAttribute is used only by some sub EClasses. Move the EAttribute to only these sub EClasses. More generally, this refactoring moves the EAttribute to all sub EClasses. If it makes sense, the EAttribute can be removed from some of these afterwards. Sometimes, it also makes sense to keep an EAttribute in all sub EClasses to hide it from the super EClass.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Push down EOperation</TD>
 +
<TD ALIGN=LEFT>This refactoring pushes an EOperation from the owning EClass down to all its sub EClasses. If it makes sense, the EOperation can be removed from some of these afterwards. Sometimes, it also makes sense to keep an EOperation in all sub EClasses to hide it from the super EClass.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Remove empty referenced EClass</TD>
 +
<TD ALIGN=LEFT>There is an empty EClass that is associated to another EClass. An associated EClass is empty if it has no features. Furthermore, it has no sub EClasses or super EClasses, and it is not referred to as type of an EParameter.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Remove empty sub EClass</TD>
 +
<TD ALIGN=LEFT>A super EClass has an empty sub EClass which shall be removed. This EClass is not associated to another EClass. It has no features, no further sub EClasses, and it is not referred to as type of an EParameter.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Remove empty super EClass</TD>
 +
<TD ALIGN=LEFT>A set of EClasses has an empty super EClass which shall be removed. This EClass is not associated to another EClass. It has no features and it is not referred to as type of an EParameter.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Remove EParameter</TD>
 +
<TD ALIGN=LEFT>An EParameter is no longer needed by an EOperation. Therefore, this refactoring removes this parameter from the parameter list of the EOperation.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Rename EAttribute</TD>
 +
<TD ALIGN=LEFT>Renames an existing EAttribute to the inserted new name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Rename EClass</TD>
 +
<TD ALIGN=LEFT>Renames an existing EClass to the inserted new name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Rename EDataType</TD>
 +
<TD ALIGN=LEFT>Renames an existing EDataTypeto the inserted new name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Rename EEnumLiteral</TD>
 +
<TD ALIGN=LEFT>Renames an existing EEnumLiteral to the inserted new name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Rename EOperation</TD>
 +
<TD ALIGN=LEFT>Renames an existing EOperation to the inserted new name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Rename EPackage</TD>
 +
<TD ALIGN=LEFT>Renames an existing EPackage to the inserted new name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Rename EParameter</TD>
 +
<TD ALIGN=LEFT>Renames an existing EParameter to the inserted new name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Rename EReference</TD>
 +
<TD ALIGN=LEFT>Renames an existing EReference to the inserted new name.</TD>
 +
</TR>
 +
 
 +
</TABLE>
 +
 
 +
== Provided techniques for UML2 models ==
 +
 
 +
EMF Refactor provides the following model quality assurance techniques for UML2 models (nsUri ''http://www.eclipse.org/uml2/4.0.0/UML'').
 +
 
 +
=== Provided metrics for UML2 models ===
 +
----
 +
<TABLE BORDER=1 CELLPADDING=8 CELLSPACING=5 bgcolor="#ffffff">
 +
 
 +
<TR>
 +
<TD COLSPAN=3 ALIGN=CENTER><font size=+1>Context: Model</font></TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TH>Metric</TH>
 +
<TH>Description</TH>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>AGvsC</TD>
 +
<TD ALIGN=LEFT>Ratio between number of aggregations and number of classes in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>ANA</TD>
 +
<TD ALIGN=LEFT>Average number of ancestors of all classes in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>ASvsC</TD>
 +
<TD ALIGN=LEFT>Ratio between number of associations and number of classes in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>ATvsCC</TD>
 +
<TD ALIGN=LEFT>Ratio between number of attributes and number of classes in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>DEPvsC</TD>
 +
<TD ALIGN=LEFT>Ratio between number of class dependencies and number of classes in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>GEvsC</TD>
 +
<TD ALIGN=LEFT>Ratio between number of inheritance relations and number of classes in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>MaxDIT</TD>
 +
<TD ALIGN=LEFT>Maximum of all depths of inheritance trees.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>MaxHAgg</TD>
 +
<TD ALIGN=LEFT>Maximum of aggregation trees.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NACM</TD>
 +
<TD ALIGN=LEFT>Number of all ancestors of all classes in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NACTM</TD>
 +
<TD ALIGN=LEFT>Number of attributes with class type in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NAGM</TD>
 +
<TD ALIGN=LEFT>Number of aggregations in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NASM</TD>
 +
<TD ALIGN=LEFT>Number of associations in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NATM</TD>
 +
<TD ALIGN=LEFT>Number of attributes whithin classes of the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NCM</TD>
 +
<TD ALIGN=LEFT>Number of classes in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NDEPM</TD>
 +
<TD ALIGN=LEFT>Number of class dependencies in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NIH</TD>
 +
<TD ALIGN=LEFT>Total number of inheritance hierarchies in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NIM</TD>
 +
<TD ALIGN=LEFT>Number of inheritance relations in the model.</TD>
 +
 
 +
<TR>
 +
<TD>NNOEM</TD>
 +
<TD ALIGN=LEFT>Number of navigable owned association ends in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NOM</TD>
 +
<TD ALIGN=LEFT>Number of operations whithin classes of the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NPM</TD>
 +
<TD ALIGN=LEFT>Number of packages in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NTDM</TD>
 +
<TD ALIGN=LEFT>Number of class type dependencies in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>OvsC</TD>
 +
<TD ALIGN=LEFT>Ratio between number of operations and number of classes in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>TNME</TD>
 +
<TD ALIGN=LEFT>Total number of elements in the model.</TD>
 +
</TR>
 +
 
 +
</TABLE>
 +
 
 +
 
 +
<TABLE BORDER=1 CELLPADDING=8 CELLSPACING=5 bgcolor="#ffffff">
 +
 
 +
<TR>
 +
<TD COLSPAN=3 ALIGN=CENTER><font size=+1>Context: Package</font></TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TH>Metric</TH>
 +
<TH>Description</TH>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>A</TD>
 +
<TD ALIGN=LEFT>Ratio between number of abstract classes and number of classes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>AHF</TD>
 +
<TD ALIGN=LEFT>Attribute hiding factor.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>AIF</TD>
 +
<TD ALIGN=LEFT>Attribute inheritance factor.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Ca</TD>
 +
<TD ALIGN=LEFT>Afferent coupling.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Ce</TD>
 +
<TD ALIGN=LEFT>Efferent coupling.</TD>
 +
 
 +
<TR>
 +
<TD>DNH</TD>
 +
<TD ALIGN=LEFT>Depth in the nesting hierarchy.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>H</TD>
 +
<TD ALIGN=LEFT>Relational cohesion.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>I</TD>
 +
<TD ALIGN=LEFT>Ratio between efferent coupling and total coupling (instability).</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NACP</TD>
 +
<TD ALIGN=LEFT>Number of abstract classes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NAETOP</TD>
 +
<TD ALIGN=LEFT>Number of internal navigable owned association ends typed by classes in other packages.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NAGGR</TD>
 +
<TD ALIGN=LEFT>Number of aggregation relationships within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NASP</TD>
 +
<TD ALIGN=LEFT>Number of associations within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NATIP</TD>
 +
<TD ALIGN=LEFT>Number of inherited attributes in classes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NATP</TD>
 +
<TD ALIGN=LEFT>Number of attributes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NAVCP</TD>
 +
<TD ALIGN=LEFT>Ratio between number of associations and number of classes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NCAP</TD>
 +
<TD ALIGN=LEFT>Number of classes and associations within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NCCP</TD>
 +
<TD ALIGN=LEFT>Number of concrete classes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NDCOP</TD>
 +
<TD ALIGN=LEFT>Number of dependencies of classes in other packages on classes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NDOCP</TD>
 +
<TD ALIGN=LEFT>Number of dependencies of classes within the package on classes in other packages.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NEACP</TD>
 +
<TD ALIGN=LEFT>Number of attributes in external classes typed by classes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NEAECP</TD>
 +
<TD ALIGN=LEFT>Number of external navigable owned association ends typed by classes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NESUBP</TD>
 +
<TD ALIGN=LEFT>Number of external classes which are direct subclasses of classes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NESUPP</TD>
 +
<TD ALIGN=LEFT>Number of external classes which are direct superclases of classes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NETAP</TD>
 +
<TD ALIGN=LEFT>Number of attributes within the package typed by classes in other packages.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NIAEP</TD>
 +
<TD ALIGN=LEFT>Number of internal navigable owned association end types within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NIATP</TD>
 +
<TD ALIGN=LEFT>Number of internal attribute class types within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NICRP</TD>
 +
<TD ALIGN=LEFT>Number of internal relationships between classes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NIGP</TD>
 +
<TD ALIGN=LEFT>Number of internal generalization relationships within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NINP</TD>
 +
<TD ALIGN=LEFT>Number of interfaces within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NIRP</TD>
 +
<TD ALIGN=LEFT>Number of interface realizations within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NITRP</TD>
 +
<TD ALIGN=LEFT>Number of internal class type relationships within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NIUP</TD>
 +
<TD ALIGN=LEFT>Number of interface usages within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NNIACP</TD>
 +
<TD ALIGN=LEFT>Number of non-inherited abstract classes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NNPATP</TD>
 +
<TD ALIGN=LEFT>Number of non-public attributes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NNPOPP</TD>
 +
<TD ALIGN=LEFT>Number of non-public operations within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NOPIP</TD>
 +
<TD ALIGN=LEFT>Number of inherited operations in classes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NOPMP</TD>
 +
<TD ALIGN=LEFT>Number of other packages in the model.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NOPP</TD>
 +
<TD ALIGN=LEFT>Number of owned operations within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NPP</TD>
 +
<TD ALIGN=LEFT>Number of directly nested packages inside the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NTCTP</TD>
 +
<TD ALIGN=LEFT>Number of times classes within the package are used as types from outside the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NTTCP</TD>
 +
<TD ALIGN=LEFT>Number of times classes within the package use classes in other packages as type.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>OHF</TD>
 +
<TD ALIGN=LEFT>Operation hiding factor.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>OIF</TD>
 +
<TD ALIGN=LEFT>Operation inheritance factor.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>TC</TD>
 +
<TD ALIGN=LEFT>Total coupling.</TD>
 +
</TR>
 +
 
 +
<TR><TD>TNATP</TD>
 +
<TD ALIGN=LEFT>Total number of attributes in classes within the package.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>TNCP</TD>
 +
<TD ALIGN=LEFT>Total number of classes within the package.</TD>
 +
</TR>
 +
 +
<TR>
 +
<TD>TNOPP</TD>
 +
<TD ALIGN=LEFT>Total number of operations in classes within the package.</TD>
 +
</TR>
 +
 
 +
</TABLE>
 +
 
 +
 
 +
<TABLE BORDER=1 CELLPADDING=8 CELLSPACING=5 bgcolor="#ffffff">
 +
 
 +
<TR>
 +
<TD COLSPAN=3 ALIGN=CENTER><font size=+1>Context: Class</font></TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TH>Metric</TH>
 +
<TH>Description</TH>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>APOC</TD>
 +
<TD ALIGN=LEFT>Average number of parameters in all operations within the class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>CBC</TD>
 +
<TD ALIGN=LEFT>Number of attributes and associations with class type (coupling between classes).</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>DAC</TD>
 +
<TD ALIGN=LEFT>Number of attributes that have another class as type.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>DAC2</TD>
 +
<TD ALIGN=LEFT>Number of different classes that are used as attribute type.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>DAM</TD>
 +
<TD ALIGN=LEFT>Ratio between number of private and protected attributes and number of attributes.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>ECAtt</TD>
 +
<TD ALIGN=LEFT>Number of times the class is externally used as attribute type.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>ECPar</TD>
 +
<TD ALIGN=LEFT>Number of times the class is externally used as parameter type.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>HAgg</TD>
 +
<TD ALIGN=LEFT>Length of the longest path to the leaves in the aggregation hierarchy.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>ICPar</TD>
 +
<TD ALIGN=LEFT>Number of parameters within the class having another class or interface as type.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>ICParC</TD>
 +
<TD ALIGN=LEFT>Number of parameters within the class having another class as type.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>ICParI</TD>
 +
<TD ALIGN=LEFT>Number of parameters within the class having another interface as type.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>MaxDITC</TD>
 +
<TD ALIGN=LEFT>Depth of Inheritance Tree (maximum due to multiple inheritance).</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NAI</TD>
 +
<TD ALIGN=LEFT>Number of attributes visible to subclasses (public and protected).</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NAPTC</TD>
 +
<TD ALIGN=LEFT>Number of attributes with primitive type within the class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NASC</TD>
 +
<TD ALIGN=LEFT>Number of association with other classes or itself.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NASOC</TD>
 +
<TD ALIGN=LEFT>Number of associations with other classes.</TD>
 +
 
 +
<TR>
 +
<TD>NASSC</TD>
 +
<TD ALIGN=LEFT>Number of associations with itself.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NATC</TD>
 +
<TD ALIGN=LEFT>Number of attributes within the class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NCATC</TD>
 +
<TD ALIGN=LEFT>Number of constant attributes within the class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NDPC</TD>
 +
<TD ALIGN=LEFT>Number of direct part classes which compose a composite class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NEATC</TD>
 +
<TD ALIGN=LEFT>Number of equal attributes with other classes.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NFEAC</TD>
 +
<TD ALIGN=LEFT>Number of features within the class (attributes and operations).</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NOPC</TD>
 +
<TD ALIGN=LEFT>Number of operations within the class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NPACAC</TD>
 +
<TD ALIGN=LEFT>Number of package attributes within the class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NPARC</TD>
 +
<TD ALIGN=LEFT>Number of parameters in all operations within the class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NPPAC</TD>
 +
<TD ALIGN=LEFT>Number of private and protected attributes within the class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NPRIAC</TD>
 +
<TD ALIGN=LEFT>Number of private attributes within the class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NPROAC</TD>
 +
<TD ALIGN=LEFT>Number of protected attributes within the class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NPUBAC</TD>
 +
<TD ALIGN=LEFT>Number of public attributes within the class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NSUBC</TD>
 +
<TD ALIGN=LEFT>Number of direct child classes of the class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NSUBC2</TD>
 +
<TD ALIGN=LEFT>Number of all children of the class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NSUPC</TD>
 +
<TD ALIGN=LEFT>Number of direct parent classes of the class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NSUPC2</TD>
 +
<TD ALIGN=LEFT>Total number of ancestors of the class.</TD>
 +
</TR>
 +
 
 +
</TABLE>
 +
 
 +
 
 +
<TABLE BORDER=1 CELLPADDING=8 CELLSPACING=5 bgcolor="#ffffff">
 +
 
 +
<TR>
 +
<TD COLSPAN=3 ALIGN=CENTER><font size=+1>Context: Operation</font></TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TH>Metric</TH>
 +
<TH>Description</TH>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NEIPO</TD>
 +
<TD ALIGN=LEFT>Number of equal input-parameters in sibling operations.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NINPO</TD>
 +
<TD ALIGN=LEFT>Number of in-parameters within the operation.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NINPPO</TD>
 +
<TD ALIGN=LEFT>Number of input-parameters within the operation.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>NIOPO</TD>
 +
<TD ALIGN=LEFT>Number of inout-parameters within the operation.</TD>
 +
</TR>
 +
 
 +
</TABLE>
 +
 
 +
=== Provided smells for UML2 models ===
 +
----
 +
 
 +
<TABLE BORDER=1 CELLPADDING=8 CELLSPACING=5 bgcolor="#ffffff">
 +
 
 +
<TR>
 +
<TH>Smell</TH>
 +
<TH>Description</TH>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Abstract Package</TD>
 +
<TD ALIGN=LEFT>The model contains a Package with a qouta of abstract Classes higher than the specified limit.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Attribute Name Overridden</TD>
 +
<TD ALIGN=LEFT>The model contains an attribute with the same name as an inherited attribute.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Concrete Superclass</TD>
 +
<TD ALIGN=LEFT>The model contains an abstract class with a concrete superclass.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Data Clumps (Attributes)</TD>
 +
<TD ALIGN=LEFT>The model contains classes with more than a specific number of equal attributes in sibling classes.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Data Clumps (Parameters)</TD>
 +
<TD ALIGN=LEFT>The model contains operations with more than a specific number of equal input parameters in sibling operations.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Diamond Inheritance</TD>
 +
<TD ALIGN=LEFT>A Class inherits from another one multiple times.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Empty Package</TD>
 +
<TD ALIGN=LEFT>The model contains a package without any contained elements.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Equal Attributes in Sibling Classes</TD>
 +
<TD ALIGN=LEFT>Each sibling class of the owning class of an attribute contains an equal attribute.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Equally Named Classes</TD>
 +
<TD ALIGN=LEFT>The model contains two classes (in different packages) having the same name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Large Class</TD>
 +
<TD ALIGN=LEFT>The model contains a class owning more features (attributes and operations) than the specified limit.</TD>
 +
</TR> 
 +
 
 +
<TR>
 +
<TD>Long Parameter List</TD>
 +
<TD ALIGN=LEFT>The model contains an operation with more input parameters than the specified limit.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>No Specification</TD>
 +
<TD ALIGN=LEFT>The model contains an abstract Class without any concrete subclasses.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Primitive Obsession (Constants)</TD>
 +
<TD ALIGN=LEFT>The model contains a class with more constant attributes than the specified limit.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Primitive Obsession (Primitive Types)</TD>
 +
<TD ALIGN=LEFT>The model contains a class with more attributes having primitive types than the specified limit.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Specialization Aggregation</TD>
 +
<TD ALIGN=LEFT>The model contains a generalization hierarchy between associations.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Speculative Generality (Abstract Class)</TD>
 +
<TD ALIGN=LEFT>The model contains an abstract class that is inherited by one single class only.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Speculative Generality (Interface)</TD>
 +
<TD ALIGN=LEFT>The model contains an interface that is implemented by one single class only.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Unnamed Attribute</TD>
 +
<TD ALIGN=LEFT>The model contains an attribute without a name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Unnamed Class</TD>
 +
<TD ALIGN=LEFT>The model contains a class without a name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Unnamed Data Type</TD>
 +
<TD ALIGN=LEFT>The model contains a data type without a name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Unnamed Interface</TD>
 +
<TD ALIGN=LEFT>The model contains an interface without a name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Unnamed Operation</TD>
 +
<TD ALIGN=LEFT>The model contains an operation without a name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Unnamed Package</TD>
 +
<TD ALIGN=LEFT>The model contains a package without a name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Unnamed Parameter</TD>
 +
<TD ALIGN=LEFT>The model contains a parameter without a name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Unused Class</TD>
 +
<TD ALIGN=LEFT>The model contains a class that has no child or parent classes, that is not associated to any other classes, and that is not used as attribute or parameter type.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Unused Enumeration</TD>
 +
<TD ALIGN=LEFT>The model contains an enumeration whose literals are not used as any attribute types.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Unused Interface</TD>
 +
<TD ALIGN=LEFT>The model contains an interface that is not specialized by another interface, and not realized or used by any classes.</TD>
 +
</TR>
 +
 
 +
</TABLE>
 +
 
 +
=== Provided refactorings for UML2 models ===
 +
----
 +
<TABLE BORDER=1 CELLPADDING=8 CELLSPACING=5 bgcolor="#ffffff">
 +
 
 +
<TR>
 +
<TH>Refactoring</TH>
 +
<TH>Description</TH>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Add Parameter</TD>
 +
<TD ALIGN=LEFT>An operation needs more information from its callers. Therefore, this refactoring adds a parameter to an operation.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Create Associated Class</TD>
 +
<TD ALIGN=LEFT>This refactoring creates an empty class and connects it with a new association to the source class from where it is extracted. The multiplicities of the new association is 1 at both ends. Usually, refactorings Move Attribute and Move Operation are the next steps after this refactoring.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Create Class with Attributes from Parameter List</TD>
 +
<TD ALIGN=LEFT>There is a group of parameters that naturally go together. This refactoring creates a new class and inserts new attributes which conform to the given parameter list. It is a part of refactoring Introduce Parameter Object.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Create Subclass</TD>
 +
<TD ALIGN=LEFT>A class has features (attributes or operations) that are not used features. However, the new subclass has no features. Usually, refactorings Push Down Attribute and Push Down Operation are the next steps after this refactoring.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Create Superclass</TD>
 +
<TD ALIGN=LEFT>This refactoring can be applied when there are at least two classes with similar features (attributes or operations). The refactoring creates a superclass for this set of classes and is normally followed by refactorings Pull Up Attribute and Pull Up Operation. So, the refactoring helps to reduce the duplicate common features spread throughout different classes.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Extract Class</TD>
 +
<TD ALIGN=LEFT>This refactoring extracts interrelated features (attributes and operations) from a class to a new separated class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Extract Subclass</TD>
 +
<TD ALIGN=LEFT>There are features (attributes and operations) in a class required for a special case only. This refactoring extracts a subclass containing this features.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Extract Superclass</TD>
 +
<TD ALIGN=LEFT>There are two or more classes with similar features. This refactoring creates a new superclass and moves the common features to the superclass. The refactoring helps to reduce redundancy by assembling common features spread throughout different classes.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Hide Attribute</TD>
 +
<TD ALIGN=LEFT>This refactoring hides a public class attribute by setting its visibility to private and creates corresponding getter and setter operations.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Inline Class</TD>
 +
<TD ALIGN=LEFT>There are two classes connected by a 1:1 association. One of them has no further use. This refactoring merges these classes.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Introduce Parameter Object</TD>
 +
<TD ALIGN=LEFT>There is a group of parameters that naturally go together. This refactoring replaces a list of parameters with one object. This parameter object is created for that purpose.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Move Attribute</TD>
 +
<TD ALIGN=LEFT>A property (attribute) is better placed in another class which is associated to this class. This refactoring moves this property to the associated class.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Move Operation</TD>
 +
<TD ALIGN=LEFT>This refactoring moves an operation of a class to an associated class. It is often applied when some class has too much behavior or when classes collaborate too much.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Pull Up Attribute</TD>
 +
<TD ALIGN=LEFT>This refactoring removes one property (attribute) from a class or a set of classes and inserts it to one of its superclasses.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Pull Up Operation</TD>
 +
<TD ALIGN=LEFT>This refactoring pulls an operation of a class to its superclass. It is used internally on several classes which inherit from the same superclass. The aim of this refactoring is often to extract identical operations.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Push Down Attribute</TD>
 +
<TD ALIGN=LEFT>An attribute (property) is used only by some subclasses. Move the attribute to only these subclasses. More generally, this refactoring moves the attribute to all subclasses. If it makes sense, the attribute can be removed from some of these afterwards. Sometimes, it also makes sense to keep an attribute in all subclasses to hide it from the superclass.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Push Down Operation</TD>
 +
<TD ALIGN=LEFT>This refactoring pushes an operation from the owning class down to all its subclasses. If it makes sense, the operation can be removed from some of these afterwards. Sometimes, it also makes sense to keep an operation in all subclasses to hide it from the superclass.</TD>
 +
</TR>  
 +
 
 +
<TR>
 +
<TD>Remove Empty Associated Class</TD>
 +
<TD ALIGN=LEFT>There is an empty class that is associated to another class. An associated class is empty if it has no features except for possible getter and setter operations for the corresponding association end. Furthermore, it has no inner classes, subclasses, or superclasses, it does not implement any interfaces, and it is not referred to as type of an attribute, operation or parameter.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Remove Empty Subclass</TD>
 +
<TD ALIGN=LEFT>A superclass has an empty subclass which shall be removed. This class is not associated to another class. It has no features, no inner classes, no further subclasses, and is not associated to other classes. It does not implement any interfaces, and it is not referred to as type of an attribute, operation or parameter.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Remove Empty Superclass</TD>
 +
<TD ALIGN=LEFT>A set of classes has an empty superclass which shall be removed. This class is not associated to another class. It has no features, no inner classes, and is not associated to other classes. It does not implement any interfaces, and it is not referred to as type of an attribute, operation or parameter.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Remove Parameter</TD>
 +
<TD ALIGN=LEFT>A parameter is no longer needed by an operation. Therefore, this refactoring removes this parameter from the parameter list of the operation.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Remove Superclass</TD>
 +
<TD ALIGN=LEFT>There is a set of classes having a superclass that does not make sense anymore. Remove this superclass after pushing remaining features down.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Remove Unused Interface</TD>
 +
<TD ALIGN=LEFT>This refactoring removes a given interface which is not used by and not realized by any classifier and has no sub interface.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Rename Attribute</TD>
 +
<TD ALIGN=LEFT>Renames an existing class attribute to the inserted new name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Rename Class</TD>
 +
<TD ALIGN=LEFT>Renames an existing class to the inserted new name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Rename Operation</TD>
 +
<TD ALIGN=LEFT>Renames an existing operation to the inserted new name.</TD>
 +
</TR>
 +
 
 +
<TR>
 +
<TD>Show Attribute</TD>
 +
<TD ALIGN=LEFT>This refactoring shows a private class attribute by setting its visibility to public and removes corresponding getter and setter operations.</TD>
 +
</TR>  
 +
 
 +
</TABLE>

Latest revision as of 16:42, 25 April 2014

The following model quality assurance techniques are provided by EMF Refactor.

Provided techniques for Ecore models

EMF Refactor provides the following model quality assurance techniques for Ecore models (nsUri http://www.eclipse.org/emf/2002/Ecore).

Provided metrics for Ecore models


Context Metric Description
EClass AvEPEOEC Average number of EParameters in EOperations of the given EClass.
EClass ECEOEC Number of EReferences of other EClasses having the given EClass as type.
EClass ECEPEC Number of EParameters within other EClasses having the given EClass as type.
EClass ECEREC Number of EReferences of other EClasses having the given EClass as type.
EClass HAGGEC Length of the longest path to the leaves in the aggregation hierarchy.
EClass ICEPEC Number of EParameters within the EClass having another EClass or interface as type.
EClass ICEPECEC Number of EParameters within the EClass having another EClass as type.
EClass ICEPEIEC Number of EParameters within the EClass having another interface as type.
EClass MAXDITEC Depth of Inheritance Tree (maximum due to multiple inheritance).
EClass NCEAEC Number of constant EAttributes of the given EClass.
EClass NDEROEC Number of different EClasses being referenced by the given EClass.
EClass NEAEC Number of EAttributes of the given EClass.
EClass NEOEC Number of EOperations of the given EClass.
EClass NEPEC Total number of EParameters in EOperations of the given EClass.
EClass NEREC Total number of EReferences of the given EClass.
EClass NEROEC Number of EReferences of the given EClass to other EClasses.
EClass NERSEC Number of EReferences of the given EClass to itself.
EClass NFEEC Number of features (EAttributes and EOperations) of the given EClass.
EClass NPECEC Number of EClasses being parts of the given EClass.
EClass NSUBEC Number of direct child EClasses of the given EClass.
EClass NSUBEC2 Number of all child EClasses of the given EClass.
EClass NSUPEC Number of direct parent EClasses of the given EClass.
EClass NSUPEC2 Total number of ancestors of the given EClass.

Provided smells for Ecore models


Smell Description
Large EClass The model contains an EClass owning more features (EAttributes and EOperations) than the specified limit.
Speculative Generality EClass The model contains an abstract EClass that is inherited by one concrete EClass only.
Unnamed EClass The model contains an EClass without a name.

Provided refactorings for Ecore models


Refactoring Description
Add EParameter with EClassifier type An EOperation needs more information from its callers. Therefore, this refactoring adds an EParameter to an EOperation.
Create referenced EClass This refactoring creates an empty EClass and connects it with a new EReference to the source EClass from where it is extracted. The multiplicities of the new association is 1. Usually, refactorings Move EAttribute and Move EOperation are the next steps after this refactoring.
Create sub EClass An EClass has features (attributes or operations) that are not used features. However, the new subclass has these features. Usually, refactorings Push Down EAttribute and Push Down EOperation are the next steps after this refactoring.
Create super EClass This refactoring can be applied when there are at least two EClasses with similar features (attributes or operations). The refactoring creates a super EClass for this set of EClasses and is normally followed by refactorings Pull Up EAttribute and Pull Up EOperation. So, the refactoring helps to reduce the duplicate common features spread throughout different EClasses.
Move EAttribute An EAttribute is better placed in another EClass which is associated to this EClass. This refactoring moves this EAttribute to the associated EClass.
Move EOperation This refactoring moves an EOperation of ab EClass to an associated EClass. It is often applied when some EClass has too much behavior or when EClasses collaborate too much.
Pull up EAttribute This refactoring removes an EAttribut) from an EClass or a set of EClasses and inserts it to one of its super EClasses.
Pull up EOperation This refactoring pulls an EOperation of an EClass to its super EClass. It is used internally on several EClasses which inherit from the same super EClass. The aim of this refactoring is often to extract identical EOperations.
Push down EAttribute An EAttribute is used only by some sub EClasses. Move the EAttribute to only these sub EClasses. More generally, this refactoring moves the EAttribute to all sub EClasses. If it makes sense, the EAttribute can be removed from some of these afterwards. Sometimes, it also makes sense to keep an EAttribute in all sub EClasses to hide it from the super EClass.
Push down EOperation This refactoring pushes an EOperation from the owning EClass down to all its sub EClasses. If it makes sense, the EOperation can be removed from some of these afterwards. Sometimes, it also makes sense to keep an EOperation in all sub EClasses to hide it from the super EClass.
Remove empty referenced EClass There is an empty EClass that is associated to another EClass. An associated EClass is empty if it has no features. Furthermore, it has no sub EClasses or super EClasses, and it is not referred to as type of an EParameter.
Remove empty sub EClass A super EClass has an empty sub EClass which shall be removed. This EClass is not associated to another EClass. It has no features, no further sub EClasses, and it is not referred to as type of an EParameter.
Remove empty super EClass A set of EClasses has an empty super EClass which shall be removed. This EClass is not associated to another EClass. It has no features and it is not referred to as type of an EParameter.
Remove EParameter An EParameter is no longer needed by an EOperation. Therefore, this refactoring removes this parameter from the parameter list of the EOperation.
Rename EAttribute Renames an existing EAttribute to the inserted new name.
Rename EClass Renames an existing EClass to the inserted new name.
Rename EDataType Renames an existing EDataTypeto the inserted new name.
Rename EEnumLiteral Renames an existing EEnumLiteral to the inserted new name.
Rename EOperation Renames an existing EOperation to the inserted new name.
Rename EPackage Renames an existing EPackage to the inserted new name.
Rename EParameter Renames an existing EParameter to the inserted new name.
Rename EReference Renames an existing EReference to the inserted new name.

Provided techniques for UML2 models

EMF Refactor provides the following model quality assurance techniques for UML2 models (nsUri http://www.eclipse.org/uml2/4.0.0/UML).

Provided metrics for UML2 models


Context: Model
Metric Description
AGvsC Ratio between number of aggregations and number of classes in the model.
ANA Average number of ancestors of all classes in the model.
ASvsC Ratio between number of associations and number of classes in the model.
ATvsCC Ratio between number of attributes and number of classes in the model.
DEPvsC Ratio between number of class dependencies and number of classes in the model.
GEvsC Ratio between number of inheritance relations and number of classes in the model.
MaxDIT Maximum of all depths of inheritance trees.
MaxHAgg Maximum of aggregation trees.
NACM Number of all ancestors of all classes in the model.
NACTM Number of attributes with class type in the model.
NAGM Number of aggregations in the model.
NASM Number of associations in the model.
NATM Number of attributes whithin classes of the model.
NCM Number of classes in the model.
NDEPM Number of class dependencies in the model.
NIH Total number of inheritance hierarchies in the model.
NIM Number of inheritance relations in the model.
NNOEM Number of navigable owned association ends in the model.
NOM Number of operations whithin classes of the model.
NPM Number of packages in the model.
NTDM Number of class type dependencies in the model.
OvsC Ratio between number of operations and number of classes in the model.
TNME Total number of elements in the model.


Context: Package
Metric Description
A Ratio between number of abstract classes and number of classes within the package.
AHF Attribute hiding factor.
AIF Attribute inheritance factor.
Ca Afferent coupling.
Ce Efferent coupling.
DNH Depth in the nesting hierarchy.
H Relational cohesion.
I Ratio between efferent coupling and total coupling (instability).
NACP Number of abstract classes within the package.
NAETOP Number of internal navigable owned association ends typed by classes in other packages.
NAGGR Number of aggregation relationships within the package.
NASP Number of associations within the package.
NATIP Number of inherited attributes in classes within the package.
NATP Number of attributes within the package.
NAVCP Ratio between number of associations and number of classes within the package.
NCAP Number of classes and associations within the package.
NCCP Number of concrete classes within the package.
NDCOP Number of dependencies of classes in other packages on classes within the package.
NDOCP Number of dependencies of classes within the package on classes in other packages.
NEACP Number of attributes in external classes typed by classes within the package.
NEAECP Number of external navigable owned association ends typed by classes within the package.
NESUBP Number of external classes which are direct subclasses of classes within the package.
NESUPP Number of external classes which are direct superclases of classes within the package.
NETAP Number of attributes within the package typed by classes in other packages.
NIAEP Number of internal navigable owned association end types within the package.
NIATP Number of internal attribute class types within the package.
NICRP Number of internal relationships between classes within the package.
NIGP Number of internal generalization relationships within the package.
NINP Number of interfaces within the package.
NIRP Number of interface realizations within the package.
NITRP Number of internal class type relationships within the package.
NIUP Number of interface usages within the package.
NNIACP Number of non-inherited abstract classes within the package.
NNPATP Number of non-public attributes within the package.
NNPOPP Number of non-public operations within the package.
NOPIP Number of inherited operations in classes within the package.
NOPMP Number of other packages in the model.
NOPP Number of owned operations within the package.
NPP Number of directly nested packages inside the package.
NTCTP Number of times classes within the package are used as types from outside the package.
NTTCP Number of times classes within the package use classes in other packages as type.
OHF Operation hiding factor.
OIF Operation inheritance factor.
TC Total coupling.
TNATP Total number of attributes in classes within the package.
TNCP Total number of classes within the package.
TNOPP Total number of operations in classes within the package.


Context: Class
Metric Description
APOC Average number of parameters in all operations within the class.
CBC Number of attributes and associations with class type (coupling between classes).
DAC Number of attributes that have another class as type.
DAC2 Number of different classes that are used as attribute type.
DAM Ratio between number of private and protected attributes and number of attributes.
ECAtt Number of times the class is externally used as attribute type.
ECPar Number of times the class is externally used as parameter type.
HAgg Length of the longest path to the leaves in the aggregation hierarchy.
ICPar Number of parameters within the class having another class or interface as type.
ICParC Number of parameters within the class having another class as type.
ICParI Number of parameters within the class having another interface as type.
MaxDITC Depth of Inheritance Tree (maximum due to multiple inheritance).
NAI Number of attributes visible to subclasses (public and protected).
NAPTC Number of attributes with primitive type within the class.
NASC Number of association with other classes or itself.
NASOC Number of associations with other classes.
NASSC Number of associations with itself.
NATC Number of attributes within the class.
NCATC Number of constant attributes within the class.
NDPC Number of direct part classes which compose a composite class.
NEATC Number of equal attributes with other classes.
NFEAC Number of features within the class (attributes and operations).
NOPC Number of operations within the class.
NPACAC Number of package attributes within the class.
NPARC Number of parameters in all operations within the class.
NPPAC Number of private and protected attributes within the class.
NPRIAC Number of private attributes within the class.
NPROAC Number of protected attributes within the class.
NPUBAC Number of public attributes within the class.
NSUBC Number of direct child classes of the class.
NSUBC2 Number of all children of the class.
NSUPC Number of direct parent classes of the class.
NSUPC2 Total number of ancestors of the class.


Context: Operation
Metric Description
NEIPO Number of equal input-parameters in sibling operations.
NINPO Number of in-parameters within the operation.
NINPPO Number of input-parameters within the operation.
NIOPO Number of inout-parameters within the operation.

Provided smells for UML2 models


Smell Description
Abstract Package The model contains a Package with a qouta of abstract Classes higher than the specified limit.
Attribute Name Overridden The model contains an attribute with the same name as an inherited attribute.
Concrete Superclass The model contains an abstract class with a concrete superclass.
Data Clumps (Attributes) The model contains classes with more than a specific number of equal attributes in sibling classes.
Data Clumps (Parameters) The model contains operations with more than a specific number of equal input parameters in sibling operations.
Diamond Inheritance A Class inherits from another one multiple times.
Empty Package The model contains a package without any contained elements.
Equal Attributes in Sibling Classes Each sibling class of the owning class of an attribute contains an equal attribute.
Equally Named Classes The model contains two classes (in different packages) having the same name.
Large Class The model contains a class owning more features (attributes and operations) than the specified limit.
Long Parameter List The model contains an operation with more input parameters than the specified limit.
No Specification The model contains an abstract Class without any concrete subclasses.
Primitive Obsession (Constants) The model contains a class with more constant attributes than the specified limit.
Primitive Obsession (Primitive Types) The model contains a class with more attributes having primitive types than the specified limit.
Specialization Aggregation The model contains a generalization hierarchy between associations.
Speculative Generality (Abstract Class) The model contains an abstract class that is inherited by one single class only.
Speculative Generality (Interface) The model contains an interface that is implemented by one single class only.
Unnamed Attribute The model contains an attribute without a name.
Unnamed Class The model contains a class without a name.
Unnamed Data Type The model contains a data type without a name.
Unnamed Interface The model contains an interface without a name.
Unnamed Operation The model contains an operation without a name.
Unnamed Package The model contains a package without a name.
Unnamed Parameter The model contains a parameter without a name.
Unused Class The model contains a class that has no child or parent classes, that is not associated to any other classes, and that is not used as attribute or parameter type.
Unused Enumeration The model contains an enumeration whose literals are not used as any attribute types.
Unused Interface The model contains an interface that is not specialized by another interface, and not realized or used by any classes.

Provided refactorings for UML2 models


Refactoring Description
Add Parameter An operation needs more information from its callers. Therefore, this refactoring adds a parameter to an operation.
Create Associated Class This refactoring creates an empty class and connects it with a new association to the source class from where it is extracted. The multiplicities of the new association is 1 at both ends. Usually, refactorings Move Attribute and Move Operation are the next steps after this refactoring.
Create Class with Attributes from Parameter List There is a group of parameters that naturally go together. This refactoring creates a new class and inserts new attributes which conform to the given parameter list. It is a part of refactoring Introduce Parameter Object.
Create Subclass A class has features (attributes or operations) that are not used features. However, the new subclass has no features. Usually, refactorings Push Down Attribute and Push Down Operation are the next steps after this refactoring.
Create Superclass This refactoring can be applied when there are at least two classes with similar features (attributes or operations). The refactoring creates a superclass for this set of classes and is normally followed by refactorings Pull Up Attribute and Pull Up Operation. So, the refactoring helps to reduce the duplicate common features spread throughout different classes.
Extract Class This refactoring extracts interrelated features (attributes and operations) from a class to a new separated class.
Extract Subclass There are features (attributes and operations) in a class required for a special case only. This refactoring extracts a subclass containing this features.
Extract Superclass There are two or more classes with similar features. This refactoring creates a new superclass and moves the common features to the superclass. The refactoring helps to reduce redundancy by assembling common features spread throughout different classes.
Hide Attribute This refactoring hides a public class attribute by setting its visibility to private and creates corresponding getter and setter operations.
Inline Class There are two classes connected by a 1:1 association. One of them has no further use. This refactoring merges these classes.
Introduce Parameter Object There is a group of parameters that naturally go together. This refactoring replaces a list of parameters with one object. This parameter object is created for that purpose.
Move Attribute A property (attribute) is better placed in another class which is associated to this class. This refactoring moves this property to the associated class.
Move Operation This refactoring moves an operation of a class to an associated class. It is often applied when some class has too much behavior or when classes collaborate too much.
Pull Up Attribute This refactoring removes one property (attribute) from a class or a set of classes and inserts it to one of its superclasses.
Pull Up Operation This refactoring pulls an operation of a class to its superclass. It is used internally on several classes which inherit from the same superclass. The aim of this refactoring is often to extract identical operations.
Push Down Attribute An attribute (property) is used only by some subclasses. Move the attribute to only these subclasses. More generally, this refactoring moves the attribute to all subclasses. If it makes sense, the attribute can be removed from some of these afterwards. Sometimes, it also makes sense to keep an attribute in all subclasses to hide it from the superclass.
Push Down Operation This refactoring pushes an operation from the owning class down to all its subclasses. If it makes sense, the operation can be removed from some of these afterwards. Sometimes, it also makes sense to keep an operation in all subclasses to hide it from the superclass.
Remove Empty Associated Class There is an empty class that is associated to another class. An associated class is empty if it has no features except for possible getter and setter operations for the corresponding association end. Furthermore, it has no inner classes, subclasses, or superclasses, it does not implement any interfaces, and it is not referred to as type of an attribute, operation or parameter.
Remove Empty Subclass A superclass has an empty subclass which shall be removed. This class is not associated to another class. It has no features, no inner classes, no further subclasses, and is not associated to other classes. It does not implement any interfaces, and it is not referred to as type of an attribute, operation or parameter.
Remove Empty Superclass A set of classes has an empty superclass which shall be removed. This class is not associated to another class. It has no features, no inner classes, and is not associated to other classes. It does not implement any interfaces, and it is not referred to as type of an attribute, operation or parameter.
Remove Parameter A parameter is no longer needed by an operation. Therefore, this refactoring removes this parameter from the parameter list of the operation.
Remove Superclass There is a set of classes having a superclass that does not make sense anymore. Remove this superclass after pushing remaining features down.
Remove Unused Interface This refactoring removes a given interface which is not used by and not realized by any classifier and has no sub interface.
Rename Attribute Renames an existing class attribute to the inserted new name.
Rename Class Renames an existing class to the inserted new name.
Rename Operation Renames an existing operation to the inserted new name.
Show Attribute This refactoring shows a private class attribute by setting its visibility to public and removes corresponding getter and setter operations.

Back to the top