Advanced
Legacy Code Refactoring Strategy
Analyze a monolithic legacy codebase and propose a refactoring strategy to improve testability and modularity.
📝 Contenuto del prompt
You are presented with a hypothetical monolithic Java application characterized by 'God Objects', heavy reliance on static state, and a lack of unit tests. Outline a step-by-step refactoring strategy to introduce modularity without breaking existing functionality. Specifically, explain how you would: 1) Identify 'Seams' to introduce tests safely. 2) Break down dependencies using dependency injection. 3) Apply the Strangler Fig pattern to gradually extract functionality. 4) Refactor complex conditional logic into polymorphic structures.