A Formalism for Specifying Model Merging Conflicts Mohammadreza Sharbaf, Bahman Zamani, Gerson Sunyé
Total Page:16
File Type:pdf, Size:1020Kb
A Formalism for Specifying Model Merging Conflicts Mohammadreza Sharbaf, Bahman Zamani, Gerson Sunyé To cite this version: Mohammadreza Sharbaf, Bahman Zamani, Gerson Sunyé. A Formalism for Specifying Model Merging Conflicts. System Analysis and Modelling (SAM) conference, Oct 2020, Virtual Event, Canada. 10.1145/3419804.3421447. hal-02930770 HAL Id: hal-02930770 https://hal.archives-ouvertes.fr/hal-02930770 Submitted on 4 Sep 2020 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. A Formalism for Specifying Model Merging Conflicts Mohammadreza Sharbaf ∗ Bahman Zamani Gerson Sunyé MDSE Group, University of Isfahan MDSE Group, University of Isfahan LS2N, University of Nantes Isfahan, Iran Isfahan, Iran Nantes, France [email protected] [email protected] [email protected] ABSTRACT sites. Each of the participants focuses on specific aspects of the Verifying the consistency of model merging is an important step to- system and locally modifies only a particular part of the model. wards the support for team collaboration in software modeling and When participants deliver locally modified models, those need to evolution. Since merging conflicts are inevitable, this has triggered be integrated into a common relevant model for continuing the soft- intensive research on conflict management in different domains. De- ware evolution. The problem is that some concurrent updates may spite these efforts, techniques for high-level conflict representation be incompatible and contribute to conflicts during the integration have hardly been investigated yet. In this paper, we propose an ap- process. Therefore, it is critical to focus on conflict management to proach to specify model merging conflicts. This approach includes maintain the model consistent [11]. the Conflict Pattern Language (CPL), a formalism for specifying To support conflict management in model merging, several ap- conflicts in different modeling languages. CPL is based on theOCL proaches have been proposed so far. Most of them provide conflict grammar and is tooled by an editor and a parser. CPL facilitates the detection techniques to discover conflicts which may occur due to slow and error-prone task of specifying model merging conflicts concurrent changes. Some of them focus on reconciling conflicts and can be used to specify conflicts in any EMF-based model. We with context-free techniques based on a three-way model merging evaluated our approach with a case study, including five different strategy [11]. Furthermore, some approaches try to prevent conflict conflict cases. The results are promising about how CPLcanbe occurrence by using mechanisms to inform the user about con- used for specifying syntactic and semantic conflicts. flicting situations for concurrent actions [17]. Despite these efforts, techniques for high-level conflict representation have been rarely CCS CONCEPTS studied yet. The fact is that, for performing conflict management activities, we have to know which situation is considered as a con- • Software and its engineering ! Specification languages; flict. In merging models, we face different kinds of conflicts. Each Formal language definitions. conflict refers to a particular context that depends on the syntax KEYWORDS and semantics of the modeling language [1]. Potential conflicts are mainly domain-specific; hence, they can be hard to understand Model Merging Conflict, Conflict Specification Formalism, Conflict and be recognized solely by language engineers. However, in the Representation, Collaborative Modeling, Model Driven Engineering collaborative evolution of models, in merging new versions, it is ACM Reference Format: necessary to automatically check for potential conflicts, which is Mohammadreza Sharbaf, Bahman Zamani, and Gerson Sunyé. 2020. A For- not possible without a precise or formal specification of conflicts. malism for Specifying Model Merging Conflicts. In 12th System Analysis and To this end, an approach to specify merging conflicts for different Modelling Conference (SAM ’20), October 19–20, 2020, Virtual Event, Canada. modeling languages is needed, which is still remained as an issue. ACM, New York, NY, USA, 10 pages. https://doi.org/10.1145/3419804.3421447 In this paper, we present a formalism for specifying model merg- ing conflicts to solve the issue previously mentioned. Our proposal 1 INTRODUCTION is based on the concept of patterns as approved solutions to recur- Software development includes several activities, analysis, design, ring specification and design problems. We define each conflict asa and implementation, to name a few. These activities are mainly com- pattern that describes the situation of model elements at the time of plex and require collaboration between different experts, coming conflict. To propose the conflict representation formalism, wepro- from a wide variety of fields [32]. Modeling, which is mainly used vide an extension to the Graphical Extension of BNF (GEBNF) [3]. in the analysis and design phases of software development is no Based on this formalism, we designed a language called Conflict exception. When the software is complex, the size and complexity Pattern Language (CPL), which applies to any EMF-based model. To of models increases dramatically. This enforces that many heteroge- facilitate the slow and error-prone task of writing and syntactically neous partners participate in large teams and work collaboratively validating the specification of model merging conflict patterns, we together [22]. Some of the participants may work concurrently also extended the Object Constraint Language (OCL) grammar to and independently on the same model from different geographical provide a grammar parser and a syntax-aware editor. ∗Also with LS2N, University of Nantes, Nantes, France. The proposed conflict representation approach is illustrated by the “Pull-Up Method” refactoring conflict [19] for the UML Class SAM ’20, October 19–20, 2020, Virtual Event, Canada diagram; however, it is applicable to specify conflict patterns for © 2020 Association for Computing Machinery. models conforming to arbitrary metamodels. To evaluate the ap- This is the author’s version of the work. It is posted here for your personal use. Not for redistribution. The definitive Version of Record was published in 12th System plicability of our proposed formalism and language, we ran a case Analysis and Modelling Conference (SAM ’20), October 19–20, 2020, Virtual Event, Canada, study to answer the following research questions: https://doi.org/10.1145/3419804.3421447. SAM ’20, October 19–20, 2020, Virtual Event, Canada M. Sharbaf, et al. RQ1) Is it possible to specify any model merging conflict as Semantic conflicts go beyond the generic conflicts and needto a pattern? consider the system behavior and the modeling language seman- RQ2) Is the proposed formalism able to represent model tics. Indeed, the integration of concurrent changes may result in a merging conflicts? syntactically correct merged version, yet semantically invalid [1]. RQ3) Is our formalism able to support the representation of Semantic conflicts are divided into three categories: Static seman- conflicts for different modeling languages? tics, behavioral semantics, and semantic equivalence [2]. In this context, static semantic conflicts refer to issues and side The rest of this paper is organized as follows. Section 2 briefly effects detected at compile-time, such as violation of hierarchy provides background information on collaborative modeling as well constraints and incompatible types, which remain hidden in the as model merging conflicts and introduces our running example. merged version without considering the model semantics. In most Section 3 provides the idea of using patterns for representing model modeling languages, e. g. UML, these conflicts violate their well- merging conflicts and presents the conflict specification formal- formedness rules and are perceived as syntax conflicts. Behavioral ism. The combination of conflict pattern specification with OCL to semantic conflicts denote different or unexpected behavior inthe implement the Conflict Pattern Language (CPL) parser and editor merged model, which relies on the runtime semantics. It considers is reported in Section 4. Section 5 presents the case study which the execution behavior of modeled systems based on the data and is amended by a discussion on each research question. Section 6 control flow. Semantic equivalence conflicts denote contradicting reports related work. Finally, Section 7 concludes the paper and conditions in which the modeler can express the same meaning in highlights areas for future work. different ways using equivalent concepts or equivalent constructs. In those conditions, syntactically, both modifications can be applied 2 BACKGROUND because of their different appearance, while only one of them should 2.1 Collaborative Modeling be applied to perform a valid merged model. In software development, different stakeholders collaborate to build complex systems. This collaboration results