Hoofdstuk 11 - Refactoring Flashcards
Can you explain how refactoring differs from plain coding?
Changes the software system in such a way that it does not alter the external behaviour of the code, yet improves its internal structure.
Can you tell the difference between Corrective, Adaptive and Perfective maintenance? And how about preventive maintenance?
Corrective fixing errors, Adaptive to new environments and Perfective with new functionality. Preventive maintenance by refactoring, it is a new category.
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?
Prototyping, expansion, consolidation. Consolidation supports this the best, as refactoring during expansion slows down the productivity.
Can you give 4 symptoms for code that can be “cured” via refactoring?
Duplicate code, nested conditionals, large classes/methods and abusive inheritance.
Which 4 activities should be supported by tools when refactoring?
◦ rapid edit-compile-run cycles
◦ reverse engineering facilities
◦ regression testing
◦ version & configuration management.
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)?
Because we need to “push up” the attribute too.