"value":"\n <p>I watched a webinar recently, and one of the panellists asked, \"How much refactoring should I be doing?\".<\/p>\n\n<p>The reply was, \"More than you're doing now.\".<\/p>\n\n<p>It was quite tongue-in-cheek, but I agree that, in general, code isn't refactored enough.<\/p>\n\n<p>One main reason is a fear of introducing regressions, and to avoid that, you need a good automated test suite.<\/p>\n\n<p>If you break the existing functionality whilst refactoring, you want the test suite to fail so you can identify and fix the regression.<\/p>\n\n<p>If the test suite passes, you can release the new code.<\/p>\n\n<p>How many tests and how much coverage do you need? There's no specfic answer - enough for you to be confident everything still works.<\/p>\n\n ",
"format":"full_html",
"processed":"\n <p>I watched a webinar recently, and one of the panellists asked, \"How much refactoring should I be doing?\".<\/p>\n\n<p>The reply was, \"More than you're doing now.\".<\/p>\n\n<p>It was quite tongue-in-cheek, but I agree that, in general, code isn't refactored enough.<\/p>\n\n<p>One main reason is a fear of introducing regressions, and to avoid that, you need a good automated test suite.<\/p>\n\n<p>If you break the existing functionality whilst refactoring, you want the test suite to fail so you can identify and fix the regression.<\/p>\n\n<p>If the test suite passes, you can release the new code.<\/p>\n\n<p>How many tests and how much coverage do you need? There's no specfic answer - enough for you to be confident everything still works.<\/p>\n\n ",