Tuesday, July 24, 2018

Refactoring techniques (courtesy sourcemaking.com)

Refactoring techniques

Composing methods

Much of refactoring is devoted to correctly composing methods. In most cases, excessively long methods are the root of all evil. The vagaries of code inside these methods conceal the execution logic and make the method extremely hard to understand – and even harder to change.
The refactoring techniques in this group streamline methods, remove code duplication, and pave the way for future improvements.

Moving Features between Objects

Even if you have distributed functionality among different classes in a less-than-perfect way, there is still hope.
These refactoring techniques show how to safely move functionality between classes, create new classes, and hide implementation details from public access.

Dealing with Generalisation

Abstraction has its own group of refactoring techniques, primarily associated with moving functionality along the class inheritance hierarchy, creating new classes and interfaces, and replacing inheritance with delegation and vice versa.

What is extreme about Extreme Programming (XP) ?

Extreme Programming takes the effective principles and practices to extreme levels.
  • Code reviews are effective as the code is reviewed all the time.
  • Testing is effective as there is continuous regression and testing.
  • Design is effective as everybody needs to do refactoring daily.
  • Integration testing is important as integrate and test several times a day.
  • Short iterations are effective as the planning game for release planning and iteration planning.