Hacker News new | ask | show | jobs
by thedevindevops 2170 days ago
Step 1) Document the system (what currently exists) in more detail than you think you'll need, paying specific focus to the system and module boundaries (if the Interfaces are done well this should be a fairly easy step)

Step 2) Modularise all the things, tuck all those fiddly bits behind the abstractions you pulled out in Step 1

Step 3) Mock and unit test all the things, this is actually crucial because this is where you clarify all the crud that built up due to developer assumptions, you test and check all those Modules and verify the system is doing not only what you think it's doing but what it's supposed to be doing

Step 4) Introduce a good Dependency Injection Framework

Step 5) (This is where you actually fix things) Now you can break up those Modules and refactor their internals - even swapping out entirely freshly written modules thanks to that nice DI framework - with confidence that you won't break the overall system.