Refactoring using type constraints

Refactoring using type constraints
复制标题

使用类型约束进行重构

DOI:
10.1145/1961204.1961205
复制
发表时间:
2011
期刊:
ACM Trans. Program. Lang. Syst.
影响因子:
--
通讯作者:
B. D. Sutter
B. D. Sutter
中科院分区:
--
文献类型:
--
作者:
F. Tip;Robert M. Fuhrer;Adam Kiezun;Michael D. Ernst;Ittai Balaban;B. D. Sutter

文献摘要

被引文献

相似文献

类型约束表示程序表达式类型之间的子类型关系,例如,那些类型正确性所需的关系。类型约束最初是作为解决类型检查和类型推理问题的方便框架。本文显示了如何将类型约束用作实用重构工具的基础。在我们的方法中,一组类型的约束是从类型纠正程序的。我们工作背后的主要见解是,P仅构成该约束系统的一种解决方案,并且可能存在与重构版本相对应的替代解决方案我们展示了如何使用类型约束来自然表达操纵类型和类层次结构的许多重构。日食的标准分布中的几个重构是基于我们的工作。
Type constraints express subtype relationships between the types of program expressions, for example, those relationships that are required for type correctness. Type constraints were originally proposed as a convenient framework for solving type checking and type inference problems. This paper shows how type constraints can be used as the basis for practical refactoring tools. In our approach, a set of type constraints is derived from a type-correct program P. The main insight behind our work is the fact that P constitutes just one solution to this constraint system, and that alternative solutions may exist that correspond to refactored versions of P. We show how a number of refactorings for manipulating types and class hierarchies can be expressed naturally using type constraints. Several refactorings in the standard distribution of Eclipse are based on our work.