Design Smells Flashcards
What is meant by the term Design Smells?
Design smells are certain structures in the design that indicate
violation of fundamental design principles and negatively impact design quality
What are the different classification of design smells?
- Abstraction
- Encapsulation
- Modularization
- Hierarchy
Define the Principle of Abstraction
advocates the simplification of entities
through reduction and generalization: reduction is by elimination of
unnecessary details and generalization is by identification and
specification of common and important characteristics.
Techniques for applying the principle of Abstraction
- Map Domain Entities
- Ensure coherence and completeness
- Avoid duplication
- Provide a crisp conceptual boundary and a unique identity
- Assign Single and Meaningful Responsibility
List the types of Abstraction Smells
Missing Abstraction (clumps of data, absence of classes) Abstraction Imperative (method turned into class) Incomplete Abstraction (does not support complementary/interrelated methods completely) Multifaceted Abstraction (has more than one responsibility ) Unnecessary Abstraction ( unnecessary Abstraction gets introduced) Unutilized Abstraction (Abstraction not used) Duplicate Abstraction (identical name or implementation of abstraction)
Explain the principle of Encapsulation
The principle of encapsulation advocates separation of concerns and
information hiding. Hiding implementation details and hiding
variations are two techniques that enable the effective application of
the principle of encapsulation.
How do you enable techniques for applying the principle of encapsulation
- Hide implementation details
- Hide variations
Types of Encapsulation Smells
- Deficient Encapsulation : Accessibility of abstraction is more permissive than needed
- Leaky Encapsulation : Abstraction exposes implementation details( public)
- Missing Encapsulation : no implementation
- Unexploited Encapsulation :
What is technical Debt?
• Technical debt is the debt that accrues when you knowingly or
unknowingly make wrong or non-optimal design decisions.
Describe the types of technical debts
• Code debt: Static analysis tool violations and inconsistent coding
style.
• Design debt: Design smells and violations of design rules.
• Test debt: Lack of tests, inadequate test coverage, and improper test
design.
• Documentation debt: No documentation for important concerns,
poor documentation, and outdated documentation.
How do you manage technical debt?
• Knowledge and awareness of the concept of technical debt
• Detection of technical debt
• Repayment of technical debt
• Preventing accumulation of technical debt - by tracking monitoring and
continuous payment