Automated support for encapsulating abstract data types

Automated support for encapsulating abstract data types
复制标题

自动支持封装抽象数据类型

DOI:
10.1145/193173.195298
复制
发表时间:
1994
期刊:
SIGSOFT '94
影响因子:
--
通讯作者:
W. Griswold
W. Griswold
中科院分区:
--
文献类型:
--
作者:
Robert W. Bowdidge;W. Griswold

文献摘要

被引文献

相似文献

软件工程师可以在维护期间使用保留意义的程序重构工具来更改程序的结构,以便于修改。一种常见的重构操作是通过封装现有数据结构来创建新的抽象数据类型。数据封装通过隔离对抽象数据类型的实现和行为的更改来简化修改。要执行封装,程序员必须了解如何在代码中使用数据结构,识别对数据结构执行的抽象操作,并选择要制成函数的具体表达式。我们提供了一种可操作的程序可视化,称为星形图,它既突出了封装中的信息部分,又通过直接操作的用户界面支持在程序上应用保持意义的重构变换。可视化以图形和紧凑的方式呈现程序中使用给定全局数据结构的所有语句,帮助程序员选择完全封装它的函数。此外,可视化省略了与数据结构和任务无关的代码,并折叠了类似的表达式,以允许程序员识别频繁出现的代码片段并一起操作它们。可视化被直接映射到程序文本,因此对可视化的操作也会重新构造程序。我们描述了星形图的设计、实现和应用,并评估了它在大型程序中辅助数据封装的能力。
A software engineer can use a meaning-preserving program restructuring tool during maintenance to change a program's structure to ease modification. One common restructuring action is to create a new abstract data type by encapsulating an existing data structure. Data encapsulation simplifies modification by isolating changes to the implementation and behavior of an abstract data type. To perform encapsulation, a programmer must understand how the data structure is used in the code, identify abstract operations performed on the data structure, and choose concrete expressions to be made into functions. We provide a manipulable program visualization, called the star diagram, that both highlights information partinent to encapsulation and supports the application of meaning-preserving restructuring transformations on the program through a direct-manipulation user interface. The visualization graphically and compactly presents all statements in the program that use the given global data structure, helping the programmer to choose the functions that completely encapsulate it. Additionally, the visualization elides code unrelated to the data structure and to the task, and collapses similar expressions to allow the programmer to identify frequently occurring code fragments and manipulate them together. The visualization is mapped directly to the program text, so manipulation of the visualization also restructures the program. We describe the design, implementation, and application of the star diagram, and evaluate its ability to assist data encapsulation in large programs.