Software & Systems Modeling

, Volume 18, Issue 2, pp 995–1016 | Cite as

Model clone detection for rule-based model transformation languages

  • Daniel StrüberEmail author
  • Vlad Acreţoaie
  • Jennifer Plöger
Special Section Paper


Cloning is a convenient mechanism to enable reuse across and within software artifacts. On the downside, it is also a practice related to severe long-term maintainability impediments, thus generating a need to identify clones in affected artifacts. A large variety of clone detection techniques have been proposed for programming and modeling languages; yet no specific ones have emerged for model transformation languages. In this paper, we explore clone detection for rule-based model transformation languages, including graph-based ones, such as Henshin, and hybrid ones, such as ATL. We introduce use cases for such techniques in the context of constructive and analytical quality assurance, and a set of key requirements we derived from these use cases. To address these requirements, we describe our customization of existing model clone detection techniques: We consider eScan, an a-priori-based technique, ConQAT, a heuristic technique, and a hybrid technique based on a combination of eScan and ConQAT. We compare these techniques in a comprehensive experimental evaluation, based on three realistic Henshin rule sets, and a comprehensive body of examples from the ATL transformation zoo. Our results indicate that our customization of ConQAT enables the efficient detection of the considered clones, without sacrificing accuracy. With our contributions, we present the first evidence on the usefulness of model clone detection for the quality assurance of model transformations and pave the way for future research efforts at the intersection of model clone detection and model transformation.


Quality assurance Model clone detection Model transformation ATL Henshin 



