EMOF Bad Smells

Aus SDQ-Wiki

Introduction

The bad smells that are presented here were collected and transferred from object-oriented design in the scope of a master's thesis [1]. They are named according to the classification system of Samarthyam [2].

Smells

Abstraction

  • Missing Abstraction: Recurring information in a metamodel should be abstracted into a dedicated model element. However, if no dedicated abstraction is created, these information usually occur as clumps of data consisting of primitive types or strings, in multiple locations in the metamodel. Elements using these clumps often has a high coupling between each other. This comes into play when the generated code of a metamodel is used since every element using these data clumps have to manage the corresponding behavior on its own. Additionally, this brings the risk of different behaviors since the management of this data is done at different places in code.
  • Multifaceted Abstraction: An element in a metamodel should only have a single responsibility it is created for and the representing abstraction should clearly cover the responsibility.
  • Unutilized Abstraction: When an element in a metamodel is unused.
  • Duplicate Abstraction: When duplications among elements are present in the metamodel. These duplications can be either an identical name, similar or the same attributes or both.

Modularization

  • Insufficient Modularization: When an element has a large size due to a missing decomposition of the described content.
  • Cyclically-Dependent Modularization: When elements in a metamodel depend on each other leading to a cycle resulting that these elements can only be used together.
  • Hub-like Modularization: When an element in a metamodel has many dependencies to other elements. These dependencies appear in both, incoming and outgoing dependencies.

Hierarchy

  • Missing Hierarchy: When variations of an element in a metamodel are realized by embedded elements and not by an hierarchy.
  • Unnecessary Hierarchy: When inheritance is applied needlessly and the resulting elements in the metamodel do not provide any additional information.
  • Unfactored Hierarchy: When a hierarchy contains duplications among elements, introducing redundancy.
  • Wide Hierarchy: When a hierarchy in a metamodel is wide, commonalities between those hierarchy elements could be factored out to one or more intermediate elements.
  • Speculative Hierarchy: When elements in a hierarchy are introduced on a speculative base instead of relying on specified requirements and needs.
  • Deep Hierarchy: When a hierarchy in a metamodel is deep and the elements within the hierarchy are not providing useful further information, these elements are probably not required and could be merged.
  • Multipath Hierarchy: When an element inherits at least in two or more ways from the same supertype over different and therefore unnecessary paths in the metamodel.
  • Cyclic Hierarchy: When an element in a hierarchy either depends direct or indirect on one of its subtypes, a cycle between these elements is created.
  • Late Hierarchy: An abstract element in the metamodel that has at least one direct or indirect non-abstract element as supertype.

Relation

  • Container Relation: When an explicit container reference is used by utilizing the concept of opposite references instead of using the implicit one by the Eclipse Modeling Framework.
  • Specialization Relation: When a relation between two elements in a metamodel is specialized by inherited elements, introducing redundancy.

Bibliography

[1] René Hahn. "Bad Smells and Anti-Patterns in Metamodeling", Master's thesis, Karlsruhe Institute of Technology (KIT), November 2017.
[2] Samarthyam Ganesh, Tushar Sharma, and Girish Suryanarayana. "Towards a Principle-based Classification of Structural Design Smells", Journal of Object Technology 12.2 2013.

Assessments

  • Capella: Home, Source, assessed versions: Capella 1.1.2, Kitalpha 1.1.1
  • Palladio Component Model: Home, SVN, Git, assessed version: PCM_4.1 (metamodel version 5.2)
Sortable table
Metamodel Cyclic Dependent Modularization* Deep Hierarchy HubLike Modularization (Outgoing Dependencies) Multipath Hierarchy* Specialization Relation Speculative Generality EClass Cyclic Hierarchy HubLike Modularization (Incoming Dependencies) Container Relation Container Relation (Obligatory) Late Hierarchy Missing Abstraction - Primitive Obsession Primitive Types Unutilized Abstraction - Unused Classes Wide Hierarchy
CapellaCommon 11 23 2 38 10 3 0 0 0 0 0 0 0 0
CapellaCore 20 20 1 70 7 0 2 0 0 0 0 0 0 0
CapellaModeller 1 5 0 24 1 1 0 0 0 0 0 0 0 0
CompositeStructure 26 26 4 824 14 11 1 2 0 0 0 0 0 0
ContextArchitecture 21 17 6 66 10 10 0 2 1 1 0 0 0 0
EPBSArchitecture 6 7 1 0 2 6 0 0 0 0 0 0 0 0
FunctionalAnalysis 29 26 6 604 28 4 0 3 1 0 0 0 0 0
Information 26 57 5 749 26 11 0 4 0 0 1 3 1 0
Interaction 15 28 3 53 13 0 0 1 0 0 0 0 0 0
LogicalArchitecture 13 15 4 0 5 11 0 0 0 0 0 0 0 0
OperationalAnalysis 29 20 3 185 13 11 0 1 0 0 0 0 0 0
PhysicalArchitecture 18 20 2 414 7 13 0 0 0 0 0 0 0 0
Requirement 3 8 0 0 2 1 0 0 0 0 0 0 0 0
SharedModel 1 2 0 12 0 0 0 0 0 0 0 0 0 0
Activity 12 9 1 17 9 0 0 0 2 1 0 0 0 0
ModellingCore 13 0 0 3 1 0 3 0 0 0 0 1 0 0
Behavior 0 1 0 0 1 0 0 0 0 0 0 0 0 0
eMDE 0 0 0 0 0 0 1 0 0 0 0 0 0 0
Capella Total 244 284 38 3059 149 82 7 13 4 2 1 4 1 0
pcm 99 3 2 67 9 2 0 3 64 31 2 1 1 2
stoex 0 14 0 0 0 6 0 0 0 0 0 0 1 0
identifier 0 0 0 0 0 0 0 0 0 0 0 0 1 0
Units 0 0 0 0 0 0 0 0 0 0 0 0 2 0
ProbabilityFunction 0 0 0 0 0 1 0 0 0 0 0 0 0 0
PCM Total 99 17 2 67 9 9 0 3 64 31 2 1 5 2
  • These two smells detection counts may contain duplicate detections