SDMetrics checks adherence to the following UML design rules. You can modify these existing design rules, and add new rules of your own, tailored to your UML design practices and development standards.
The list shows the design rules for UML2. The rules for UML1.3/1.4 are largely the same, or have equivalent counterparts, where applicable. Click on the name of a rule for a more detailed description of the design rule.
Class rules | ||
Rule | Category | Description |
---|---|---|
AttrNameOvr | Naming | The class defines a property of the same name as an inherited attribute. |
ConcreteSuper | Style | The abstract class has a parent class that is not abstract. |
CyclicInheritance | Inheritance | Class inherits from itself directly or indirectly. |
DepCycle | Style | The class has circular references. |
DescendentRef | Style | The class references a descendent class via associations, UML dependencies, attribute or parameter types. |
DupAttrNames | Correctness | The class has two or more properties with identical names. |
DupOps | Correctness | Class has duplicate operations. |
GodClass | Style | The class has more than 60 attributes and operations. |
Keyword | Naming | Class name is a Java or C++ keyword. |
MultipleInheritance | Style | Use of multiple inheritance - class has more than one parent. |
NoSpec | Completeness | Abstract class has no child classes. |
NotCapitalized | Naming | Class names should start with a capital letter. |
SpecLeafClass | Correctness | Class is marked as leaf, but it has child classes. |
Unnamed | Completeness | Class has no name. |
Unused | Completeness | The class is not used anywhere. |
Interface rules | ||
Rule | Category | Description |
AttrOnIF | Style | The interface has attributes or outgoing associations. |
Keyword | Naming | Interface name is a Java or C++ keyword; find another name for it. |
NotCapitalized | Naming | Interface names should start with a capital letter. |
PubAttrOnly | Correctness | The interface has attributes that are not public. |
PubOpsOnly | Correctness | The interface has operations that are not public. |
Unnamed | Completeness | Interface has no name. |
Unused | Completeness | The interface is not used anywhere. |
Datatype rules | ||
Rule | Category | Description |
Keyword | Naming | Data type name is a Java or C++ keyword; find another name for it. |
NoQuery | Correctness | The data type has an operation that is not marked as a query. |
Unnamed | Completeness | The data type has no name. |
Property rules | ||
Rule | Category | Description |
Capitalized | Naming | Attribute names should start with a lowercase letter. |
Keyword | Naming | Attribute name is a Java or C++ keyword. |
NoType | Completeness | The attribute has no specified type. |
PublicAttr | Style | Non-constant attribute is public. |
Unnamed | Completeness | The attribute has no name. |
Operation rules | ||
Rule | Category | Description |
AbstractOp | Correctness | Operation is abstract, but its owner class is not abstract. |
Capitalized | Naming | Operation names should start with a lower case letter. |
DupName | Naming | The operation has two or more parameters with identical names. |
Keyword | Naming | Operation name is a Java or C++ keyword. |
LongParList | Style | The operation has a long parameter list with five or more parameters. |
MulReturn | Correctness | The operation has more than one return parameter. |
Query | Style | The operation name indicates a query, but it is not marked as a query. |
Unnamed | Completeness | Operation has no name. |
Parameter rules | ||
Rule | Category | Description |
Keyword | Naming | Parameter name is a Java or C++ keyword. |
NoType | Completeness | The parameter has no specified type. |
Unnamed | Completeness | Parameter has no name. |
Package rules | ||
Rule | Category | Description |
Capitalization | Naming | Package name has upper case letters. |
DepCycle | Style | The package has circular dependencies to other packages. |
DupClsName | Naming | The package has two or more classes or interfaces with identical names. |
EmptyPackage | Completeness | The package has no contents. |
Keyword | Naming | Package name is a Java or C++ keyword. |
SDP1 | Style | Package violates the Stable-Dependencies Principle (SDP). |
SDP2 | Style | Package violates the Stable-Dependencies Principle (SDP). |
Unnamed | Completeness | Package has no name. |
Association rules | ||
Rule | Category | Description |
AggEnds | Correctness | The binary association has two composite or shared aggregation ends. |
LooseEnd | Completeness | The association has one or more ends not connected to a model element. |
NaryAgg | Style | The association has three or more association ends. |
NaryAggEnds | Correctness | The n-ary association has a composite or shared aggregation end. |
NaryNavEnds | Correctness | The n-ary association indicates a navigable association end. |
SpecAgg | Style | The association is a specialization of another association. |
Associationclass rules | ||
Rule | Category | Description |
AssocClass | Style | Avoid association classes. |
Generalization rules | ||
Rule | Category | Description |
NoChild | Completeness | The child end of the generalization is not connected to a model element. |
NoParent | Completeness | The parent end of the generalization is not connected to a model element. |
TypeMismatch | Correctness | Parent and child of the generalization are not of the same type. |
Interfacerealization rules | ||
Rule | Category | Description |
NoInterface | Completeness | The client end of the interface realization is not connected to a model element. |
NoSupplier | Completeness | The supplier end of the interface realization is not connected to an interface. |
Dependency rules | ||
Rule | Category | Description |
NoClient | Completeness | The client end of the dependency link is not connected to any model element. |
NoSupplier | Completeness | The supplier end of the dependency link is not connected to a model element. |
Interaction rules | ||
Rule | Category | Description |
Alternatives | Style | The interaction models alternative sequences. |
Actor rules | ||
Rule | Category | Description |
NaryAssoc | Correctness | The actor participates in an n-ary association. |
NoAssoc | Completeness | The actor is not associated with any use cases, classes, or subsystems. |
Unnamed | Correctness | The actor has no name. |
Usecase rules | ||
Rule | Category | Description |
CyclicIncludes | Correctness | Use case directly or indirectly includes itself. |
DupExPoint | Correctness | The use case has two or more extension points of the same name. |
Extends | Style | The use case is extending another use case. |
FunctionalDecomp | Style | Use case both includes and is included in other use cases. |
NaryAssoc | Correctness | The use case participates in an n-ary association. |
NoName | Completeness | The use case has an extension point without a name. |
Unnamed | Correctness | The use case has no name. |
Unused | Completeness | The use case is not used. |
Statemachine rules | ||
Rule | Category | Description |
HistoryState | Correctness | The protocol state machine contains a history state. |
ProtocolTransition | Correctness | The state machine contains a protocol transition. |
RegularTransition | Correctness | The protocol state machine contains a transition that is not a protocol transition. |
StatesWithActivities | Correctness | The protocol state machine contains states with entry/exit/doactivities. |
TransWithEffects | Correctness | The protocol state machine contains transitions with effects. |
Region rules | ||
Rule | Category | Description |
DeepHistory | Correctness | The region has two or more deep history states. |
DupName | Correctness | The region has two or more states of the same name. |
EmptyRegion | Completeness | The region has no states. |
InitialAndFinalStates | Style | There is no initial or final state for the state machine. |
ShallowHistory | Correctness | The region has two or more shallow history states. |
TooManyInitialStates | Correctness | The region has two or more initial states. |
State rules | ||
Rule | Category | Description |
BadForkOutgoing | Correctness | Transitions from fork states must not have a guard or triggers. |
BadForkTarget | Correctness | Transitions from fork states in a state machine must not target a pseudo state. |
BadIncoming | Correctness | Transitions to join states must not have triggers or guards. |
BadJoinSource | Correctness | Transitions to join states in a state machine must not originate from a pseudo state. |
BadOutgoing | Correctness | Transitions from pseudo states must not have any triggers. |
ForkTargetStates1 | Correctness | Fork state has transitions to states in identical regions. |
ForkTargetStates2 | Correctness | Fork state has transitions to states in different concurrent states. |
IllegalChoice | Correctness | A choice or junction state must have at least one incoming and one outgoing transition. |
IllegalEntryExit | Correctness | Entry or exit point is not owned by a top-level region. |
IllegalFinal1 | Correctness | A final state cannot have any outgoing transitions. |
IllegalFinal2 | Correctness | A final state cannot have any regions or entry/exit/state behavior. |
IllegalFork | Correctness | Fork states must have exactly one incoming and two or more outgoing transitions. |
IllegalHistory | Correctness | The history state has two or more outgoing transitions. |
IllegalInitial | Correctness | An initial state must have no incoming and exactly one outgoing transition. |
IllegalJoin | Correctness | Join states must have two or more incoming and exactly one outgoing transition. |
JoinSourceStates1 | Correctness | Join state has transitions from states in identical regions. |
JoinSourceStates2 | Correctness | Join state has transitions from states in different concurrent states. |
MissingGuard | Correctness | If there are two or more transitions from a choice state, they all must have guards. |
MissingSource | Correctness | State has an incoming transition not attached to a source state. |
MissingTarget | Correctness | State has an outgoing transition not attached to a target state. |
NoIncoming | Completeness | State has no incoming transitions. |
NoOutgoing | Completeness | State has no outgoing transitions. |
Unnamed | Completeness | State has no name. |
Activitygroup rules | ||
Rule | Category | Description |
EmptyGroup | Completeness | The activity group does not contain any nodes or subgroups. |
NoExpansionNode | Completeness | The expansion region has no expansion node. |
Action rules | ||
Rule | Category | Description |
IsolatedAction | Completeness | The action has neither incoming nor outgoing edges. |
Unnamed | Completeness | Action has no name. |
Controlnode rules | ||
Rule | Category | Description |
DecisionOut | Completeness | Decision nodes should have two or more outgoing edges, each with a guard. |
ForkOut | Completeness | Fork nodes should have two or more outgoing edges. |
IllegalDecision | Correctness | Decision nodes must have exactly one incoming edge. |
IllegalFinal | Correctness | Final nodes must not have any outgoing edges. |
IllegalFork1 | Correctness | Fork nodes must have exactly one incoming edge. |
IllegalInitial | Correctness | The initial node has incoming edges our outgoing object flows. |
IllegalJoin1 | Correctness | Join nodes must have exactly one outgoing edge. |
IllegalJoin2 | Correctness | Outgoing edge of join is the wrong type. |
IllegalMerge | Correctness | Merge nodes must have exactly one outgoing edge. |
IsolatedNode | Completeness | The control node has neither incoming nor outgoing edges. |
MixedEdgeTypes | Correctness | Edges from or to decision, merge, or fork nodes must be of the same type. |
NumIncoming | Completeness | Merge and join nodes should have two or more incoming edges. |
Objectnode rules | ||
Rule | Category | Description |
InOrOut | Correctness | The activity parameter node has both incoming and outgoing flows. |
IsolatedNode | Completeness | The object node has neither incoming nor outgoing edges. |
Unnamed | Completeness | The object node has no name. |
Pin rules | ||
Rule | Category | Description |
IllegalInputPin | Correctness | The input pin has outgoing edges. |
IllegalOutputPin | Correctness | The output pin has incoming edges. |
IllegalValuePin | Correctness | The value pin has an incoming edge. |
NoIncoming | Completeness | The input pin has no incoming edges. |
NoOutgoing | Completeness | The output pin has no outgoing edges. |
Controlflow rules | ||
Rule | Category | Description |
DanglingCtrlFlow | Completeness | The control flow has no source or target node, or both. |
Objectflow rules | ||
Rule | Category | Description |
DanglingObjectFlow | Completeness | The object flow has no source or target node, or both. |