Understanding and Adaptation

In each of these scenarios, understanding and adaptation are central to the process, as the figure suggests. Adaptation is needed when certain design and implementation decisions that were appropriate to the original application prove unsuitable for new applications. It involves factoring out the inappropriate choices and replacing them; this may in turn affect other choices, and therefore cause additional adaptations. Understanding the structure and interrelationships between various entities in a software component is essential to its adaptation and integration in a new application. It is also important in deciding whether a candidate component is actually suitable in a particular new application.

Software developers are justifiably wary of the effort involved in, and the difficulties inherent to, understanding and adapting software. Since these activities are so central to reuse in all its scenarios, we believe that there is a need for tools that support them directly.

\begin{figure}\vspace{4.5in}
\end{figure}

Currently, understanding and adaptation are most frequently carried out using a text editor, whose operations manipulate character strings. The problem is that character strings are a lowest common denominator representation that does not capitalize on the special semantics of the type of text being manipulated. We are developing an alternative approach that explicitly employs knowledge of the application domain, programming constructs, and the mappings between them. Thus, instead of issuing a command to search for a character string, the developer can ask to see the ``message encryption functions''. And, instead of issuing commands to replace certain character strings with others, the developer can issue commands to ``add message acknowledgment'' or ``substitute a connectionless socket for the connection-oriented socket''. These two approaches are contrasted in Figure 2. In addition to differences in the level and power of the commands the developer uses, there are differences in the guarantees that can be made about the adapted component; a component adapted via editing may not even compile, while a component that is adapted in the alternate way should meet even higher standards than compilability. Our technical approach to achieving this model is described below.