Elsevier

Journal of Systems and Software

Volume 112, February 2016, Pages 137-155
Journal of Systems and Software

Consistent merging of model versions

https://doi.org/10.1016/j.jss.2015.06.044Get rights and content

Highlights

  • Proposing a novel approach to merging versions of models.

  • Dealing with both conflicts and inconsistencies arising in the merging process.

  • Our approach has been formally proven to be correct (sound and complete).

  • Scalability was empirically validated using real, industrial design models.

Abstract

While many engineering tasks can, and should be, manageable independently, it does place a great burden on explicit collaboration needs—including the need for frequent and incremental merging of artifacts that software engineers manipulate using these tools. State-of-the-art merging techniques are often limited to textual artifacts (e.g., source code) and they are unable to discover and resolve complex merging issues beyond simple conflicts. This work focuses on the merging of models where we consider not only conflicts but also arbitrary syntactic and semantic consistency issues. Consistent artifacts are merged fully automatically and only inconsistent/conflicting artifacts are brought to the users’ attention, together with a systematic proposal of how to resolve them. Our approach is neutral with regard to who made the changes and hence reduces the bias caused by any individual engineer’s limited point of view. Our approach also applies to arbitrary design or models, provided that they follow a well-defined metamodel with explicit constraints—the norm nowadays. The extensive empirical evaluation suggests that our approach scales to practical settings.

Introduction

Models have become central artifacts which are created and used by software engineers. In a collaborative environment, which is the dominant form of today’s software development, software engineers concurrently and independently work on models which subsequently need to be merged. A basic scenario is where multiple software engineers work independently on a single model and, since they do so separately on their respective workstations, different versions of that model may exist. These different versions then need to be merged periodically to support collaboration and error detection among these engineers. In another scenario, multiple versions of a model may exist due to the concurrent evolution of product variants. For example, a company may develop multiple related software products, each undergoing constant evolution, to meet their respective, ever-changing user requirements and environmental changes. Here, merging may be desired to consolidate different variants or simply to facilitate reuse among the variants. There are many more such scenarios where software engineers find themselves confronted with concurrently evolving versions of architectural models (Chen et al., 2004). All these scenarios pose the challenging need to merge these different versions of models.

However, since models are complex, rich data structures of interconnected elements, traditional text-based versioning techniques and tools such as Git, Subversion, and CVS have not been successfully applied to model versioning (Brosch et al., 2012b). Without adequate tool support, model merging may result in a syntactically and/or semantically inconsistent merged version. Therefore, inconsistency management is of vital importance in model merging. However, state-of-the-art model merging techniques have only focused on detecting inconsistencies in merging versions of models (e.g. Brosch, Egly, Gabmeyer, Kappel, Seidl, Tompits, Widl, Wimmer, 2012, Sabetzadeh, Nejati, Easterbrook, Chećhik, 2008) and there has been very little work in resolving such inconsistencies having arisen during model merging.

This paper contributes a novel approach to model merging which helps software engineers in combining versions of models that are created and maintained separately. Our approach considers arbitrary, user-definable consistency constraints and merges the model versions fully automatically if they are consistent and free of conflicts.1 The software engineers are notified only if there are conflicts or inconsistencies. However, since inconsistencies are more complex problems than simple conflicts, solving them becomes harder. Repairing an inconsistency can have the side effect of creating a different inconsistency (“cascading”). Furthermore, the number of alternative repairs increases exponentially with the complexity of the consistency rule and the number of elements accessed (Reder and Egyed, 2012). Previous work has shown that abstract repairs, which merely identify the model elements that require repairing, are reasonably localized and scalable to compute. On the other hand, concrete repairs, which identify all possible ways of repairing a given model element, are often infinitely large. For example, even if a repair merely requires the change of a single state transition action, we must consider that there are infinitely many ways of writing such actions. And, unfortunately, effective model merging needs to explore this apparently infinite space of concrete repairs for any inconsistency caused—an apparently computationally infeasible endeavor.

This paper is a substantially extended and revised version of Dam et al. (2014) in a number of aspects. We have improved and extended our merging algorithm to include pruning (in the search) and catering for conflicting actions (Section 5). In addition, the new merging algorithm utilizes the scope of a consistency constraint (Egyed, 2006) in deriving candidate merged models. This approach offers an alternative to using the repair generation as in the previous version (Dam et al., 2014). Another significant extension is the formal proof which establishes the correctness of our approach (Section 6.1). The evaluation was also extended to accommodate the new merging algorithm. Sections 1 and 2 are also extended to better motivate and articulate the model merging problem, while Section 7 is extended to provide a more comprehensive review of the literature.

