paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Automated Refactoring to Reactive Programming

面向响应式编程的自动重构
ASE 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE)2019匹配度 1/10 · 该论文研究自动重构异步代码为响应式编程,属于软件工程与程序变换方向,但未涉及用户画像中的静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析等核心主题。引用 10 inbox
Mirko Kohler, Guido Salvaneschi
crossref: 2026-09-12

AI 速览

一句话:提出 2Rx,自动将传统异步代码重构为响应式编程风格。

异步应用的实现与维护历来容易出错,而响应式编程语言与库(如 ReactiveX)以声明式风格显著改善代码清晰度与可扩展性,已在工业界广泛采用。然而大量既有软件仍基于传统异步抽象编写。本文提出 2Rx,一种自动重构方法,可将异步代码转换为响应式编程形式,从而在不重写系统的前提下获得响应式设计的收益。作者在 GitHub 高星项目上进行评估,结果表明 2Rx 能有效处理最常见的异步构造:覆盖了 12.7% 的含异步计算项目,并为其中 91.7% 的异步出现位置成功给出重构。

问题
既有软件普遍使用传统异步抽象,难以维护和扩展,而迁移到响应式编程需要大量手工改写。
方法
提出 2Rx,自动识别常见异步构造并将其重构为响应式编程风格的代码。
评估
在 GitHub 高星项目上评估,覆盖 12.7% 的含异步计算项目,并对 91.7% 的异步出现位置给出重构。
原文摘要(Abstract)

Reactive programming languages and libraries, such as ReactiveX, have been shown to significantly improve software design and have seen important industrial adoption over the last years. Asynchronous applications - which are notoriously error-prone to implement and to maintain - greatly benefit from reactive programming because they can be defined in a declarative style, which improves code clarity and extensibility. In this paper, we tackle the problem of refactoring existing software that has been designed with traditional abstractions for asynchronous programming. We propose 2Rx, a refactoring approach to automatically convert asynchronous code to reactive programming. Our evaluation on top-starred GitHub projects shows that 2Rx is effective with the most common asynchronous constructs, covering 12.7% of projects with asynchronous computations, and it can provide a refactoring for 91.7% of their occurrences.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot5305,
  title = {Automated Refactoring to Reactive Programming},
  author = {Mirko Kohler and Guido Salvaneschi},
  booktitle = {ASE},
  year = {2019},
  doi = {10.1109/ase.2019.00082}
}