Martin Fowler Refactoring Notes

Questions:

How to make self­ checking tests

Before you start refactoring, make sure you have a solid suite of tests. These tests must be self­checking.

1) Есть switch - переводим его в отдельную функцию Extract Function

2) I like to get rid of variables like play, because temporary variables create a lot of locally scoped names that complicate extractions. The refactoring I will use here is Replace Temp with Query (178).

3) Inline Variable (123)

4) Change Function Declaration (124).

Last updated