In this paper, we argue that the space of repairs for resolving inconsistencies in model merging is constrained by the changes made to the original model and thus it is practically feasible to explore them—not only in considering concrete repairs (as opposed to abstract repairs) but also in fixing a number of inconsistencies at once (as opposed to individual inconsistencies). If there are conflicts and/or inconsistencies among the artifacts to be merged, then clearly a compromise between those artifacts is necessary. A repair in this sense reflects a compromise. The constrained search space implies that there are limited resolution opportunities, and our approach employs a fast, automated search technique to quickly gauge whether a compromise is possible to solve the merging problem by taking some (but not all) of the engineers’ changes. It is useful to automate this initial compromise to avoid bias. However, since merging may involve tradeoffs where human judgment and communication are required, our approach provides the software engineers with all feasible alternative compromises in order to help them make informed, consistent merging decisions. The benefits of our approach are:

  • 1.

    Artifacts are merged fully automatically if they are consistent and conflict-free.

  • 2.

    Inconsistencies and/or conflicts caused during the merging are instantly recognized and reported to the engineer.

  • 3.

    Even with inconsistencies, parts of artifacts are still merged automatically if they are not involved in the inconsistencies.

  • 4.

    Unbiased compromises for resolving the inconsistencies among the engineers’ artifacts are computed automatically, to help the engineers quickly assess the problem.

We believe that our approach is applicable to arbitrary modeling languages and software engineering artifacts, as long as they follow a well-defined metamodel with explicit constraints. Since today the standard Unified Modeling Language (UML) is predominantly used in the industry for representing software models (Malavolta et al., 2013), we illustrate and validate our work mostly in the context of UML models. Architectural description languages such as Architecture Analysis and Design Language (AADL) (Feiler et al., 2006) have a metamodel, and constraints such as “A process can only be a subcomponent of a system component” can be expressed upon the metamodel. Temporal constraints modeling component interaction as expressed in the AADL’s behavior annex may need special treatments but our technique still can apply in general. We demonstrate that our approach is correct and an empirical analysis of large, third-party, industrial software models indicates its computational efficiency and scalability in practice. We do not presume the original model (or the versions) to be fully consistent, nor is there an expectation that the final, merged model must be consistent. This approach can thus be used at any level of maturity of the model – and hence at any stage of the process – to support the collaborative merging of artifacts.

The structure of our paper is as follows. In the next section, we will describe a typical scenario in which the key limitations of existing model merging techniques are highlighted. We then discuss how inconsistencies occur in merging models in Section 3. Section 4 serves to describe an architectural overview of our approach and its details are provided in Section 5. We then prove the correctness of our approach and report a number of experiments to validate its scalability in Section 6. Finally, we discuss related work in Section 7 before we conclude and outline future work in Section 8.

Section snippets

Illustrative example

We describe here a typical example of classical model merging where two software engineers, Alice and Bob, concurrently work on developing a model for a software controlling a washing machine. In this example, Alice and Bob use the Unified Modeling Language (UML) which has extensively been used for representing the models of software systems in recent years (Ivers, Clements, Garlan, Nord, Schmerl, Silva, 2004, Lallchandani, Mall, 2011, Malavolta, Lago, Muccini, Pelliccione, Tang, 2013). We

Lifecycle of an inconsistency

It is important to understand how inconsistencies have arisen in the merged model, as part of the investigation of how to resolve them. Table 2 captures a typical lifecycle of an inconsistency in terms of its presence (denoted as P) and absence (denoted as A) in a given version of a model. There are four model versions that we are interested in here: the original model (i.e. the common ancestor), the versions to be merged (i.e. Versions 1 and 2), and the merged model. The presence of an

Architectural overview

This section introduces the architecture of our merging framework (Fig. 4). The main objective of our approach is to provide a guidance mechanism to support software engineers in merging their concurrent changes to the model while maximizing its consistency. As input, our approach requires versions2 of design models to be merged (2...n), their common

State space search formulation

We formulate the second phase of merging in our framework as a state space search in which each state in the search space represents a (merged) model. The initial state represents the initial merged model Mi. In a goal state, the merged model is consistent.5 In order to reach a goal state, the search may

Evaluation

