A Graph-based Algorithm for Three-way Merging of Ordered Collections in EMF Models

Felix Schwägerl, Sabrina Uhrig, Bernhard Westfechtel

2014

Abstract

Version control for models is not yet supported in an adequate way. In this paper, we address three-way merging of model versions. Based on a common base version b, two alternative versions a1 and a2 were developed by copying and modifying the base version. To reconcile these changes, a merged version m is to be created as a common successor of a1 and a2. We present a graph algorithm to solve an important subproblem which occurs in three-way model merging: merging of (linearly) ordered collections. To create the merged version, a generalized topological sort is performed. Conflicts occur if the order of elements cannot be deduced automatically; these conflicts are resolved either interactively or by default rules. We have implemented the merge algorithm in our tool BTMerge, which performs a consistency-preserving merge of versions of EMF models being instances of arbitrary Ecore models. By taking arbitrary move operations into account, the algorithm considerably goes beyond the functionality of contemporary merge tools which are based on common subsequences and thus cannot adequately handle move operations.

References

  1. Alanen, M. and Porres, I. (2003). Difference and union of models. In Stevens, P., Whittle, J., and Booch, G., editors, UML 2003 - The Unified Modeling Language, Modeling Languages and Applications, 6th International Conference, volume 2863, pages 2-17, San Francisco, CA.
  2. Altmanninger, K., Schwinger, W., and Kotsis, G. (2010). Semantics for accurate conflict detection in smover: Specification, detection and presentation by example. International Journal of Enterprise Information Systems, 6(1):68-84.
  3. Altmanninger, K., Seidl, M., and Wimmer, M. (2009). A survey on model versioning approaches. International Journal of Web Information Systems (IJWIS), 5(3):271-304.
  4. Brun, C. and Pierantonio, A. (2008). Model differences in the eclipse modelling framework. UPGRADE, IX(2):29-34.
  5. Collins-Sussman, B., Fitzpatrick, B. W., and Pilato, C. M. (2004). Version Control with Subversion. O'Reilly & Associates, Sebastopol, CA.
  6. Förtsch, S. and Westfechtel, B. (2007). Differencing and merging of software diagrams - state of the art and challenges. In Filipe, J., Helfert, M., and Shishkov, B., editors, Proceedings of the Second International Conference on Software and Data Technologies (ICSOFT 2007), pages 90-99, Barcelona, Spain. INSTICC Press.
  7. Hunt, J. and Szymanski, T. (1977). A fast algorithm for computing longest common subsequences. Communications of the ACM, 20(5):350-353.
  8. Kelter, U., Wehren, J., and Niere, J. (2005). A generic difference algorithm for UML models. In Liggesmeyer, P., Pohl, K., and Goedicke, M., editors, Software Engineering 2005, pages 105-116.
  9. Khanna, S., Kunal, K., and Pierce, B. C. (2007). A formal investigation of diff3. In Arvind, V. and Prasad, S., editors, FSTTCS 2007: Foundations of Software Technology and Theoretical Computer Science, volume 4855 of Lecture Notes in Computer Science, pages 485-496, New Delhi, India.
  10. Koegel, M., Hermannsdoerfer, M., von Wesendonk, O., and Helming, J. (2010). Operation-based conflict detection. In di Ruscio, D. and Kolovos, D. S., editors, Proceedings of the 1st International Workshop on Model Comparison in Practice (IWMCP 2010), pages 21-30, Malaga, Spain.
  11. Lindholm, T. (2004). A three-way merge for XML documents. In Munson, E. V. and Vion-Dury, J.-Y., editors, Proceedings of the 2004 ACM Symposium on Document Engineering, pages 1-10.
  12. Mehra, A., Grundy, J. C., and Hosking, J. G. (2005). A generic approach to supporting diagram differencing and merging for collaborative design. In Redmiles, D. F., Ellman, T., and Zisman, A., editors, 20th IEEE/ACM International Conference on Automated Software Engineering (ASE 2005), pages 204-213.
  13. Schwägerl, F., Uhrig, S., and Westfechtel, B. (2013a). Demonstration of a tool for consistent three-way merging of EMF models. In Störrle, H., Carré, B., and Sahroui, H., editors, Proceedings of the Joint Track “Tools, Demos and Posters” of ECOOP, ECSA and ECMFA, 2013, pages 26-28, Building 321, DK-2800 Kongens Lyngby, Copenhagen, Denmark. Technical University of Denmark (DTU).
  14. Schwägerl, F., Uhrig, S., and Westfechtel, B. (2013b). Model-based tool support for consistent three-way merging of EMF models. In Kolovos, D. S., di Ruscio, D., and Rose, L., editors, Proceedings of the Workshop on ACadeMics Tooling with Eclipse, ACME 7813, pages 2:1-2:10, New York, NY, USA. ACM.
  15. Sedgewick, R. and Schidlowsky, M. (2003). Algorithms in Java, Part 5: Graph Algorithms. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 3 edition.
  16. Stahl, T. and Voelter, M. (2006). Model-Driven Software Development: Technology, Enginering, Management. John Wiley & Sons.
  17. Steinberg, D., Budinsky, F., Paternostro, M., and Merks, E. (2009). EMF - Eclipse Modeling Framework. The Eclipse Series. Addison-Wesley, Upper Saddle River, NJ, 2nd edition.
  18. Taentzer, G., Ermel, C., Langer, P., and Wimmer, M. (2012). A fundamental approach to model versioning based on graph modifications: Theory and implementation. SOSYM. Online First.
  19. Tichy, W. F. (1985). RCS - A system for version control. Software: Practice and Experience, 15(7):637-654.
  20. Uhrig, S. and Schwägerl, F. (2013). Tool support for the evaluation of matching algorithms in the Eclipse Modeling Framework. In Slimane Hammoudi, Luís Ferreira Pires, J. F. and das Neves, R. C., editors, Proceedings of the 1st International Conference on Model-Driven Engineering and Development (Modelsward 2013), pages 101-110, Barcelona, Spain. SCITEPRESS Science and Technology Publications, Portugal.
  21. van den Brand, M., Protic, Z., and Verhoeff, T. (2010). Generic tool for visualization of model differences. In Proceedings of the 1st International Workshop on Model Comparison in Practice, IWMCP 7810, pages 66-75, New York, NY, USA. ACM.
  22. Vesperman, J. (2006). Essential CVS. O'Reilly, Sebastopol, CA.
  23. Westfechtel, B. (2010). A formal approach to three-way merging of EMF models. In di Ruscio, D. and Kolovos, D. S., editors, Proceedings of the 1st International Workshop on Model Comparison in Practice (IWMCP 2010), pages 31-41, Malaga, Spain.
  24. Westfechtel, B. (2012). Merging of EMF models: Formal foundations. SOSYM. Online First.
  25. Xing, Z. and Stroulia, E. (2005). UMLDiff: an algorithm for object-oriented design differencing. In Redmiles, D. F., Ellman, T., and Zisman, A., editors, 20th IEEE/ACM International Conference on Automated Software Engineering (ASE 2005), pages 54-65.
  26. 2. Initialize the partition pm of the set of vertices Vm. At the beginning, it contains only one set, a copy Cm0 of Vm. pm := fCm0g.
  27. 3. While D 6= 0/ , perform the following steps:
