Automated Software Refactoring with OpenRewrite and Generative AI
1h 35mIntermediate2025-10-29
Authors

Benjamin Muschko
Software Engineer, Consultant, and Trainer
Course details
Modernizing and maintaining large codebases can be a daunting challenge, but automation can make the process efficient and scalable. This course explores how to leverage OpenRewrite and generative AI to automate mass-scale software refactoring, enabling seamless code transformations, migrations, and optimizations. Learn how to design and apply custom OpenRewrite recipes, integrate refactoring automation into CI/CD pipelines, and enhance developer productivity with AI-powered code modifications. Through hands-on examples and real-world scenarios, gain practical skills to modernize legacy systems, enforce coding standards, and improve software quality with minimal manual effort. By the end of this course, you will be equipped with the tools and techniques to drive large-scale, automated code improvements across your organization.
Learning objectives
Automate large-scale code refactoring using OpenRewrite to modernize and improve codebases efficiently.
Design and apply custom OpenRewrite recipes to enforce coding standards and architectural best practices.
Leverage generative AI-based tooling to assist in recipe search, recipe application, and optimizations at scale.
Learning objectives
Automate large-scale code refactoring using OpenRewrite to modernize and improve codebases efficiently.
Design and apply custom OpenRewrite recipes to enforce coding standards and architectural best practices.
Leverage generative AI-based tooling to assist in recipe search, recipe application, and optimizations at scale.
Concepts
Introduction
- Modernizing and maintaining large codebases
The Need for Automated Software Refactoring
- The importance of software refactoring
- Challenges of manual refactoring and the need for automation
- Introduction to OpenRewrite in software transformation
- Benefits of combining OpenRewrite with AI-assisted automation
Understanding OpenRewrite and Moderne for Automated Refactoring
- Demo - Enabling large-scale code transformations with the Moderne SaaS
- OpenRewrite's core concepts and workflow
- OpenRewrite recipes - Codified migration instructions
- Running recipes from the Moderne CLI, a build tool, and the Moderne SaaS
- Demo - Applying OpenRewrite to refactor Java code using the CLI
- Demo - Refactor Java code with OpenRewrite using the Maven plugin
- Demo - Using the Moderne SaaS to run a refactoring recipe
- Aggregating recipes with declarative recipes
- Demo - Running multiple recipes in order
- Demo - Meet Moddy Desktop, an AI-agent for multirepo modernization
Real-World Use Cases
- Case studies - How enterprises use OpenRewrite for large-scale code transformation
- Handling framework migrations and security updates
- Challenge - Recipes Migrate to Spring Boot 3.0 and OWASP Top 10
- Solution - Recipes Migrate to Spring Boot 3.0 and OWASP Top 10
- Handling programming language version upgrades
- Challenge - Recipe Migrate to Java 21
- Solution - Recipe Migrate to Java 21
- Introspection of source code for impact analysis
- Challenge - Recipes Find types , Find method usages , and Maven dependency insight in source code
- Solution - Recipes Find types , Find method usages , and Maven dependency insight in source code
Conclusion
- Next steps in your refactoring journey
Related courses
- Software Testing Assistance with GitHub Copilot AI
- Writing and Refactoring Testable PHP
- Debug Your Code with AI
- OpenAI API and MCP Development
- Automate Development Tasks with OpenAI’s Codex
- Build AI Agents with GitHub Copilot by Microsoft Press
- Learning Visual Studio Code
- Upgrading Legacy WordPress Projects: Modernize Workflows and Codebase
Related learn paths
- Master GitHub Copilot
- Transform Your Programming with AI Coding Tools
- Prepare for the AWS Certified Developer Associate (DVA-C01) Certification Exam
- The Top Skills IT Professionals Have Right Now
- Software Development Fundamentals
- Advance Your Skills as a Django Developer
- Advance Your MS SQL Server Skills
- Master Test Automation with Playwright