一句话:提出 Revizor,用图表示代码变更并从版本历史挖掘重复模式,在 PyCharm 中推荐并自动执行快速修复。
开发者常在项目中重复进行相同或相似的代码修改,这些重复变更构成可复用的变更模式。本文提出 Revizor,旨在为 PyCharm 构建自定义插件:插件可接收从开源仓库版本历史中收集的变更模式,在编辑器中高亮模式可应用的位置;若开发者接受快速修复,插件自动完成相应编辑。该方法采用基于图的代码变更表示,因此能够支持复杂的分布式代码模式,而不仅限于局部连续修改。作者构建了工具与测试插件原型,并邀请有经验的开发者评估其可用性与性能,反馈积极。工具源代码与插件原型已在 GitHub 开源。
Many code changes that developers make in their projects are repeated and constitute recurrent change patterns. It is of interest to collect such patterns from the version history of open-source repositories and suggest the most useful of them as quick fixes. In this paper, we present Revizor—a tool aimed to build custom plugins for PyCharm, a popular Python IDE. A Revizor-based plugin can take change patterns and highlight potential places for their application in the developer’s code editor. If the developer accepts the quick fix, the plugin automatically performs the edit. Our approach uses a graph-based representation of code changes, which allows it to support complex distributed code patterns. Experienced developers have also rated the usability and the performance of such Revizor-based plugin positively.The source code of the tool and test plugin prototype are available on GitHub: https://github.com/JetBrains-Research/revizor. A demonstration video with a short tool description can be found on YouTube: https://youtu.be/5eLs14nco7E.
DOI 原文 ·
@inproceedings{paperbot6481,
title = {Revizor: A Data-Driven Approach to Automate Frequent Code Changes Based on Graph Matching},
author = {Oleg Smirnov and Artyom Lobanov and Yaroslav Golubev and Elena Tikhomirova and Timofey Bryksin},
booktitle = {ASE},
year = {2021},
doi = {10.1109/ase51524.2021.9678635}
}