We thank the reviewers for their valuable and constructive suggestions. This research was partially supported by the research project Visual Privacy Management in User Centric Open Environments (supported by the EUs Horizon 2020 programme, Proposal Number: 653642).


  1. 1.
    Sendall, S., Kozaczynski, W.: Model transformation: the heart and soul of model-driven software development. IEEE Softw. 20(5), 42–45 (2003)CrossRefGoogle Scholar
  2. 2.
    Glass, R.L.: Frequently forgotten fundamental facts about software engineering. IEEE Softw. 3, 110–112 (2001)Google Scholar
  3. 3.
    Koschke, R.: Survey of research on software clones. In: Dagstuhl Seminar 06301: Duplication, Redundancy, and Similarity in Software. GI 24 (2007)Google Scholar
  4. 4.
    Fowler, M.: Refactoring: Improving the Design of Existing Code. Addison-Wesley Professional, Boston (2002)CrossRefzbMATHGoogle Scholar
  5. 5.
    Kim, M., Sazawal, V., Notkin, D., Murphy, G.: An empirical study of code clone genealogies. In: ACM SIGSOFT Software Engineering Notes, vol. 30, pp. 187–196. ACM (2005)Google Scholar
  6. 6.
    Roy, C.K., Cordy, J.R., Koschke, R.: Comparison and evaluation of code clone detection techniques and tools: a qualitative approach. Sci. Comput. Program. 74(7), 470–495 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
  7. 7.
    Rattan, D., Bhatia, R., Singh, M.: Software clone detection: a systematic review. Inf. Softw. Technol. 55(7), 1165–1199 (2013)CrossRefGoogle Scholar
  8. 8.
    Kusel, A., Schönböck, J., Wimmer, M., Kappel, G., Retschitzegger, W., Schwinger, W.: Reuse in model-to-model transformation languages: are we there yet? Softw. Syst. Model. 14(2), 537–572 (2013)CrossRefGoogle Scholar
  9. 9.
    Czarnecki, K., Helsen, S.: Classification of model transformation approaches. In: Proceedings of the 2nd OOPSLA Workshop on Generative Techniques in the Context of the Model Driven Architecture, USA, vol. 45, pp. 1–17 (2003)Google Scholar
  10. 10.
    Mens, T., Gorp, P.V.: A taxonomy of model transformation. Electron. Notes Theor. Comput. Sci. 152, 125–142 (2006)CrossRefGoogle Scholar
  11. 11.
    Strüber, D., Rubin, J., Arendt, T., Chechik, M., Taentzer, G., Plöger, J.: RuleMerger: automatic construction of variability-based model transformation rules. In: International Conference on Fundamental Approaches to Software Engineering, pp. 122–140. Springer, Berlin (2016)Google Scholar
  12. 12.
    Strüber, D., Plöger, J., Acretoaie, V.: Clone detection for graph-based model transformation languages. In: Proceedings of the International Conference on the Theory and Practice of Model Transformations (ICMT), pp. 191–206. Springer (2016)Google Scholar
  13. 13.
    Brambilla, M., Cabot, J., Wimmer, M.: Model-driven software engineering in practice. Synth. Lect. Softw. Eng. 1(1), 1–182 (2012)CrossRefGoogle Scholar
  14. 14.
    Arendt, T., Biermann, E., Jurack, S., Krause, C., Taentzer, G.: Henshin: advanced concepts and tools for in-place EMF model transformations. In: International Conference on Model Driven Engineering Languages and Systems, pp. 121–135. Springer (2010)Google Scholar
  15. 15.
    Strüber, D., Born, K., Gill, K.D., Groner, R., Kehrer, T., Ohrndorf, M., Tichy, M.: Henshin: A usability-focused framework for EMF model transformation development. In: International Conference on Graph Transformation, pp. 196–208 (2017)Google Scholar
  16. 16.
    Jouault, F., Kurtev, I.: Transforming models with ATL. In: Satellite Events at the MoDELS 2005 Conference, Revised Selected Papers, pp. 128–138. Springer (2005)Google Scholar
  17. 17.
    Alalfi, M.H., Cordy, J.R., Dean, T.R., Stephan, M., Stevenson, A.: Models are code too: near-miss clone detection for Simulink models. In: International Conference on Software Maintenance, pp. 295–304. IEEE (2012)Google Scholar
  18. 18.
    Wimmer, M., Kappel, G., Kusel, A., Retschitzegger, W., Schönböck, J., Schwinger, W., Kolovos, D.S., Paige, R.F., Lauder, M., Schürr, A., et al.: Surveying rule inheritance in model-to-model transformation languages. J. Object Technol. 11(2), 1–46 (2012)Google Scholar
  19. 19.
    Anjorin, A., Saller, K., Lochau, M., Schürr, A.: Modularizing triple graph grammars using rule refinement. In: International Conference on Fundamental Approaches to Software Engineering, pp. 340–354. Springer (2014)Google Scholar
  20. 20.
    Strüber, D., Rubin, J., Chechik, M., Taentzer, G.: A variability-based approach to reusable and efficient model transformations. In: International Conference on Fundamental Approaches to Software Engineering, pp. 283–298. Springer (2015)Google Scholar
  21. 21.
    Nguyen, H.A., Nguyen, T.T., Pham, N.H., Al-Kofahi, J., Nguyen, T.N.: Clone management for evolving software. IEEE Trans. Softw. Eng. 38(5), 1008–1026 (2012)CrossRefGoogle Scholar
  22. 22.
    Narasimhan, K., Reichenbach, C.: Copy and paste redeemed. In: International Conference on Automated Software Engineering, pp. 630–640. IEEE (2015)Google Scholar
  23. 23.
    Stephan, M., Cordy, J.R.: Model-driven evaluation of software architecture quality using model clone detection. In: International Conference on Software Quality, Reliability and Security, pp. 92–99. IEEE (2016)Google Scholar
  24. 24.
    Stephan, M., Cordy, J.R.: Identification of Simulink model antipattern instances using model clone detection. In: International Conference on Model Driven Engineering Languages and Systems, pp. 276–285. IEEE (2015)Google Scholar
  25. 25.
    Stephan, M., Cordy, J.R.: Identifying instances of model design patterns and antipatterns using model clone detection. In: International Workshop on Modeling in Software Engineering, pp. 48–53. IEEE (2015)Google Scholar
  26. 26.
    Lano, K., Kolahdouz-Rahimi, S.: Model-transformation design patterns. IEEE Trans. Softw. Eng. 40(12), 1224–1259 (2014)CrossRefGoogle Scholar
  27. 27.
    Blouin, D., Plantec, A., Dissaux, P., Singhoff, F., Diguet, J.P.: Synchronization of models of rich languages with triple graph grammars: an experience report. In: International Conference on Model Transformation, pp. 106–121. Springer (2014)Google Scholar
  28. 28.
    Strüber, D.: Model-driven engineering in the large: refactoring techniques for models and model transformation systems. Ph.D. thesis, Philipps-Universität Marburg (2016)Google Scholar
  29. 29.
    Heckel, R., Küster, J.M., Taentzer, G.: Confluence of typed attributed graph transformation systems. In: International Conference on Graph Transformation, pp. 161–176. Springer (2002)Google Scholar
  30. 30.
    Habel, A., Heckel, R., Taentzer, G.: Graph grammars with negative application conditions. Fundamenta Informaticae 26(3/4), 287–313 (1996)MathSciNetzbMATHGoogle Scholar
  31. 31.
    Strüber, D., Rubin, J., Arendt, T., Chechik, M., Taentzer, G., Plöger, J.: Variability-based model transformation: formal foundation and application. Formal Aspects Comput. (2017) (accepted)Google Scholar
  32. 32.
    Ehrig, H., Golas, U., Habel, A., Lambers, L., Orejas, F.: M-adhesive transformation systems with nested application conditions. Part 1: parallelism, concurrency and amalgamation. Math. Struct. Comput. Sci. 24(04), 240406 (2014)MathSciNetCrossRefzbMATHGoogle Scholar
  33. 33.
    Beller, M., Zaidman, A., Karpov, A.: The last line effect. In: International Conference on Program Comprehension, pp. 240–243. IEEE Press (2015)Google Scholar
  34. 34.
    Bauer, J., Boneva, I., Kurbán, M.E., Rensink, A.: A modal-logic based graph abstraction. In: International Conference on Graph Transformation, pp. 321–335. Springer (2008)Google Scholar
  35. 35.
    Cuadrado, J.S., Guerra, E., De Lara, J.: Generic model transformations: write once, reuse everywhere. In: International Conference on Model Transformation, pp. 62–77 (2011)Google Scholar
  36. 36.
    Störrle, H.: Towards clone detection in UML domain models. J. Softw. Syst. Model. 12(2), 307–329 (2013)Google Scholar
  37. 37.
    Tichy, M., Krause, C., Liebel, G.: Detecting performance bad smells for Henshin model transformations. AMT workshop, vol. 1077 (2013)Google Scholar
  38. 38.
    Störrle, H.: On the impact of layout quality to understanding UML diagrams: size matters. In: International Conference on Model Driven Engineering Languages and Systems, pp. 518–534. Springer (2014)Google Scholar
  39. 39.
    Yan, X., Han, J.: gSpan: graph-based substructure pattern mining. In: ICDM’03, pp. 721–724. IEEE (2002)Google Scholar
  40. 40.
    Pham, N.H., Nguyen, H.A., Nguyen, T.T., Al-Kofahi, J.M., Nguyen, T.N.: Complete and accurate clone detection in graph-based models. In: International Conference on Software Engineering, pp. 276–286. IEEE (2009)Google Scholar
  41. 41.
    Deissenboeck, F., Hummel, B., Jürgens, E., Schätz, B., Wagner, S., Girard, J., Teuchert, S.: Clone detection in automotive model-based development. In: International Conference on Software Engineering, pp. 603–612. ACM (2008)Google Scholar
  42. 42.
    Deissenboeck, F., Hummel, B., Jürgens, E., Pfaehler, M., Schaetz, B.: Model clone detection in practice. In: Ws. on Software Clones, pp. 57–64. ACM (2010)Google Scholar
  43. 43.
    Arendt, T., Habel, A., Radke, H., Taentzer, G.: From core OCL invariants to nested graph constraints. In: International Conference on Graph Transformation, pp. 97–112. Springer (2014)Google Scholar
  44. 44.
    Bürdek, J., Kehrer, T., Lochau, M., Reuling, D., Kelter, U., Schürr, A.: Reasoning about product-line evolution using complex feature model differences. J. Autom. Softw. Eng. 23(4), 1–47 (2015)Google Scholar
  45. 45.
    Strüber, D., Kehrer, T., Arendt, T., Pietsch, C., Reuling, D.: Scalability of model transformations: position paper and benchmark set. In: Workshop on Scalable Model Driven Engineering, pp. 21–30 (2016)Google Scholar
  46. 46.
    Schaeffer, S.E.: Graph clustering. Comput. Sci. Rev. 1(1), 27–64 (2007)CrossRefzbMATHGoogle Scholar
  47. 47.
    Babur, Ö., Cleophas, L., van den Brand, M.: Hierarchical clustering of metamodels for comparative analysis and visualization. In: European Conference on Modelling Foundations and Applications, pp. 3–18 (2016)Google Scholar
  48. 48.
    Strüber, D., Schulz, S.: A tool environment for managing families of model transformation rules. In: International Conference on Graph Transformation. Springer (2016)Google Scholar
  49. 49.
    Wohlin, C., Runeson, P., Höst, M., Ohlsson, M.C., Regnell, B.: Experimentation in Software Engineering. Springer, Berlin (2012)CrossRefzbMATHGoogle Scholar
  50. 50.
    Taentzer, G.: AGG: A graph transformation environment for modeling and validation of software. In: International Workshop on Applications of Graph Transformations with Industrial Relevance, pp. 446–453. Springer (2003)Google Scholar
  51. 51.
    Balasubramanian, D., Narayanan, A., van Buskirk, C.P., Karsai, G.: The graph rewriting and transformation language: GReAT. In: ECEASST, vol. 1 (2006)Google Scholar
  52. 52.
    Levendovszky, T., Lengyel, L., Mezei, G., Charaf, H.: A systematic approach to metamodeling environments and model transformation systems in VMTS. Electron. Notes Theor. Comput. Sci. 127(1), 65–75 (2005)CrossRefGoogle Scholar
  53. 53.
    Fischer, T., Niere, J., Torunski, L., Zündorf, A.: Story diagrams: A new graph rewrite language based on the unified modeling language and java. In: International Workshop on Theory and Application of Graph Transformations, pp. 296–309. Springer (1998)Google Scholar
  54. 54.
    Störrle, H.: Effective and efficient model clone detection. In: Software, Services, and Systems, pp. 440–457. Springer (2015)Google Scholar
  55. 55.
    Ekanayake, C.C., Dumas, M., García-Bañuelos, L., La Rosa, M., ter Hofstede, A.H.: Approximate clone detection in repositories of business process models. In: Business Process Management, pp. 302–318. Springer (2012)Google Scholar
  56. 56.
    Liang, Z., Cheng, Y., Chen, J.: A novel optimized path-based algorithm for model clone detection. J. Softw. 9(7), 1810–1817 (2014)Google Scholar
  57. 57.
    Tairas, R., Cabot, J.: Cloning in DSLs: experiments with OCL. In: International Conference on Software Language Engineering, pp. 60–76. Springer (2011)Google Scholar
  58. 58.
    Cordy, J.R.: Submodel pattern extraction for simulink models. In: International Software Product Line Conference, pp. 7–10. ACM (2013)Google Scholar
  59. 59.
    Rapos, E.J., Stevenson, A., Alalfi, M.H., Cordy, J.R.: SimNav: Simulink navigation of model clone classes. In: International Working Conference on Source Code Analysis and Manipulation, pp. 241–246. IEEE Computer Society (2015)Google Scholar
  60. 60.
    Stephan, M., Alalfi, M.H., Stevenson, A., Cordy, J.R.: Towards qualitative comparison of simulink model clone detection approaches. In: International Workshop on Software Clones, pp. 84–85. IEEE (2012)Google Scholar
  61. 61.
    Stephan, M.: Model clone detector evaluation using mutation analysis. In: International Conference on Software Maintenance and Evolution, pp. 633–638. IEEE (2014)Google Scholar
  62. 62.
    Van Amstel, M.F., Van Den Brand, M.G.: Model transformation analysis: staying ahead of the maintenance nightmare. In: International Conference on Model Transformation, pp. 108–122. Springer (2011)Google Scholar
  63. 63.
    Kapová, L., Goldschmidt, T., Becker, S., Henss, J.: Evaluating maintainability with code metrics for model-to-model transformations. In: Research into Practice–Reality and Gaps, pp. 151–166. Springer (2010)Google Scholar
  64. 64.
    Wimmer, M., Perez, S.M., Jouault, F., Cabot, J.: A catalogue of refactorings for model-to-model transformations. J. Object Technol. 11(2), 1–40 (2012)Google Scholar
  65. 65.
    Gerpheide, C.M., Schiffelers, R.R., Serebrenik, A.: Assessing and improving quality of QVTo model transformations. Softw. Qual. J. 24(3), 1–38 (2014)Google Scholar
  66. 66.
    Alkhazi, B., Ruas, T., Kessentini, M., Wimmer, M., Grosky, W.I.: Automated refactoring of ATL model transformations: a search-based approach. In: International Conference on Model Driven Engineering Languages and Systems, pp. 295–304. ACM (2016)Google Scholar
  67. 67.
    Strüber, D.: Generating efficient mutation operators for search-based model-driven engineering. In: International Conference on Model Transformation, pp. 121–137 (2017)Google Scholar

Copyright information

© Springer-Verlag GmbH Germany 2017

Authors and Affiliations

  • Daniel Strüber
    • 1
    • 2
    Email author
  • Vlad Acreţoaie
    • 3
    • 4
  • Jennifer Plöger
    • 2
  1. 1.University of Koblenz and LandauKoblenzGermany
  2. 2.Philipp University of MarburgMarburgGermany
  3. 3.Technical University of DenmarkKgs. LyngbyDenmark
  4. 4.ConfigitCopenhagenDenmark

Personalised recommendations