Download


Paper Citation


in Harvard Style

Schwägerl F., Uhrig S. and Westfechtel B. (2014). A Graph-based Algorithm for Three-way Merging of Ordered Collections in EMF Models . In Proceedings of the 2nd International Conference on Model-Driven Engineering and Software Development - Volume 1: MODELSWARD, ISBN 978-989-758-007-9, pages 41-54. DOI: 10.5220/0004702100410054


in Bibtex Style

@conference{modelsward14,
author={Felix Schwägerl and Sabrina Uhrig and Bernhard Westfechtel},
title={A Graph-based Algorithm for Three-way Merging of Ordered Collections in EMF Models},
booktitle={Proceedings of the 2nd International Conference on Model-Driven Engineering and Software Development - Volume 1: MODELSWARD,},
year={2014},
pages={41-54},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0004702100410054},
isbn={978-989-758-007-9},
}


in EndNote Style

TY - CONF
JO - Proceedings of the 2nd International Conference on Model-Driven Engineering and Software Development - Volume 1: MODELSWARD,
TI - A Graph-based Algorithm for Three-way Merging of Ordered Collections in EMF Models
SN - 978-989-758-007-9
AU - Schwägerl F.
AU - Uhrig S.
AU - Westfechtel B.
PY - 2014
SP - 41
EP - 54
DO - 10.5220/0004702100410054