SE Radio 625: Jonathan Schneider on Automated Refactoring with OpenRewrite

Topics covered
Popular Clips
Episode Highlights
Purpose
Jonathan Schneider, cofounder of Moderne and creator of OpenRewrite, discusses the tool's core purpose and benefits. OpenRewrite is designed for automated refactoring, which involves writing software that rewrites other software to modernize it, fix security vulnerabilities, and ensure code consistency 1. Schneider explains that OpenRewrite combines a rich set of data about a codebase with programs called recipes to make changes 1. He notes, "Automated refactoring is writing software that rewrites other software, and its main benefits are to achieve some modernization in that software to fix security vulnerabilities and to ensure a consistent style or fix these inconsistencies in codebases" 1.
Correctness
Ensuring correctness in refactoring is crucial, and OpenRewrite achieves this through syntax trees and type attribution. Jonathan Schneider highlights that type attribution is essential for ensuring that changes are correct and stylistically consistent with the existing codebase 2. He explains that parsers convert code into a lossless semantic tree, which retains necessary information for refactoring without losing original code details 3. Schneider states, "Type attribution is one of the essential elements of correctness in a recipe" 2.
Scenarios
OpenRewrite is versatile, allowing developers to use it on local machines or within CI/CD pipelines. Schneider explains that it can be used for various tasks, from linting in CI to patching security vulnerabilities on developer workstations 4. He provides examples like updating dependencies across multiple repositories or migrating APIs, showcasing its utility in handling complex code changes 5. Schneider notes, "Whenever gradle releases a new version, we will do a mass commit to all of our 100 repositories to update that to our gradle builds to the latest" 4.
Related Episodes


SE-Radio-Episode-267-Jürgen-Höller-on-Reactive-Spring-and-Spring-5.0
Answers 383 questions

Episode 55: Refactoring Pt. 2
Answers 383 questions

Episode 46: Refactoring Pt. 1
Answers 383 questions

SE Radio 638: Nick Tune and Jean-Georges Perrin on Architecture Modernization
Answers 383 questions

SE Radio 567: Dave Cross on GitHub Actions
Answers 383 questions

SE Radio 628: Hans Dockter on Developer Productivity
Answers 383 questions
SE Radio 633: Itamar Friedman on Automated Testing with Generative AI
Answers 383 questions

SE Radio 594: Sean Moriarity on Deep Learning with Elixir and Axon
Answers 383 questions
SE-Radio-Episode-249:-Vaughn-Vernon-on-Reactive-Programming-with-the-Actor-Model
Answers 383 questions

SE Radio 615: Kent Beck on "Tidy First?"
Answers 383 questions

SE-Radio-Episode-259:-John-Purrier-on-OpenStack
Answers 383 questions

SE-Radio Episode 242: Dave Thomas on Innovating Legacy Systems
Answers 383 questions

SE-Radio Episode 324: Marc Hoffmann on Code Test Coverage Analysis and Tools
Answers 383 questions

SE Radio 585: Adam Frank on Continuous Delivery vs Continuous Deployment
Answers 383 questions














