Lecture 8 Flashcards

1
Q

What is refactoring?

A

Process of altering source code so as to leave its functionality unchanged

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why refactor?

A

Improve maintainability, reusability, legibility, extensibility

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly