Skip to main content
Log in

MUPPIT: a method for using proper patterns in model transformations

  • Regular Paper
  • Published:
Software and Systems Modeling Aims and scope Submit manuscript

Abstract

Model transformation plays an important role in developing software systems using the model-driven engineering paradigm. Examples of applications of model transformation include forward engineering, reverse engineering of code into models, and refactoring. Poor-quality model transformation code is costly and hard to maintain. There is a need to develop techniques and tools that can support transformation engineers in designing high-quality model transformations. The goal of this paper is to present a process, called MUPPIT (method for using proper patterns in model transformations), which can be used by transformation engineers to improve the quality of model transformations by detecting anti-patterns in the transformations and automatically applying pattern solutions. MUPPIT consists of four phases: (1) identifying a transformation anti-pattern, (2) proposing a pattern-solution, (3) applying the pattern-solution, and (4) evaluating the transformation model. MUPPIT takes a transformation design model (TDM), which is a representation of the given transformation, to search for the presence of an anti-pattern of interest. If found, MUPPIT proposes a pattern solution from a catalogue of patterns to the transformation engineer. The application of the pattern solution results in the restructuring of the TDM. While MUPPIT, as a process, is independent of any transformation language and transformation engineering framework, we have implemented an instance of it as a tool using transML and MeTAGeM, which support exogenous transformations using rule-based transformation and OCL-based languages such as ATL and ETL. We evaluate MUPPIT through a number of case studies in which we show how MUPPIT can detect four anti-patterns and propose the corresponding pattern solutions. We also evaluate MUPPIT by collecting a number of metrics to assess the quality of the resulting transformations. The results show that MUPPIT optimizes the transformations by improving reusability, modularity, simplicity, and maintainability, as well as decreasing the complexity. MUPPIT can help transformation engineers to produce high-quality transformations using a pattern-based approach. An immediate future direction would be to experiment with more anti-patterns and pattern solutions. Moreover, we need to implement MUPPIT using other transformation engineering frameworks.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21

Similar content being viewed by others

Notes

  1. Cuadrado et al. [12] believe that any can be used instead of select.first() command in ATL whenever we are looking an object up with a unique attribute. For the ATL language, they implement a fixed any version as well to improve the performance more. However, the current paper employs the original version of any in ATL. We checked the Epsilon language and identified that any is shortcut as soon as an element validating condition is found. Therefore, it is a well-defined iterator in contrast to the select command in Return-First Command. More detail about any syntax in Epsilon can be found in [36].

  2. Boat Anchor is a known anti-pattern in traditional software development, which refers to a piece of software that serves no useful purpose in the current project [31].

  3. Architectural model transformation patterns address solutions to the organizing of transformations systems in order to enhance the modularity, verifiability and efficiency of these systems [13].

  4. https://www.eclipse.org/emf/compare/.

  5. http://www.transformation-tool-contest.eu/2014/solutions_fixml.html.

  6. https://git.eclipse.org/c/emf/org.eclipse.emf.git/tree/plugins/org.eclipse.emf.ecore/model/Ecore.ecore.

  7. ATLAS Transformation Language.

  8. Query/View/Transformation.

  9. https://www.eclipse.org/emf-refactor/.

  10. https://www.eclipse.org/epsilon/doc/epl/.

  11. https://www.eclipse.org/epsilon/doc/etl/.

References

  1. Selic, B.: The pragmatics of model-driven development. IEEE Softw. 20(5), 19–25 (2003)

    Article  Google Scholar 

  2. Brown, A.W., Iyengar, S., Johnston, S.: A rational approach to model-driven development. IBM Syst. J. 45(3), 463–480 (2006)

    Article  Google Scholar 

  3. Guerra, E., de Lara, J., Kolovos, D.S., Paige, R.F., dos Santos, O.M.: Engineering model transformations with transML. Softw. Syst. Model. (SoSyM) 12(3), 555–577 (2013)

    Article  Google Scholar 

  4. Bzivin, J., Farcet, N., Jezequel, J.-M., Langlois, B., Pollet, D.: Reflective model driven engineering. In: UML2003—The Unified Modeling Language. Modeling Languages and Applications, vol. 2863, pp. 175–189. Springer, Berlin Heidelberg (2003)

  5. Kusel, A.: TROPIC-a framework for building reusable transformation components. In: Proceedings of the Doctoral Symposium at MODELS, pp. 22–27

  6. Bollati, V.A., Vara, J.M., Jimenez, A., Marcos, E.: Applying MDE to the (semi-)automatic development of model transformations. Inform. Softw. Technol. 55(4), 699–718 (2013)

    Article  Google Scholar 

  7. Ergin, H., Syriani, E., Gray, J.: Design pattern oriented development of model transformations. Comput. Lang. Syst. Struct. 46, 106–139 (2016)

    Google Scholar 

  8. Eddine Mokaddem, C., Sahraoui, H., Syriani, E.: Towards rule-based detection of design patterns in model transformations. In: System Analysis and Modeling. Technology-Specific Aspects of Models, pp. 211–225. Springer International Publishing

  9. Bzivin, J., Jouault, F., Palies, J.: Towards model transformation design patterns. In: Proceedings of the 1th European Workshop on Model Transformations (EWMT 2005). ATLAS group (2005)

  10. Agrawal, A., Vizhanyo, A., Kalmar, Z., Shi, F., Narayanan, A., Karsai, G.: Reusable idioms and patterns in graph transformation languages. Electron. Notes Theor. Comput. Sci. 127(1), 181–192 (2005)

    Article  Google Scholar 

  11. Iacob, M.-E., Steen, M.W.A., Heerink, L.: Reusable model transformation patterns. In: Enterprise Distributed Object Computing Conference Workshops, 2008 12th, pp. 1–10. IEEE (2008)

  12. Cuadrado, J.S., Jouault, F., Garcia Molina, J., Bzivin, J.: Optimization Patterns for OCL-Based Model Transformations, vol. 5421, pp. 273–284. Springer, Berlin Heidelberg (2009)

    Google Scholar 

  13. Lano, K., Kolahdouz-Rahimi, S.: Model-transformation design patterns. IEEE Trans. Softw. Eng. 40(12), 1224–1259 (2014)

    Article  Google Scholar 

  14. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Pearson Education, London (1994)

    MATH  Google Scholar 

  15. Fowler, Martin: Analysis Patterns: Reusable Object Models. Addison-Wesley, Boston (1997)

    Google Scholar 

  16. Lano, K., Kolahdouz-Rahimi, S.: Optimising model-transformations using design patterns. In: International Conference on Model-Driven Engineering and Software Development (MODELSWARD), pp. 77–82. SciTePress (2013)

  17. Panahandeh, M.S., Zamani, B.: Automatic pattern proposition in transformation life cycle. Int. J. Inf. Technol. Syst. Approach (IJITSA) 10(2), 1–16 (2017)

    Article  Google Scholar 

  18. Ergin, H., Syriani, E.: Towards a Language for Graph-Based Model Transformation Design Patterns, vol. 8568, pp. 91–105. Springer, Berlin (2014)

    Google Scholar 

  19. Lano, K., Kolahdouz-Rahimi, S., Poernomo, I., Terrell, J., Zschaler, S.: Correct-by-construction synthesis of model transformations using transformation patterns. Softw. Syst. Model. (SoSyM) 13(2), 873–907 (2014)

    Article  Google Scholar 

  20. Ergin, H.: Design Pattern Driven Development of Model Transformations. PhD Thesis, University of Alabama, Alabama, USA (2017)

  21. Guerra, E., de Lara, J., Kolovos, D.S., Paige, R.F., dos Santos, O.M.: transML: A Family of Languages to Model Model Transformations, vol. 6394, pp. 106–120. Springer, Berlin Heidelberg (2010)

    Google Scholar 

  22. Jiménez, Á., Vara, J.M., Bollati, V.A., Marcos, E.: MeTAGeM-Trace: improving trace generation in model transformation by leveraging the role of transformation models. Sci. Comput. Program. 98, 3–27 (2015)

    Article  Google Scholar 

  23. Lano, K., Kolahdouz-Rahimi, S.: Specification and verification of model transformations using UML-RSDS. In: International Conference on Integrated Formal Methods, pp. 199–214. Springer (2010)

  24. Del Fabro, M.D., Valduriez, P.: Towards the efficient development of model transformations using model weaving and matching transformations. Softw. Syst. Model. (SoSyM) 8(3), 305–324 (2009)

    Article  Google Scholar 

  25. Kolovos, D.S., Rose, R., Garca-Domnguez, A., Paige, R.: The Epsilon Book. Eclipse, Amman (2018)

    Google Scholar 

  26. Bzivin, J.: Model Driven Engineering: An Emerging Technical Space, vol. 4143, pp. 36–64. Springer, Berlin Heidelberg (2006)

    Google Scholar 

  27. Siikarla, M., Laitkorpi, M., Selonen, P., Systa, T.: Transformations Have to be Developed ReST Assured, vol. 5063, pp. 1–15. Springer, Berlin Heidelberg (2008)

    Google Scholar 

  28. Kolahdouz-Rahimi, S., Lano, K.: A Model-Based Development Approach for Model Transformations, vol. 7141, pp. 48–63. Springer, Berlin Heidelberg (2011)

    MATH  Google Scholar 

  29. Schmidt, D.C.: Model-driven engineering. Comput. IEEE Comput. Soc. 39(2), 25 (2006)

    Article  Google Scholar 

  30. Brown, A.W.: Model driven architecture: principles and practice. Softw. Syst. Model. (SoSyM) 3(4), 314–327 (2004)

    Google Scholar 

  31. Brown, W.J., Malveau, R.C., McCormick, H.W., Mowbray, T.J.: AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis. ITPro collection. Wiley, Hoboken (1998)

    Google Scholar 

  32. Tahir, A., Yamashita, A., Licorish, S., Dietrich, J., Counsell, S.: Can you tell me if it smells? A study on how developers discuss code smells and anti-patterns in stack overflow. In: Proceedings of the 22nd International Conference on Evaluation and Assessment in Software Engineering 2018, pp. 68–78 (2018)

  33. Martin Fowler, D.R.J.B.W.O.K.B., Becker, P., Fowler, M., Beck, K., Shanklin, J.C.: Addison-Wesley, E. Gamma, Safari Tech Books Online (Online service). Brant, J., Opdyke, W.., et al.: Refactoring: Improving the Design of Existing Code. Addison-Wesley object technology series. Addison-Wesley (1999)

  34. Brown, W.H., Malveau, R.C., McCormick, H.W., Mowbray, T.J.: AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis. Wiley, Hoboken (1998)

    Google Scholar 

  35. Warmer, J.B., Kleppe, A.G.: The Object Constraint Language: Getting Your Models Ready for MDA. Addison-Wesley, Boston (2003)

    Google Scholar 

  36. Begaudeau, T.: Acceleo/OCL operations reference. Available at https://wiki.eclipse.org/Acceleo/OCL_Operations_Reference (2019/04/1)

  37. Cabot, J., Clariso, R., Guerra, E., de Lara, J.: Verification and validation of declarative model-to-model transformations through invariants. J. Syst. Softw. 83(2), 283–302 (2010)

    Article  Google Scholar 

  38. Steinberg, D., Budinsky, F., Paternostro, M., Merks, E.: EMF: Eclipse Modeling Framework. Pearson Education, London (2008)

  39. Kolahdouz-Rahimi, S.: A comparative study of model transformation approaches through a systematic procedural framework and goal question metrics paradigm. PhD Thesis, King’s College London (University of London) (2013)

  40. Opdyke, W.F.: Refactoring object-oriented frameworks. PhD Thesis, University of Illinois at Urbana-Champaign Champaign, IL, USA (1992)

  41. Wimmer, M., Perez, S.M., Jouault, F., Cabot, J.: A catalogue of refactorings for model-to-model transformations. J. Object Technol. 11(22), 1–2 (2012)

    Google Scholar 

  42. Hoyos, H., Chavarriaga, J., Gomez, P.: Solving the fixml case study using epsilon and java. In: Proceedings of the 7th Transformation Tool Contest, pp. 87–92. Part of the Software Technologies: Applications and Foundations (STAF 2014) Federation of Conferences (2014)

  43. Lano, K., Maroukian, K., Tehrani, S.Y.: Case study: FIXML to Java, C# and C++. In TTC@ STAF, pp. 2–6 (2014)

  44. Krikava, F., Collet, P.: Solving the TTC’14 FIXML case study with SIGMA. In: TTC@ STAF (2014)

  45. Krikava, F., Collet, P., France, R.: Manipulating models using internal domain-specific languages. In: 29th Annual ACM Symposium on Applied Computing, pp. 2–6 (2014)

  46. Westfechtel, B.: Case-based exploration of bidirectional transformations in QVT relations. Softw. Syst. Model. (SoSyM) 17(3), 989–1029 (2018)

    Article  Google Scholar 

  47. Ergin, H., Syriani, E.: A unified template for model transformation design patterns. In: PAME@ STAF pp. 27–30 (2015)

  48. Lano, K., Kolahdouz-Rahimi, S., Yassipour-Tehrani, S., Sharbaf, M.: A survey of model transformation design pattern usage. In: Theory and Practice of Model Transformation, pp. 108–118. Springer International Publishing (2017)

  49. Lano, K., Kolahdouz-Rahimi, S., Yassipour-Tehrani, S., Sharbaf, M.: A survey of model transformation design patterns in practice. J. Syst. Softw. 140, 48–73 (2018)

    Article  Google Scholar 

  50. Fontana, F.A., Zanoni, M.: A tool for design pattern detection and software architecture reconstruction. Inf. Sci. 181(7), 1306–1324 (2011)

    Article  Google Scholar 

  51. Albin-Amiot, H., Cointe, P., Guéhéneuc, Y.-G., Jussien, N.: Instantiating and detecting design patterns: putting bits and pieces together. In: Proceedings 16th Annual International Conference on Automated Software Engineering (ASE 2001), pp. 166–173. IEEE (2001)

  52. Lano, K., Kolahdouz-Rahimi, S.: Design patterns for model transformations. In: The 6th International Conference on Software Engineering Advances, pp. 263–268. IARIA (2011)

  53. Taentzer, G., Arendt, T., Ermel, C., Heckel, R.: Towards refactoring of rule-based, in-place model transformation systems. In: Proceedings of the First Workshop on the Analysis of Model Transformations, pp. 41–46 (2012)

  54. Tichy, M., Krause, C., Liebel, G.: Detecting performance bad smells for Henshin model transformations. Amt@ models, p. 1077 (2013)

  55. Kolahdouz-Rahimi, S.: Model transformation specification in UML-RSDS. In: ICST PhD Symposium (2010)

  56. Lano, K.: Agile model-based development using UML-RSDS. CRC Press, Boca Raton (2017)

    Book  Google Scholar 

  57. Lano, K.: A compositional semantics of UML-RSDS. Softw. Syst. Model. (SoSyM) 8(1), 85–116 (2009)

    Article  Google Scholar 

  58. 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)

  59. Hojaji, F., Zamani, B., Hamou-Lhadj, A., Mayerhofer, T., Bousse, E.: Lossless compaction of model execution traces. Softw. Syst. Model. (SoSyM) 19(1), 199–230 (2019)

    Article  Google Scholar 

  60. Hojaji, F., Mayerhofer, T., Zamani, B., Hamou-Lhadj, A., Bousse, E.: Model execution tracing: a systematic mapping study. Softw. Syst. Model. (SoSyM) 18(6), 3461–3485 (2019)

    Article  Google Scholar 

  61. El-Masri, D., Petrillo, F., Guhneuc, Y.-G., Hamou-Lhadj, A., Bouziane, A.: A systematic literature review on automated log abstraction techniques. Inf. Softw. Technol. (IST) 122, 106–276 (2020)

    Google Scholar 

  62. Dhoolia, P., Mani, S., Sinha, V.S., Sinhae, S.: Debugging model-transformation failures using dynamic tainting. In: Proceedings of the 24th European Conference on Object-Oriented Programming (ECOOP), pp. 26–51 (2010)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Bahman Zamani.

Additional information

Communicated by Kevin Lano.

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendices

Appendix

A Supplementary images

See Figs. 21, 22 and 23.

B Scheduling anti-pattern and pattern solutions

The anti-pattern identification and pattern application in this paper were implemented using Epsilon language. Therefore, the execution schema for each one follows Epsilon execution semantics, which can be found for both EPLFootnote 10 and ETLFootnote 11 on the Epsilon website. In the following we elaborate on the scheduling rules of anti-patterns and pattern solutions that are used in this paper. Each scheduling rule is a task performed by Epsilon statements in form of pre, post, transformation rule, do-blocks, and/or a function call. Our implementation is based on the iterative mode of Epsilon execution semantics, in which the anti-pattern identification is repeated until no more matches have been found in the TDM elements.

Fig. 22
figure 22

Transformation high-level design meta-model of MeTAGeM [6]

Fig. 23
figure 23

Transformation low-level design meta-model of MeTAGeM [6]

The Spaghetti Transformation anti-pattern starts with defining a global variable to keep the status of mapping elements in the TDM. Then, a rule iteratively checks all the mapping elements of a TDM against the high-level design meta-models. Each mapping that does not satisfy the constraints shown in Table  1 is added to a set, called patternSet which keeps mappings with Spaghetti Transformation scenario. Also, the global value is changed to show the presence of Spaghetti Transformation scenario in the TDM, i.e, it is changed from false to true. Finally, after matching all the mappings, the result is printed for the developer. In Epsilon, the result of an EPL code, i.e., anti-pattern identification, can be stored and transformed between the other languages of the Epsilon family using a set, patternSet.

Phased Construction An ETL code is executed to apply Phased Construction solution to the original input TDM. First, the patternSet, provided by identifying spaghetti, including the mappings with Spaghetti scenario is taken as an input. To keep the original TDM, a new TDM is generated and  Phased Construction solution is applied to a new one. An initial rule generates independent elements on mapping concept in the TDM. Then, A rule recreates those mappings which are not a member of the patternSet as a copy of these elements in the original TDM. Moreover, features and dependencies of these mappings are set same as the original TDM. Then, each mapping in the patternSet, i.e., a mapping which needs to be restructured, is processed. A rule creates a new mapping element for each mapping in the patternSet while the created element has the same features as the original mapping, but it only accesses one level of the target meta-model. In fact, for each mapping in the patternSet, the number of involved target elements are counted using the conditional statement in Table 2, and for each one, a new mapping is generated. The rest of the features and dependencies of the created mapping element are populated using the original mapping. It is noticeable that this paper employs the top-down approach for restructuring spaghetti mappings. However, mappings in patternSet are processed in order that they have been defined by the developer in the TDM. In both transML and MeTAGeM, considering the mappings order in TDM is a developer’s task.

Frequent Invocation Regarding the TDM meta-model, each low-level TDM defines the transformation rule body inside of the Operation elements. Identifying the Frequent Invocation is performed by a rule which for each transformation rule, in the order that they have been defined in the TDM, checks whether its Operation body contains the select command. If so, it puts the Operation element in a set, patternSet. If the patternSet contains any Operation, then the developer is informed of the presence of Frequent Invocation.

