Automated support for encapsulating abstract data types

  • Authors:
  • Robert W. Bowdidge;William G. Griswold

  • Affiliations:
  • Department of Computer Science and Engineering, University of California, San Diego, La Jolla, CA;Department of Computer Science and Engineering, University of California, San Diego, La Jolla, CA

  • Venue:
  • SIGSOFT '94 Proceedings of the 2nd ACM SIGSOFT symposium on Foundations of software engineering
  • Year:
  • 1994

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.