What problem does it solve?
Improve code structure while preserving behavior. Refactoring is required to clean up code smells, restructure a class or function, or improve overall quality without changing external behavior.
Core Features & Use Cases
- Guidelines for safe refactoring: Never change behavior in the same commit; write tests first; make small, incremental changes; keep the code working.
- Common refactoring techniques: Extract Method, Extract Class, Replace Conditional with Polymorphism, Introduce Parameter Object.
- Use Case: When a project has bloated classes or complex switch logic, apply refactoring to improve readability and maintainability while preserving functionality.
Quick Start
Describe the exact code area to refactor and the behavior to preserve, then start with small, test-guided changes and verify behavior after each step.