R. W. Bowdidge, W. G. Griswold, "Automated Support for Encapsulating Abstract Data Types", ACM SIGSOFT '94 Symposium on the Foundations of Software Engineering, December, 1994. SIGSOFT Software Engineering Notes, vol. 19, no.5, pp. 97-110, Dec. 1994.


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 pertinent 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.