Refactoring restructures software while keeping the product working. Used continuously, it prevents overdesigned architecture and lets a simpler design emerge as development circumstances change. section 1.14.1 section 12.6
A practical refactoring workflow emphasizes:
- Start with a simple design instead of trying to future-proof the architecture. section 1.14.1
- Make small, manageable changes and keep the code working after each step. section 12.6
- Support restructuring with thorough automated testing; build the tests along the way when necessary. section 12.6 section 12.6.6
- Find natural seams in a monolith and extract aligned components incrementally rather than attempting a big-bang conversion. section 12.6 section 12.6.6
- Continue delivering features and fixing bugs while restructuring, so problems do not accumulate. section 12.6
Extracting a monolith
A monolith with tangled code may lack obvious extraction boundaries. Refactor it first, or refactor during extraction, using automated tests and small, well-tested steps to expose components that align with the intended microservices architecture. section 12.6.6 section 12.6
Figure 12.23 Refactoring a monolith to microservices can only be done in an iterative sequence of small and well-tested steps.
Use the workflow diagram to follow refactoring as an iterative sequence of small, well-tested steps. section 12.6





















