Synchronising Changes to Design and Implementation using a Declarative Meta-Programming Language Roel Wuyts roel.wuyts@iam.unibe.ch Software Composition Group Institut f¨ ur Informatik und angewandte Mathematik Universit¨at Bern, Switzerland Abstract When developing software systems, the relation between design and implementation is typ- ically left unspecified. As a result design or implementation can be modified independently of each other, and a modification of either one does not leave any trace in the other. The practi- cal result of this is a number of well-known problems such as drift and erosion, documentation maintenance problems or round-trip engineering trouble. To solve these problems we propose to make the relation between design and implementation explicit by expressing design as a logic meta-program over implementation. This is the cornerstone for building a complete syn- chronisation framework that allows one to synchronise changes to design and implementation. We have implemented such synchronisation framework, and applied it successfully on two case studies. 1 Introduction One of the main problems in software engineering we see is that the relation between design and implementation is typically left implicit, and almost never explicitly gets recorded. The result is a number of well-known problems, such as design and implementation drifting apart during development, or the documentation quickly getting out of sync with respect to the implementation. In this paper we tackle this problem with a solution based on the following cornerstones: 1. express design as a logic meta-program over implementation: hence the relation is made explicit in a full-fledged programming language; 2. use the logic meta-programming language as the synchronisation engine and to define actions. Because the mapping is expressed as a logic meta-program, we can run logic programs that compare design and implementation and implement actions when differences are found (such as adding or removing items in either design or implementation); 3. integrate in the development environment to receive notifications of changes: when the devel- opment environment is able to notify the synchronisation engine whenever changes are made to design or implementation, the synchronisation engine can guide design or development (by indicating design violations, or updating the design as needed, etc.) We implemented this solution as a framework (the synchronisation framework ), that allows to synchronise changes between design and implementation. Its general structure is shown in Figure 1. The main participants are the ones found in the conceptual solution outlined above: the Declarative Framework that relates design and implementation, a logic meta-programming language that is used as synchronisation engine and the design and implementation monitors that integrate the synchronisation engine in the development environment. 1