Composition and Interoperability for External Domain-Specific Language Engineering Thomas Degueule
Total Page:16
File Type:pdf, Size:1020Kb
Composition and Interoperability for External Domain-Specific Language Engineering Thomas Degueule To cite this version: Thomas Degueule. Composition and Interoperability for External Domain-Specific Language Engi- neering. Software Engineering [cs.SE]. Université de Rennes 1 [UR1], 2016. English. tel-01427009v1 HAL Id: tel-01427009 https://hal.inria.fr/tel-01427009v1 Submitted on 5 Jan 2017 (v1), last revised 31 Jan 2017 (v2) HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. ANNÉE 2016 THÈSE / UNIVERSITÉ DE RENNES 1 sous le sceau de l’Université Bretagne Loire pour le grade de DOCTEUR DE L’UNIVERSITÉ DE RENNES 1 Mention : Informatique École doctorale Matisse présentée par Thomas Degueule préparée à l’unité de recherche IRISA (UMR 6074) Institut de Recherche en Informatique et Systèmes Aléatoires ISTIC – UFR en Informatique et Électronique Thèse soutenue à Rennes le 12 décembre 2016 devant le jury composé de : Composition and Mark van den Brand Professeur, Eindhoven University of Technology / Interoperability for Rapporteur Richard Paige Professeur, University of York / Rapporteur External Domain-Specific Sandrine Blazy Professeur, Université de Rennes 1 / Examinatrice Language Engineering Ralf Lämmel Professeur, University of Koblenz-Landau / Examina- teur Bernhard Rumpe Professeur, RWTH Aachen University / Examinateur Olivier Barais Professeur, Université de Rennes 1 / Directeur de thèse Arnaud Blouin Maître de conférences, INSA Rennes / Co-directeur de thèse Benoit Combemale Maître de conférences, Université de Rennes 1 / Examinateur Contents 1 Introduction1 1.1 Context............................... 1 1.2 Problem Statement......................... 2 1.3 Contributions............................ 4 1.4 Applications............................. 5 1.5 Context of this Thesis....................... 6 1.6 Outline ............................... 6 I Background and State of the Art8 2 Background9 2.1 Software Languages ........................ 9 2.2 Software Language Engineering.................. 11 2.3 Model-Driven Engineering..................... 15 2.4 Summary .............................. 22 3 State of the Art 23 3.1 Introduction............................. 23 3.2 Constraints and Requirements................... 24 3.3 Modularity and Composition in DSL Engineering . 26 3.4 Interoperability and Flexibility in MDE ............. 32 3.5 Support in Language Workbenches................ 35 3.6 Summary .............................. 39 II Contributions 41 4 On Language Interfaces 42 4.1 Introduction............................. 42 ii Contents 4.2 Interfaces in Software Engineering ................ 43 4.3 Interfaces for Software Language Engineering.......... 45 4.4 Conclusion ............................. 48 5 Safe Model Polymorphism for Flexible Modeling 49 5.1 Introduction............................. 49 5.2 On the Limits of the Conformance Relation........... 51 5.3 A Type System for Flexible Modeling .............. 60 5.4 Implementation of Model Polymorphism in Melange . 65 5.5 Experiments............................. 70 5.6 Conclusion ............................. 76 6 Modular and Reusable Development of DSLs 77 6.1 Introduction............................. 77 6.2 Approach Overview ........................ 78 6.3 An Algebra for DSL Assembly and Customization . 81 6.4 Implementation of the Algebra in Melange............ 89 6.5 Case Study ............................. 93 6.6 Conclusion .............................103 III Implementation 104 7 The Melange Language Workbench 105 7.1 Language Definition in Melange..................105 7.2 Model Types ............................113 7.3 Integration with Eclipse and EMF . 115 7.4 Conclusion .............................120 IV Conclusion and Perspectives 122 8 Conclusion and Perspectives 123 8.1 Conclusion .............................123 8.2 Perspectives.............................125 List of Figures 129 List of Tables 131 List of Listings 132 Author’s Publications 134 Bibliography 136 iii Contents A Listings 158 iv Chapter 1 Introduction In this chapter, I first introduce the context of this thesis (Sec- tion 1.1) and detail the research questions I address (Section 1.2). Then, I give an overview of our approach, list the various scientific contributions (Section 1.3), and the different applications on which we validate them (Section 1.4). Finally, I mention the industrial and international collaborations that motivated our contributions (Section 1.5) and outline the general organization and the different chapters of this manuscript (Section 1.6). 1.1 Context The advent of complex software-intensive systems, such as Systems of Systems, Cyber-Physical Systems or the Internet of Things, raises numerous new soft- ware engineering challenges. The development of these systems involves many stakeholders, each with diverse areas of expertise, who contribute their knowl- edge on specific aspects of the system of interest. Typically, stakeholders are accustomed to express their knowledge in the form of models using specialized concepts and notations commonly used within their discipline (e.g., mechanical engineering, energy management, systems engineering). An intuitive approach to foster the involvement of stakeholders in the development of such systems is to provide them with appropriate means to express their models of the system, and to use these models actively throughout the development process. The ultimate vision is to break down the barrier between software engineering and other engineering disciplines by enabling domain specialists to actively participate in the development of software systems in which they have an interest. Model-Driven Engineering (MDE) [231] contributes to this vision in various ways. First, MDE proposes to reduce the accidental complexity associated with the development of complex systems by bridging the gap between the problem-level abstractions used by stakeholders and the implementation-level concepts used to realize the target software system [108]. Second, leveraging the time-honored practice of separation of concerns, MDE advocates the use 1 1.2. Problem Statement of multiple Domain-Specific Languages (DSLs), each with a dedicated set of concepts, notations, and tools suitable for modeling a particular aspect of the system. One key idea of MDE is to move from descriptive models to prescriptive models that are used to construct the target system. Such models are used to perform early verification and validation activities, and automate the generation of essential software artifacts (e.g., components, test cases, documentation). The benefits of MDE range from improvements in the productivity of developers to enhanced software quality [25, 138]. Recent studies show that the use of appropriate DSLs is one of the key factor for the successful adoption of MDE in industrial settings [137, 273]. DSLs aim at bridging the gap between the problem space (in which stakeholders work) and the solution space (the concrete software artifacts defining the target system) [105]. They are usually small and intuitive software languages whose concepts and expressiveness are focused on a particular domain [187]. As “software languages are software too” [97], the development of DSLs and their supporting environment (editors, generators, simulators, etc.) inherits the complexity of software development in general. Because the domains they focus are continuously evolving, DSLs tend to evolve at a faster rate than general-purpose languages. It follows that concerns such as reusability, maintainability or evolution must be taken into account when engineering them. Fortunately, good practices from the software engineering community can be leveraged to achieve these engineering goals. The need for proper tools and methods supporting the development of DSLs led to the emergence of the Software Language Engineering (SLE) research field which Kleppe defines as “the application of systematic, disciplined, and measurable approaches to the development, use, deployment, and maintenance of software languages” [158]. On the one hand, MDE relies on SLE techniques for efficient and main- tainable engineering of DSLs. On the other hand, MDE proposes a solid theory of language definition for the definition of DSLs. MDE and SLE thus cross-fertilize each others, and this thesis is positioned at the intersection of these two research fields. 1.2 Problem Statement DSLs exist in different shapes, ranging from fluent application programming in- terfaces [106] to external DSLs. Notably, external DSLs offer the best flexibility and added value for the end users but are the most costly to engineer as they cannot rely on the infrastructure of a host language [107]. The development of an external DSL encompasses the definition of its abstract syntax, concrete syntax, semantics, and a dedicated environment that assists users of the lan- guage in the creation, analysis, and management of the conforming models. Following the principles of MDE, the development of a new DSL usually starts with the definition of a metamodel, the cornerstone artifact