Author terry.reedy
Recipients terry.reedy
Date 2017-07-24.08:03:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1500883425.86.0.0330979126605.issue31004@psf.upfronthosting.co.za>
In-reply-to
Content
I want to follow the safe way to refactor (from a blog post), rather than the hacker way of refactoring 'in place'.
Step 0: Test code to be refactored.  Finished in 30993.

Step 1: Copy code to be refactored and modify as needed to isolate it from the working original.  For configdialog, add 'class FontPage' below ConfigDialog and copy font/tab methods, now collected together, below that.  For the test, copy class FontTest as FontPageTest and IndentTest as IndentOptionTest. The copies should pass as they will still be testing the original code.  Commit.

Step 2: Modify code as desired.  Modify test copy to test code copy.  For FontPage, this will require new tracer manager (#30853) to attach (activate) callbacks so tests will pass.  Commit.

Step 3: Switch from using original code to using modified code.  For this issue, calling FontPage instead of create_page_font_tab may be enough.  Skip original test; modify new test as needed to pass.  Commit.

Step 4: Once we are sure that we do not need the original code that has been replaced, delete it.  Rerun tests. Commit.

The separate commits will make review easier.  Create or update PRs as desired.
History
Date User Action Args
2017-07-24 08:03:45terry.reedysetrecipients: + terry.reedy
2017-07-24 08:03:45terry.reedysetmessageid: <1500883425.86.0.0330979126605.issue31004@psf.upfronthosting.co.za>
2017-07-24 08:03:45terry.reedylinkissue31004 messages
2017-07-24 08:03:45terry.reedycreate