We have developed a prototype implementation of our approach and integrated it with IBM Rational Software Architect (RSA) (IBM, 2013) and use the existing merging functionality provided with IBM RSA for obtaining the initial merged model. IBM RSA uses the three-way merging approach which is compatible with our approach. It also uses the Model/Analyzer tool for checking inconsistencies (Reder and Egyed, 2010) (an implementation of Egyed, 2006). The prototype currently focuses on implementing the

Related work

There have been a range of techniques and tools proposed for differencing and merging models. For example, the work in Chen et al. (2004) focuses on identifying the changes between versions of a product line architecture and merging those changes to create a consolidated version. The approach in Abi-Antoun et al. (2006) is for differencing and merging generic architectural models that follow the traditional component-and-connector (C&C) view. However, they only address structural models and do

Conclusions and future work

This paper presented a novel approach for resolving syntactical and semantic inconsistencies in the merging of model versions. Our approach focuses on not only dealing with conflicts, which most existing work focuses on, but also detecting and avoiding syntactic and semantic inconsistencies arising in the merging process. We have proposed a search-based technique, which systematically explores model merging alternatives to compute the best merging solutions in terms of preserving consistency

Acknowledgments

Hoa Khanh Dam would like to thank Johannes Kepler University (JKU) for granting him a Visiting Research Fellowship Grant which supported his visit at JKU. Alexander Egyed, Alexander Reder, and Roberto E. Lopez-Herrejon acknowledge that this work was supported by the Austrian Science Fund (FWF): P 25289-N15.

Hoa Khanh Dam is a Senior Lecturer at the School of Computing and Information Technology, University of Wollongong, Australia. He holds a Ph.D. degree in Computer Science from RMIT University, Australia. His research has been published in the top venues in AI/intelligent agents (AAMAS, JAAMAS), software engineering (ICSE, ICSM, ER, JSS), and service-oriented computing (ICSOC, SCC, BPM). His work has also won multiple Best Paper Awards (at WICSA, APCCM, and ASWEC) and ACM SIGSOFT Distinguished

