TD Tutor
Feature Envy Quiz
Move Method Refactoring Techniques
Question
1
of 5
1
How does feature envy negatively impact code?
Violates encapsulation
Makes logic harder to find
Leads to duplicate behavior
All of the above
Correct!
Incorrect. The correct answer is:
2
What principle does feature envy violate?
Single Responsibility
Law of Demeter
Open/Closed Principle
Liskov Substitution
Correct!
Incorrect. The correct answer is:
3
What refactoring technique best addresses feature envy?
Move Method
Extract Class
Inline Method
Replace Conditional with Polymorphism
Correct!
Incorrect. The correct answer is:
4
Which design pattern can help mitigate feature envy?
Visitor Pattern
Singleton Pattern
Factory Pattern
Decorator Pattern
Correct!
Incorrect. The correct answer is:
5
What is a good indicator of feature envy?
Frequent calls to getters of another class
Long parameter lists
Deep inheritance hierarchies
Static method calls
Correct!
Incorrect. The correct answer is:
Previous
Next
Submit Quiz
Quiz Results
0
/5
Back to Tutorial