Lecture 8 Flashcards
1
Q
What is refactoring?
A
Process of altering source code so as to leave its functionality unchanged
2
Q
Why refactor?
A
Improve maintainability, reusability, legibility, extensibility
3
Q
What are code smells?
A
an indication that there may be a deeper problem or design flaw in your code
not technically a bug, but if “left untreated” may lead to bugs later
4
Q
What are code smells examples?
A
Duplicated code
Method too big
Classes have too many instance variables
Subclasses very similar
Classes with too much code: God Class or Blob anti pattern
Shotgun Surgery: change something, you have to make lots of other little changes throughout the code