Object Indexing Scheduling schema of applying Object Indexing on TDMs starts with a rule which regenerates elements of the original TDM, except the Operation elements. Operation elements are generated if those are not a member of the patternSet. Otherwise, identified Operations with Frequent Invocation scenario, are differently scheduled. For each Operation in the patternSet, a rule of the schema extracts the context of the select command, instances of the invoked context, and invoked property by the select command. Then, a map structure is generated by the invoked property value as the index associated with the invoked instances of the context type. This map is stored and to be used instead of the select command. Then, the schema rule restructures the TDM by changing the Operation body and substitutes the select command by the generated map structure. The changed Operation is added to the related element of the TDM and dependencies are set same as the original TDM. Finally, schema is repeated to check the next Operation in the patternSet.

Return-First Command The scheduling schema for identifying the Return-First Command is same as the scheduling for Frequent Invocation. However, in this scenario, the scheduling rule checks the body of all Operations against the select().first() command. Then, if Operations contain the checked command, the scheduling rule puts them in the patternSet.

Usage of Iterators Applying the Usage of Iterators is similar to the Object Indexing. A scheduling rule regenerates all the elements of the original TDM. However, Operation elements or transformation rule bodies are regenerated if they are not included in the patternSet. Otherwise, a rule is scheduled to find the conditional statement of the select command in the Operation body. Then, inside the Operation element, the present select(condition).first() command is substituted with the any(condition) statement. Finally, the changed Operation is added to the related transformation rule in the new TDM and dependencies are set same as the original TDM. The schema is repeated for all Operation elements in the patternSet.

Boat Anchor A rule collects all element types of the transformation source model and puts them in a set called Source. Then, a secondary rule iteratively checks each member of the Source set against the TDM elements. If the Source member is not a member of the TDM elements, it will be added to the ExcludedSet. Finally, another rule checks the ExcludedSet and informs the developer of the existing Boat Anchor if the set is not empty.

Filtering solution The ExcludedSet in identifying Boat Anchor is transmitted to the applying Filtering solution in patternSet. In this scenario, the transformation source model is restructured. A premier rule regenerates transformation source model elements except element types included in the patternSet, i.e., elements that need to be excluded from the transformation source model. Each element in patternSet, i.e., excluding element, is ignored by the premier rule if it does not have any dependent element. Otherwise, a secondary rule is called to remove the excluding element dependency in the model hierarchy. In fact, the secondary rule regenerates the excluding elements and its dependent element in a flat view and adds them to the generated model. Next, the execution schema is returned to the premier rule and it removes the excluding element. Then, the premier rule continues by checking and regenerating the rest of the transformation source model elements.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Panahandeh, M., Hamdaqa, M., Zamani, B. et al. MUPPIT: a method for using proper patterns in model transformations. Softw Syst Model 20, 1491–1523 (2021). https://doi.org/10.1007/s10270-020-00853-y

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10270-020-00853-y

Keywords

Navigation