{ "uuid": [ { "value": "d33e4704-c07e-421e-8227-f3f74e9f57ff" } ], "langcode": [ { "value": "en" } ], "type": [ { "target_id": "daily_email", "target_type": "node_type", "target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7" } ], "revision_timestamp": [ { "value": "2025-05-11T09:00:32+00:00" } ], "revision_uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "revision_log": [], "status": [ { "value": true } ], "uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "title": [ { "value": "How much refactoring should I be doing?\n" } ], "created": [ { "value": "2023-09-17T00:00:00+00:00" } ], "changed": [ { "value": "2025-05-11T09:00:32+00:00" } ], "promote": [ { "value": false } ], "sticky": [ { "value": false } ], "default_langcode": [ { "value": true } ], "revision_translation_affected": [ { "value": true } ], "path": [ { "alias": "\/daily\/2023\/09\/17\/how-much-refactoring-should-i-be-doing", "langcode": "en" } ], "body": [ { "value": "\n
I watched a webinar recently, and one of the panellists asked, \"How much refactoring should I be doing?\".<\/p>\n\n
The reply was, \"More than you're doing now.\".<\/p>\n\n
It was quite tongue-in-cheek, but I agree that, in general, code isn't refactored enough.<\/p>\n\n
One main reason is a fear of introducing regressions, and to avoid that, you need a good automated test suite.<\/p>\n\n
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
If the test suite passes, you can release the new code.<\/p>\n\n
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
I watched a webinar recently, and one of the panellists asked, \"How much refactoring should I be doing?\".<\/p>\n\n
The reply was, \"More than you're doing now.\".<\/p>\n\n
It was quite tongue-in-cheek, but I agree that, in general, code isn't refactored enough.<\/p>\n\n
One main reason is a fear of introducing regressions, and to avoid that, you need a good automated test suite.<\/p>\n\n
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
If the test suite passes, you can release the new code.<\/p>\n\n
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 ", "summary": null } ] }