References (58)

  • BriandL.C. et al.

    Automated impact analysis of UML models

    J. Syst. Softw.

    (2006)
  • GuimarãesM.L. et al.

    Improving early detection of software merge conflicts

    Proceedings of the 2012 International Conference on Software Engineering

    (2012)
  • Abi-AntounM. et al.

    Differencing and merging of architectural views

    Proceedings of the 21st IEEE/ACM International Conference on Automated Software Engineering

    (2006)
  • BalzerR.

    Tolerating inconsistency

    Proceedings of the 13th International Conference on Software Engineering (ICSE’91)

    (1991)
  • BangJ.Y. et al.

    Codesign: a highly extensible collaborative software modeling framework

    Proceedings of the 32Nd ACM/IEEE International Conference on Software Engineering

    (2010)
  • BarteltC.

    Consistency preserving model merge in collaborative development processes

    Proceedings of the 2008 ICSE Workshop on Comparison and Versioning of Software Models

    (2008)
  • Bibliography on Comparison and Versioning of Software Models, 2014. http://pi.informatik.uni-siegen.de/CVSM/ (accessed...
  • BlancX. et al.

    Detecting model inconsistency through operation-based model construction

  • BroschP. et al.

    Towards semantics-aware merge support in optimistic model versioning

    Models in Software Engineering - Workshops and Symposia at MODELS 2011, Wellington, New Zealand, October 16–21, 2011, Reports and Revised Selected Papers

    (2012)
  • BroschP. et al.

    An introduction to model versioning

  • BrunY. et al.

    Early detection of collaboration conflicts and risks

    IEEE Trans. Softw. Eng.

    (2013)
  • ChenP. et al.

    Differencing and merging within an evolving product line architecture

  • CicchettiA. et al.

    Managing model conflicts in distributed development

    Proceedings of the 11th International Conference on Model Driven Engineering Languages and Systems

    (2008)
  • DamH.K. et al.

    Inconsistency resolution in merging versions of architectural models

    Proceedings of the 11th IEEE/IFIP Conference on Software Architecture

    (2014)
  • DamH.K. et al.

    Supporting change propagation in UML models

    Proceedings of the 26th IEEE International Conference on Software Maintenance

    (2010)
  • DamH.K. et al.

    An agent-oriented approach to change propagation in software maintenance

    J. Autonomous Agents Multi-Agent Syst.

    (2011)
  • DamK.H. et al.

    Cost-based BDI plan selection for change propagation

  • Eclipse, 2013a. EMF Compare. http://www.eclipse.org/emf/compare/ (accessed 11 March...
  • Eclipse, 2013b. EMF Diff/Merge. http://www.eclipse.org/diffmerge/ (accessed 11 March...
  • EgyedA.

    Instant consistency checking for the UML

    Proceedings of the 28th International Conference on Software Engineering

    (2006)
  • EgyedA.

    Fixing inconsistencies in UML models

    ICSE’07: Proceedings of the 29th International Conference on Software Engineering

    (2007)
  • EgyedA.

    Automatically detecting and tracking inconsistencies in software design models

    IEEE Trans. Softw. Eng.

    (2011)
  • EramoR. et al.

    A model-driven approach to automate the propagation of changes among architecture description languages.

    Softw. Syst. Model.

    (2012)
  • FeilerP.H. et al.

    The architecture analysis & design language (AADL): an introduction

    Technical Report

    (2006)
  • GerthC. et al.

    Detection and resolution of conflicting change operations in version management of process models

    Softw. Syst. Model.

    (2013)
  • GilsB.v.

    Application of semantic matching in enterprise application integration

    (2002)
  • GoeminneM. et al.

    A comparison of identity merge algorithms for software repositories

    Sci. Comput. Program.

    (2013)
  • GroherI. et al.

    Selective and consistent undoing of model changes

    Proceedings of the 13th International Conference on Model Driven Engineering Languages and Systems

    (2010)
  • HarmanM.

    The current state and future of search based software engineering

    2007 Future of Software Engineering

    (2007)
  • Cited by (24)

    • Automatic resolution of model merging conflicts using quality-based reinforcement learning

      2022, Journal of Computer Languages
      Citation Excerpt :

      There are some recent search-based proposals to resolve conflicts. In this context, Dam et al. [30] present an approach to consistently merge model versions. They define conflicting changes as state space and search for all the possible ways of resolving conflicts using a depth-first search algorithm.

    • UML models consistency management: Guidelines for software quality manager

      2016, International Journal of Information Management
    • A Formal Approach for Consistency Management in UML Models

      2023, International Journal of Software Engineering and Knowledge Engineering
    View all citing articles on Scopus

    Hoa Khanh Dam is a Senior Lecturer at the School of Computing and Information Technology, University of Wollongong, Australia. He holds a Ph.D. degree in Computer Science from RMIT University, Australia. His research has been published in the top venues in AI/intelligent agents (AAMAS, JAAMAS), software engineering (ICSE, ICSM, ER, JSS), and service-oriented computing (ICSOC, SCC, BPM). His work has also won multiple Best Paper Awards (at WICSA, APCCM, and ASWEC) and ACM SIGSOFT Distinguished Paper Award (at MSR).

    Alexander Egyed is a Full Professor and Chair for Software-Intensive Systems at the Johannes Kepler University, Austria. He received a Doctorate degree from the University of Southern California, USA. He was a post doc at the University College London, UK, and worked in industry for many years. He is most recognized for his work on software/systems modeling particularly on variability, consistency, and traceability. Dr. Egyed has published over 160 refereed scientific books, journals, and conferences with over 4000 citations to date. He was recognized as a top 1% scholar by the ACM and named an IBM Research Faculty Fellow.

    Michael Winikoff’s research interests concern notations for specifying and constructing software. In particular, he is interested in agent-oriented software engineering methodologies and is co-author of the book Developing Intelligent Agent Systems: A Practical Guide, published by John Wiley and Sons in 2004. Michael is head of the department of Information Science, at the University of Otago. Before moving to New Zealand he was a member of the agents group at RMIT university’s School of Computer Science and IT.

    Alexander Reder received his master’s degree in software engineering and Ph.D. degree in computer science from the Johannes Kepler University Linz in Austria, in 2009 and 2013 respectively. He is now working at voestalpine group-IT GmbH, Austria. His research interests include model driven engineering and consistency management in model based development.

    Roberto E. Lopez-Herrejon is currently a postdoctoral researcher at the Johannes Kepler University in Linz Austria. He has been a Lise Meitner Fellow (2012–2014) sponsored by the Austrian Science Fund (FWF), an Intra-European Marie Curie Fellow (2012–2014) sponsored by the European Union, and a Career Development Fellow (2005–2008) at the Software Engineering Centre of the University of Oxford, England. He obtained his Ph.D. from The University of Texas at Austin in 2006, funded in part by a Fulbright Fellowship. His expertise is software product lines, variability management, feature oriented software development, and search-based software engineering.

    View full text