Hoofdstuk 11 - Refactoring Flashcards

1
Q

Can you explain how refactoring differs from plain coding?

A

Changes the software system in such a way that it does not alter the external behaviour of the code, yet improves its internal structure.

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

Can you tell the difference between Corrective, Adaptive and Perfective maintenance? And how about preventive maintenance?

A

Corrective fixing errors, Adaptive to new environments and Perfective with new functionality. Preventive maintenance by refactoring, it is a new category.

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

Can you name the three phases of the iterative development life-cycle? Which of the three does refactoring support the best? Why do you say so?

A

Prototyping, expansion, consolidation. Consolidation supports this the best, as refactoring during expansion slows down the productivity.

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

Can you give 4 symptoms for code that can be “cured” via refactoring?

A

Duplicate code, nested conditionals, large classes/methods and abusive inheritance.

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

Which 4 activities should be supported by tools when refactoring?

A

◦ rapid edit-compile-run cycles
◦ reverse engineering facilities
◦ regression testing
◦ version & configuration management.

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

Why can’t we apply a “push up” to a method “x()” which accesses an attribute in the class the method is defined upon (see Refactoring Sequence on page 27–31)?

A

Because we need to “push up” the attribute too.

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