Event-Driven Model Transformations in Domain-Specific Modeling
Total Page:16
File Type:pdf, Size:1020Kb
Budapest University of Technology and Economics Department of Computer Science and Information Theory Event-driven Model Transformations in Domain-specific Modeling Languages PhD Thesis Istvan´ Rath´ MSc in Technical Informatics Supervisor: Dr. Daniel´ Varro,´ PhD associate professor Budapest, December 2010 i Summary In today’s model-centric software engineering world, domain-specific modeling languages play a piv- otal role in agile system modeling, rapid prototyping and generative programming. These techniques are important factors in achieving increased productivity, improved software quality and lower mainte- nance and documentation costs. Due to extensive research and industrial interest in language engineering technology over the last decade, the development of domain-specific languages as development tools is nowadays significantly easier, but still requires expertise in a wide range of domains: language engineering heavily relies on core modeling and other auxiliary technologies (such as graphical editing frameworks and parser generators). In parallel, extensive research has been invested into model transformations that provide the foundations for integrating DSMLs into development processes and facilitate crucial use-cases such as automated mappings and code generation. The results of these related technologies can be combined to further advance domain-specific language development and decrease tool development costs. Therefore, this thesis is centered around the concept of tight integration of model transformations into language engineering techniques, so that they may provide high level foundations for advanced language engineering aspects such as well-formedness constraint evaluation, automated mappings be- tween various concrete and abstract syntax representations and simulation based on dynamic semantics. As a crucial enabling factor, the traditional, batch execution-oriented paradigm of model trans- formation development needs to be adapted to domain-specific modeling scenarios that are inherently interactive. To support this approach, the core scientific contribution of this work is focused on event- driven transformations that run like daemons in the background, and react to complex changes of the model whenever necessary in the form of transformation actions. In this work, I (i) give novel con- ceptual foundations for event-driven transformations based on event-condition-action formulas that are well known in expert systems; (ii) provide a high level specification language, extending the VIATRA2 transformation language to allow a high degree of knowledge and implementation re-use from tradi- tional transformation engineering; (iii) elaborate a high performance prototype implementation of an event-driven graph transformation system based on incremental graph pattern matching. I developed in-depth applications of this technology in domain-specific modeling language engi- neering. First, event-driven transformations are combined with specification metamodels to create a mapping library that allows the complete separation of abstract and concrete syntax representations of a modeling language, which is a key challenge in developing very complex, yet still usable DSMLs. I also elaborate a framework for the design-time, integrated execution of dynamic semantics to provide high level model simulation support for DSMLs. By this approach, the rapid prototyping of dynamic modeling languages becomes feasible. Finally, I outline further applications in well-formedness con- straint evaluation and incremental code generation. To illustrate practical applications of the contributions of the thesis, I elaborate tool integration case studies in model-driven software development. In these scenarios, domain integration techniques are extensively used to support systems modeling from various, consistent modeling perspectives, while event-driven transformations are combined with advanced traceability modeling to create change- driven transformations that facilitate change propagation to external (deployed) models. The results of this work form an integral part of the VIATRA2 model transformation framework and the ViatraDSM language engineering framework. The case studies of the thesis are contributions to the SENSORIA, MOGENTES and SecureChange European Union research projects. ii Acknowledgements I wish to express my gratitude, first and foremost, to my supervisor, Dr. Daniel´ Varro.´ Without his continuous support, valuable insight, ideas, friendly advice and enthusiasm over the past six years, I would have never succeeded. I am also grateful to my colleagues in the Fault Tolerant Systems Research Group, especially Prof. Dr. Andras´ Pataricza and Dr. Istvan´ Majzik for their trust and support of my research. I highly acknowledge the VIATRA2 team, namely Dr. Andras´ Balogh, Gabor´ Bergmann, Abel´ Hegedus,¨ Akos´ Horvath,´ Zoltan´ Ujhelyi and Dr. Gergely Varro´ for the fruitful collaborative research work, and the fun we had. I am thankful to past members Andras´ Schmidt and David´ Vag´ o´ for their contributions in the early beginnings. Many thanks to research associates Mat´ e´ Kovacs,´ Dr. Balazs´ Polgar,´ and Daniel´ Toth,´ and my former MSc students: Andras´ Okr¨ os,¨ Ad´ am´ Horvath,´ and all the others for their ideas, suggestions, contributions and hard work in using, testing and developing VIATRA2 over many years. I would like to thank my colleagues at the University of Leicester, Prof. Dr. Reiko Heckel, Ajab Khan and Dr. Paolo Torrini for the fruitful collaborative work. I also highly acknowledge Philip Mayer at the Ludwig-Maximilians-Universitat¨ Munchen¨ for our joint work in the SENSORIA project. I wish to thank Dr. Krzysztof Czarnecki and his group for supporting my research visit at the University of Waterloo. My work was supported by the SENSORIA (IST-3-016004, FP6), DIANA (AERO1-030985, FP6), SecureChange (ICT-FET-231101, FP7) and MOGENTES (ICT-216679, FP7) European research projects, and the PhD Candidate Scholarship of the Faculty of Electrical Engineering of the Budapest University of Technology and Economics. Finally, I would like to thank my family and friends for their support and tolerance. Contents Contents iii 1 Introduction 1 1.1 Model-driven software engineering . 1 1.2 Domain-specific modeling languages in model-driven software engineering . 4 1.3 Challenges and contributions . 6 1.4 The structure of the thesis . 9 I Domain-specific language engineeering 11 2 Modeling preliminaries 13 2.1 Overview . 13 2.2 Running example . 14 2.3 Models and metamodels . 15 2.4 Well-formedness . 19 2.5 Models and metamodels in VIATRA2 .......................... 22 2.6 Traceability models . 24 2.7 Summary . 26 3 Language engineering in the ViatraDSM framework 29 3.1 Domains in modeling languages . 29 3.2 The ViatraDSM Framework . 33 3.3 Domain integration techniques . 37 3.4 Domain integration over the VPM model space . 41 3.5 Related work . 52 3.6 Summary . 56 II Event-driven transformations in domain-specific languages 59 4 Preliminaries of model transformations 61 4.1 Foundations of model transformations . 61 4.2 Incremental graph pattern matching . 75 4.3 Summary . 82 5 Event-driven transformations 83 5.1 Foundations of incremental model transformations . 83 5.2 Overview of event-driven transformations . 86 5.3 Graph triggers: an event-driven transformation language . 95 iii iv CONTENTS 5.4 Performance evaluation . 100 5.5 Related work . 104 5.6 Summary . 106 6 Sychronization between abstract and concrete syntax 107 6.1 Introduction . 107 6.2 Challenges of model synchronization in graphical editors . 108 6.3 Modeling the Abstract and Concrete Syntax . 111 6.4 Generic abstract-concrete synchronization with mapping models and live transformations112 6.5 Arbitrary abstract–concrete syntax mapping . 117 6.6 Implementation details . 121 6.7 Related work . 122 6.8 Summary . 125 7 Model simulation in DSMLs 127 7.1 Overview . 127 7.2 Model simulation by event-driven transformations . 128 7.3 Performance evaluation . 133 7.4 Related work . 135 7.5 Summary . 136 III Applications in tool integration 139 8 Change-driven transformations 141 8.1 Overview . 141 8.2 Change history models . 144 8.3 Applying CHMs to non-materialized models . 150 8.4 Related work . 152 8.5 Summary . 154 9 Tool integration based on change-driven transformations 157 9.1 The architecture of tool integration chains . 157 9.2 A metamodel for development and integration processes . 160 9.3 Case Study: The DIANA toolchain . 162 9.4 Implementation of the Tool Integration Framework . 165 9.5 Process modeling languages for tool integration . 167 9.6 Related work . 169 9.7 Summary . 171 IV Conclusions and Appendix 173 10 Conclusion 175 10.1 Fulfillment of objectives . 175 10.2 Applications of new results . 176 10.3 Future research directions . 177 CONTENTS v A Model transformation source listings 179 A.1 Abstract-concrete syntax synchronization transformations . 179 B Stochastic model simulation 183 B.1 Introduction . 183 B.2 Stochastic execution of simulation schemes . 185 B.3 Prototype implementation . 186 B.4 Initial experiments with simulating P2P networks . 187 C Tool integration in the SDE 189 C.1 Introduction . 189 C.2 High-Level Overview . 190 C.3 Design and Implementation . 192 C.4 Integrated Tools . 197 C.5 Tool Applications . 200 C.6 Summary . 204 List of publications 205 Book chapters . 205 Journals . 205 Conferences and workshops . 206 Master’s thesis . 207 Bibliography 209 Chapter 1 Introduction 1.1 Model-driven software engineering Models are projections of reality. In engineering, they are used to capture concepts related to the engineer’s task: the product that is being designed, its environment, and processes that may be involved in its life cycle. Models are attractive because they allow a problem to be precisely grasped at the right level of abstraction without unnecessarily delving into detail. In software development, models are used to represent data structures, communication between agents, algorithms, or at a higher abstraction level, entities in a complex system, e.g. organisational units or products in an e-commerce application. The software industry has been experimenting with high level models at the core of development for two decades.