Semantic Model Differencing

Syntactic Model Differencing

The majority of approaches in model differencing compare models based on their abstract syntax representation. While some of these approaches are targeted at a specific modeling language, such as UML (e.g., [1,10,11,12]), others are generic in the sense that they can be applied for arbitrary modeling languages by incorporating the modeling language’s metamodel for comparing models (e.g., [2,4]).

Syntactic differences between two models provide valuable and efficiently processable information, which is sufficient for several application domains. They, however, neglect semantic differences between two models. As pointed out by Maoz et al. [5], on the one side, models having only few syntactic differences may vary significantly in their semantics, and on the other side, models having many syntactic differences may be equivalent in terms of their semantics. Hence, syntactic differences can only approximate semantic differences among models. Therefore, techniques employing the semantics of modeling languages for comparing models are needed.

Semantic Model Differencing

Recently, major advances towards semantic model differencing have been made by Maoz et al., who proposed the semantic diff operators CDDiff [7] for UML class diagrams and ADDiff [6] for UML activity diagrams. These semantic diff operators have been implemented by translating UML models into dedicated semantic domains (for UML class diagrams Alloy was used, for UML activity diagrams SMV was used), implementing comparison algorithms in these semantic domains, and translating the comparison results back to UML.

In contrast to this translational approach applied for semantically comparing UML class and activity diagrams, we propose a semantic model differencing approach which utilizes the behavioral semantics specifications of modeling languages, which can be defined using existing semantics specification approaches (e.g., xMOF [8], Kermeta [9], DMM [3]). Such behavioral semantics specifications can be used for various application domains, such as model simulation, verification, and validation. We aim at reusing them also for semantic model differencing. In particular, we utilize the capability to execute models conform to the behavioral semantics specification and obtain execution traces. These execution traces constitute semantic interpretations of the models and can be leveraged to reason about the semantic differences among two models.

Our Approach: Semantic Differencing Based on Behavioral Semantics Specifications

Overview of our semantic differencing approach
Figure 1: Overview of our semantic differencing approach

An overview of our approach is depicted in Figure 1. It consists of three steps: syntactic matching, model execution, and semantic matching.

Syntactic Matching. In this step, syntactic correspondences between the two compared models M1 and M2 are identified based on syntactic match rules. This step corresponds to existing syntactic model differencing approaches.

Model Execution. In the model execution step, the two compared models are executed for relevant inputs and execution traces are obtained.

Semantic Matching. Based on these execution traces, the models are compared semantically according to semantic match rules and semantic correspondences are identified.

Our approach is generic in the sense that the semantic model differencing is done based on a modeling language’s behavioral semantics specification and, hence, can be applied for any modeling language. Furthermore, the semantic differencing is accomplished based on scenario-specific semantic match rules, which enables to define different semantic equivalence criteria depending on the intended usage of the compared models.

Implementation: Semantic Differencing Based on xMOF Behavioral Semantics Specifications

To show the feasibility of our semantic model differencing approach, we applied it to the semantics specification language xMOF. This enabled us to implement semantic diff operators for different modeling languages. In particular, we implemented semantic diff operators for conflict-free and terminating Petri nets, UML class diagrams, and UML activity diagrams.

With xMOF, the behavioral semantics of a modeling language is defined using UML activities and UML’s action language. xMOF enables to execute models according to these UML activities by utilizing the fUML virtual machine. From the model execution carried out by the fUML virtual machine it is possible to generate execution traces which can be used for semantic model differencing.
More information about xMOF and its model execution capabilities can be found here.

Resources

Eclipse Bundle
We prepared an Eclipse Bundle eclipse_semanticdiffing.zip (Eclipse Kepler, SR1, Windows 64 Bit) with readily installed plug-ins.

Example Project
Furthermore, we prepared an Eclipse test project  testproject_semanticdiffing.zip, which contains the semantics specifications as well as syntactic and semantic match rules for the following example modeling languages: Petri net language, UML class diagrams, and UML activity diagrams. Besides testing the output of the semantic model differencing for example models, the test project also generates performance reports.

Source Code
Our implementation is available at our source code repository.

For installation, the following plug-ins have to be installed:

References

[1] M. Alanen and I. Porres. Difference and union of models. In Proceedings of the International Conference on the Unified Modeling Language (UML’03), volume 2863 of LNCS, pages 2–17. Springer, 2003.

[2] C. Brun and A. Pierantonio. Model Differences in the Eclipse Modeling Framework. UPGRADE, The European Journal for the Informatics Professional, 9(2):29–34, 2008.

[3] G. Engels, J. H. Hausmann, R. Heckel, and S. Sauer. Dynamic Meta Modeling: A Graphical Approach to the Operational Semantics of Behavioral Diagrams in UML. In Proceedings of the 3rd International Conference on the Unified Modeling Language (UML’00), volume 1939 of LNCS, pages 323–337. Springer, 2000.

[4] Y. Lin, J. Gray, and F. Jouault. DSMDiff: a differentiation tool for domain-specific models. European Journal of Information Systems, 16(4):349–361, 2007.

[5] S. Maoz, J. O. Ringert, and B. Rumpe. A Manifesto for Semantic Model Differencing. In Models in Software Engineering, volume 6627 of LNCS, pages 194–203. Springer, 2011.

[6] S. Maoz, J. O. Ringert, and B. Rumpe. ADDiff: Semantic Differencing for Activity Diagrams. In Proceedings of the 19th ACM SIGSOFT Symposium and the 13th European Conference on Foundations of Software Engineering (ESEC/FSE’11), pages 179–189. ACM, 2011.

[7] S. Maoz, J. O. Ringert, and B. Rumpe. CDDiff: Semantic Differencing for Class Diagrams. In Proceedings of the European Conference on Object-oriented Programming (ECOOP’11), volume 6813 of LNCS, pages 230–254. Springer, 2011.

[8] T. Mayerhofer, P. Langer, M. Wimmer, and G. Kappel. xMOF: Executable DSMLs Based on fUML. In Proceedings of the 6th International Conference on Software Language Engineering (SLE’13), volume 8225 of LNCS, pages 56–75. Springer, 2013.

[9] P.-A. Muller, F. Fleurey, and J.-M. Jézéquel. Weaving Executability into Object-Oriented Meta-languages. In Proceedings of the 8th International Conference on Model Driven Engineering Languages and Systems (MoDELS’05), volume 3713 of LNCS, pages 264–278. Springer, 2005.

[10] D. Ohst, M. Welle, and U. Kelter. Differences Between Versions of UML Diagrams. SIGSOFT Software Engineering Notes, 28(5):227–236, Sept. 2003.

[11] H. Oliveira, L. Murta, and C. Werner. Odyssey-VCS: A Flexible Version Control System for UML Model Elements. In Proceedings of the 12th International Workshop on Software Configuration Management (SCM’05), pages 1–16. ACM, 2005.

[12] Z. Xing and E. Stroulia. UMLDiff: An Algorithm for Object-oriented Design Differencing. In Proceedings of the 20th IEEE/ACM International Conference on Automated Software Engineering (ASE’05), pages 54–65. ACM, 2005.

Publications

[bibtex file=http://modelexecution2.big.tuwien.ac.at/wp-content/uploads/publications/bibtex/tanja-bib.txt key=se2015,models2014,modelsposter2014]