PYEVOLVE: Automating Frequent Code Changes in Python ML Systems

PYEVOLVE: Automating Frequent Code Changes in Python ML Systems
复制标题

DOI:
10.1109/icse48619.2023.00091
复制
发表时间:
2023-05
期刊:
2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE)
影响因子:
--
通讯作者:
Malinda Dilhara;Danny Dig;Ameya Ketkar
Malinda Dilhara;Danny Dig;Ameya Ketkar
中科院分区:
其他
文献类型:
--
作者:
Malinda Dilhara;Danny Dig;Ameya Ketkar

文献摘要

被引文献

相似文献

由于软件的自然性和机器学习(ML)技术的快速发展,经常发生代码更改模式(CPAT)经常发生。它们的范围从简单的API迁移到涉及多个复杂控制结构(例如循环)的变化。虽然手动执行CPAT是乏味的,但推断转换规则的当前最新技术还不足以处理复杂CPAT的看不见的变体,从而导致召回率低。在本文中,我们提出了一种新颖的自动化工作流,该工作流矿山挖掘CPAT,渗透转换规则,然后自动将其移植到新的目标站点。我们在工具Pyevolve中设计,实施,评估和发布了此功能。其核心是一种新颖的数据流,控制流意识转换规则推理引擎。我们的技术使我们能够促进逐个示例工具的最先进。没有它,pyevolve变换将无法自动化的代码更改中有70%。我们对超过40,000次转变的彻底经验评估表明,精度为97%,召回了94%。通过接受Pyevolve在著名的开源项目中产生的90%的CPAT,开发人员确认其更改是有用的。
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.