Some paragraphs from the abstract of my PhD thesis:
Model-Based Software Engineering (MBSE) has been proposed as a promising software development methodology to overcome limitations of traditional programming-based methodology in dealing with the complexity of embedded systems. MBSE promotes the use of modeling languages for describing systems in an abstract way and provides means for automatically generating different development artifacts, e.g. code and documentation, from models. The development of a complex system often involves multiple stakeholders who use different tools to modify the development artifacts, model and code in particular in this thesis. Artifact modifications must be kept consistent: a synchronization process needs to propagate modifications made in one artifact to the other artifacts.
In this study, the problem of synchronizing Unified Modeling Language (UML)-based architecture models, specified by UML composite structure (UML-CS) and UML state machine (UML-SM) elements, and object-oriented code is presented. UML-CSs are used for describing the component-based software architecture and UML-SMs for discrete event-driven behaviors of reactive systems. The first challenge is to enable a collaboration between software architects and programmers producing model and code by using different tools. This raises the synchronization problem of concurrent artifact modifications. In fact, there is a perception gap between diagram-based languages (modeling languages) and text-based languages (programming languages). On the one hand, programmers often prefer to use the more familiar combination of a programming language and an Integrated Development Environment. On the other hand, software architects, working at higher levels of abstraction, tend to favor the use of models, and therefore prefer diagram-based languages for describing the architecture of the system. The second challenge is that there is a significant abstraction gap between the model elements and the code elements: UML-CS and UML-SM elements are at higher level of abstraction than code elements. The gap makes current synchronization approaches hard to be applied since there is no easy way to reflect modifications in code back to model.
This thesis proposes an automated synchronization approach that is composed of two main correlated contributions. To address the first challenge, a generic model-code synchronization methodological pattern is proposed. It consists of definitions of necessary functionalities and multiple processes that synchronize model and code based on several defined scenarios where the developers use different tools to modify model and code. This contribution is independent of UML-CSs and UML-SMs. The second contribution deals with the second challenge and is based on the results from the first contribution. In the second contribution, a bidirectional mapping is presented for reducing the abstraction gap between model and code. The mapping is a set of correspondences between model elements and code elements. It is used as main input of the generic model-code synchronization methodological pattern. More importantly, the usage of the mapping provides the functionalities defined in the first contribution and eases the synchronization of UML-CS and UML-SM elements and code. The approach is evaluated by means of multiple simulations and a case study.