一句话:提出结构感知编辑器 Deuce,通过点击控件结构化选择并直接操作程序变换,用户研究显示其优于传统文本选择。
传统重构环境通常与基于文本的编辑工作流割裂。本文提出 Deuce,一种结构感知代码编辑器,将自动程序变换的直接操作能力紧密集成到文本编辑中。Deuce 在源代码上绘制可点击控件,使用户能对子表达式等非结构化文本进行结构化选择,并根据当前选择提供轻量级交互式变换菜单。作者在一个小型函数式语言中实现并评估了多数标准变换。一项 21 人受控用户研究表明,结构选择界面比传统文本选择更受偏好,且随着用户熟悉工具,整体操作可能更快。结果印证了 Deuce 在熟悉的文本编辑之上提供人性化结构交互的目标。
We present a structure-aware code editor, called Deuce, that is equipped with direct manipulation capabilities for invoking automated program transformations. Compared to traditional refactoring environments, DEUCE employs a direct manipulation interface that is tightly integrated within a text-based editing workflow. In particular, Deuce draws (i) clickable widgets atop the source code that allow the user to structurally select the unstructured text for subexpressions and other relevant features, and (ii) a lightweight, interactive menu of potential transformations based on the current selections. We implement and evaluate our design with mostly standard transformations in the context of a small functional programming language. A controlled user study with 21 participants demonstrates that structural selection is preferred to a more traditional text-selection interface and may be faster overall once users gain experience with the tool. These results accord with Deuce's aim to provide human-friendly structural interactions on top of familiar text-based editing.