PYEVOLVE: Automating Frequent Code Changes in Python ML Systems
Authors:
Open Access
- 1 May 2023
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 995-1007
Abstract
Because of the naturalness of software and the rapid evolution of Machine Learning (ML) techniques, frequently repeated code change patterns (CPATs) occur often. They range from simple API migrations to changes involving several complex control structures such as for loops. While manually performing CPATs is tedious, the current state-of-the-art techniques for inferring transformation rules are not advanced enough to handle unseen variants of complex CPATs, resulting in a low recall rate. In this paper we present a novel, automated workflow that mines CPATs, infers the transformation rules, and then transplants them automatically to new target sites. We designed, implemented, evaluated and released this in a tool, PYEVOLVE. At its core is a novel data-flow, control-flow aware transformation rule inference engine. Our technique allows us to advance the state-of-the-art for transformation-by-example tools; without it, 70% of the code changes that PYEVOLVE transforms would not be possible to automate. Our thorough empirical evaluation of over 40,000 transformations shows 97% precision and 94% recall. By accepting 90% of CPATs generated by PYEVOLVE in famous open-source projects, developers confirmed its changes are useful.Keywords
Funding Information
- NSF (CNS-1941898,CNS-2213763)
This publication has 58 references indexed in Scilit:
- AndroEvolve: automated Android API update with data flow analysis and variable denormalizationEmpirical Software Engineering, 2022
- PyNose: A Test Smell Detector For Python2021
- Inferring Program Transformations From Singular Examples via Big Code2019
- Simplifying the construction of source code transformations via automatic syntactic restructuringsJournal of Software: Evolution and Process, 2017
- A Refactoring Constraint Language and Its Application to Eiffel2011
- Generic Patch Inference2008
- Stratego/XT 0.17. A language and toolset for program transformationScience of Computer Programming, 2008
- Tom: Piggybacking Rewriting on Java2007
- The TXL source transformation languageScience of Computer Programming, 2006
- The Asf+Sdf Meta-environment: A Component-Based Language Development Environment2001