Enhancing Maintainability and Modularity in the Presence of Implementation Dependencies
This dissertation presents a new, backwards compatible, language independent, and incremental programming methodology called view-based abstraction. Unlike the well-known black-box abstraction approach, view-based abstraction enables programmers to maintain program modularity even in the presence of implementation couplings, i.e., dependencies among the code modules that rely on otherwise "hidden" implementation details not specified in the module interfaces. This dissertation also presents a transformation-based implementation of view-based abstraction, called ViewForm. ViewForm acts as a source-to-source preprocessor that automatically performs an implementation coupling expressed by the programmer. When the original code is later updated, ViewForm automatically attempts to reapply the implementation coupling to the updated code. ViewForm will modify the updated source code only if the coupling is still valid. In this way, by performing some extra work up front, the programmer performing an implementation coupling saves future programmers from having to pay for the consequences of broken modularity. To aid in writing this up-front ViewForm code, this dissertation presents a structured approach for using view-based abstraction and writing ViewForm transformations constructs.
To demonstrate view-based abstraction, ViewForm is used to produce automated, performance-based implementation couplings in three example programs: an amorphous computing simulator, a conditional-probability pedigree computation, and ViewForm itself. Unlike other approaches that also use interprocedural program analyses, the results indicate that view-based abstraction is practical and scales gracefully - the extra automation increased compilation time from a typical 34%, to 40% in the worst case, despite a less than fully optimized ViewForm implementation. Each optimization required the programmer to write only 65 to 137 lines of ViewForm code for programs of size 167 lines to 7,616 lines. This work is amortized as time saved by programmers modifying the original program in the future. In all three examples, ViewForm maintained modularity by regenerating correct code when the original modules were modified - even when those modifications were to the optimization-dependent sections of the original code.