Learning Syntactic Program Transformations from Examples
Reudismam Rolim, Gustavo Soares, Loris D'Antoni, Oleksandr Polozov,, Sumit Gulwani, Rohit Gheyi, Ryo Suzuki, Bjoern Hartmann

TL;DR
REFAZER is a novel technique that automatically learns program transformations from developer edits, enabling automated fixing of student submissions and applying repetitive code edits across projects.
Contribution
It introduces a new domain-specific language and algorithms for synthesizing and ranking program transformations from examples, advancing programming-by-example methods.
Findings
Fixes 87% of incorrect student submissions in experiments.
Learns intended transformations in 83% of repetitive edit scenarios.
Effectively generalizes code edits across multiple projects.
Abstract
IDEs, such as Visual Studio, automate common transformations, such as Rename and Extract Method refactorings. However, extending these catalogs of transformations is complex and time-consuming. A similar phenomenon appears in intelligent tutoring systems where instructors have to write cumbersome code transformations that describe "common faults" to fix similar student submissions to programming assignments. We present REFAZER, a technique for automatically generating program transformations. REFAZER builds on the observation that code edits performed by developers can be used as examples for learning transformations. Example edits may share the same structure but involve different variables and subexpressions, which must be generalized in a transformation at the right level of abstraction. To learn transformations, REFAZER leverages state-of-the-art programming-by-example methodology…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
