advanced
Strategic Refactoring of a Monolithic Codebase
Analyze a provided legacy code scenario and outline a step-by-step refactoring plan to introduce modularity and testability without halting development.
📝 Treść promptu
You are a Lead Developer tasked with refactoring a 10-year-old monolithic e-commerce application. The codebase lacks tests, has circular dependencies, and uses global state extensively. Your goal is to outline a 6-month refactoring strategy. Do not rewrite from scratch. 1) Identify the immediate 'fire-fighting' measures to stabilize the code. 2) Propose a pattern for introducing the Strangler Fig pattern to extract services incrementally. 3) Explain how to introduce unit and integration tests without breaking existing functionality. 4) Detail a strategy for managing technical debt repayment alongside new feature development. 5) Provide a pseudocode example of how to break a specific circular dependency.