Abstract
Models capture relevant properties of systems. During the models’ life-cycle, they are subjected to manipulations with different goals such as managing software evolution, performing analysis, increasing developers’ productivity, and reducing human errors. Typically, these manipulation operations are implemented as model transformations. Examples of these transformations are (i) model-to-model transformations for model evolution, model refactoring, model merging, model migration, model refinement, etc., (ii) model-to-text transformations for code generation and (iii) text-to-model ones for reverse engineering. These operations are usually manually implemented, using general-purpose languages such as Java, or domain-specific languages (DSLs) such as ATL or Acceleo. Even when using such DSLs, transformations are still time-consuming and error-prone. We propose using the advances in artificial intelligence techniques to learn these manipulation operations on models and automate the process, freeing the developer from building specific pieces of code. In particular, our proposal is a generic neural network architecture suitable for heterogeneous model transformations. Our architecture comprises an encoder–decoder long short-term memory with an attention mechanism. It is fed with pairs of input–output examples and, once trained, given an input, automatically produces the expected output. We present the architecture and illustrate the feasibility and potential of our approach through its application in two main operations on models: model-to-model transformations and code generation. The results confirm that neural networks are able to faithfully learn how to perform these tasks as long as enough data are provided and no contradictory examples are given.
Similar content being viewed by others
Notes
In statistics, overfitting is the situation in which the ANN is so closely fitted to the training data that it is not able to generalize and make good predictions for new data.
We refer the reader to [10] for details about LSMT cells.
Note that these output embeddings are available and used only during training. Once the training phase is done, they are neither available nor needed.
Different values can be provided as parameters when executing our python implementation.
The code and data required to reproduce our experiments are available at: https://github.com/modelia/ai-for-model-manipulation.
The ATL implementation of the transformation contains 1 helper and 6 rules – 94 LoC in total (without counting the ATL file headers). For full transformation details, please, check [24].
For the sake of comparison, in this particular case, we are inferring the same model-to-model transformation that we presented in [13]. This time the transformation is learned with a dataset of only 750 models instead of 1,000.
Another solution could have been to slice those classes in chunks.
The challenge of collecting and curating model repositories is well known in our community.
Transfer learning is the improvement of learning in a new task through the transfer of knowledge from a related task that has already been learned [32].
Unlike black-box approaches, our contribution is grey-box since details such as its architecture, (hyper-)parameter values, training method and training data are available.
References
Jouault, F., Allilaire, F., Bézivin, J., Kurtev, I.: ATL: a model transformation tool. Sci. Comput. Prog. 72(1–2), 31–39 (2008)
Eclipse, Acceleo (2006). http://www.eclipse.org/acceleo/
Eclipse, Xtext (2009). https://www.eclipse.org/Xtext/
Burgueño, L., Cabot, J., Gérard, S.: The future of model transformation languages: an open community discussion. J. Object Technol. 18(3), 7:1–11 (2019)
Forward, A., Lethbridge, T.: Problems and opportunities for model-centric versus code-centric software development: a survey of software professionals. In: Proceedings of the International Workshop on Models in Software Engineering, pp 27–32 (2008)
Selic, B.: What will it take? A view on adoption of model-based methods in practice. Softw. Syst. Model. 11(4), 513–526 (2012). https://doi.org/10.1007/s10270-012-0261-0
Wang, Y., Zheng, B., Huang, H.: Complying with coding standards or retaining programming style: a quality outlook at source code level. J. Softw. Eng. Appl. 1(1), 88–91 (2008)
Wu, Y., Schuster, M., Chen, Z., Le, Q.V., Norouzi, M., Macherey, W., Krikun, M., Cao, Y., Gao, Q., Macherey, K., Klingner, J., Shah, A., Johnson, M., Liu, X., Kaiser, Łukasz, Gouws, S., Kato, Y., Kudo, T., Kazawa, H., Stevens, K., Kurian, G., Patil, N., Wang, W., Young, C., Smith, J., Riesa, J., Rudnick, A., Vinyals, O., Corrado, G., Hughes, M., Dean, J.: Google’s neural machine translation system: Bridging the gap between human and machine translation (2016). arXiv:1609.08144
Bahdanau, D., Cho, K., Bengio, Y.: Neural machine translation by jointly learning to align and translate (2016). arXiv:1409.0473
Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural Comput. 9(8), 1735–1780 (1997)
Sutskever, I., Vinyals, O., Le, Q.: Sequence to sequence learning with neural networks. Adv. Neural Inf. Process. Syst. 4, 3104–3112 (2014)
Chen, X., Liu, C., Song, D.: Tree-to-tree neural networks for program translation. In: Proceedings of the Annual Conference on Advances in Neural Information Processing Systems (NeurIPS’18), pp. 2552–2562 (2018)
Burgueño, L., Cabot, J., Gérard, S.: An LSTM-based neural network architecture for model transformations. In: Proceedings of the 22nd ACM/IEEE International Conference on Model Driven Engineering Languages and Systems (MODELS’19), pp. 294–299 (2019)
Minsky, M., Papert, S.: Perceptrons
Rosenblatt, F.: The perceptron: a probabilistic model for information storage and organization in the brain. Psychol. Rev. 65(6), 386–408 (1958). https://doi.org/10.1037/h0042519
Rumelhart, D., Hinton, G., Williams, R.: Learning internal representations by error propagation. Parallel distributed processing: explorations in the microstrucrures of cognition 1
Russell, S., Norvig, P.: Artificial Intelligence: A Modern Approach, Pearson (2016)
Schmidhuber, J.: Deep learning in neural networks: an overview. Neural Netw. 61, 85–117 (2015)
Cho, K., van Merrienboer, B., Gülçehre, Ç., Bahdanau, D., Bougares, F., Schwenk, H., Bengio, Y.: Learning phrase representations using RNN encoder-decoder for statistical machine translation. In: Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP’14), pp. 1724–1734 (2014)
Tai, K.S., Socher, R., Manning, C.D.: Improved semantic representations from tree-structured long short-term memory networks. In: Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing of the Asian Federation of Natural Language Processing, pp. 1556–1566 (2015)
Tai, K.S., Socher, R., Manning, C.D.: Improved semantic representations from tree-structured long short-term memory networks (2015) arXiv:1503.00075
Goodfellow, I., Bengio, Y., Courville, A.: Deep Learning. MIT Press, London (2016)
Smith, L.N.: A disciplined approach to neural network hyper-parameters: part 1-learning rate, batch size, momentum, and weight decay, CoRR arXiv:1803.09820
AtlanMod (Inria), Class to relational transformation example, https://www.eclipse.org/atl/atlTransformations/#Class2Relational
Bruneliere, H., Cabot, J., Jouault, F., Madiot, F.: MoDisco: A generic and extensible framework for model driven reverse engineering. In: Proceedings of the IEEE/ACM International Conference on Automated Software Engineering (ASE’10), pp. 173–174 (2010) https://www.eclipse.org/MoDisco/
Koehn, P., Knowles, R.: Six challenges for neural machine translation. In: Proceedings of the 1st Workshop on Neural Machine Translation (NMT @ ACL), pp. 28–39 (2017)
Dorin, M., Montenegro, S.: Coding standards and human nature. Int. J. Perf. Eng. 14, 1308–1313 (2018)
Papineni, K., Roukos, S., Ward, T., Zhu, W.: Bleu: a method for automatic evaluation of machine translation. In: Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, pp. 311–318 (2002)
Doddington, G.: Automatic evaluation of machine translation quality using n-gram co-occurrence statistics, In: Proceedings of the 2nd International Conference on Human Language Technology Research (HLT’02), Morgan Kaufmann Publishers Inc., pp. 138–145 (2002)
Wohlin, C., Runeson, P., Höst, M., Ohlsson, M.C., Regnell, B.: Experimentation in Software Engineering. Springer, Berlin (2012)
Bowles, C., Chen, L., Guerrero, R., Bentley, P., Gunn, R.N., Hammers, A., Dickie, D.A., del C. Valdés Hernández, M., Wardlaw, J.M., Rueckert, D.: GAN augmentation: Augmenting training data using generative adversarial networks, CoRR arXiv:1810.10863
Olivas, E.S., Guerrero, J.D.M., Sober, M.M., Benedito, J.R.M., Lopez, A.J.S.: Handbook Of Research On Machine Learning Applications and Trends: Algorithms, Methods and Techniques, Information Science Reference - Imprint of: IGI Publishing. Hershey, PA (2009)
Semeráth, O., Varró, D.: Iterative generation of diverse models for testing specifications of dsl tools, In: Proc. of the 21rd International Conference on Fundamental Approaches to Software Engineering (FASE’18)”, year=“2018”, x-publisher=“Springer International Publishing”, x-address=“Cham”, pages=“227–245”, x-isbn=“978-3-319-89363-1”
Clarisó, R., Cabot, J.: Applying graph kernels to model-driven engineering problems. In: Proceedings of the 1st International Workshop on Machine Learning and Software Engineering in Symbiosis (MASES@ASE’18), pp. 1–5 (2018)
Burgueño, L., Wimmer, M., Vallecillo, A.: A Linda-based platform for the parallel execution of out-place model transformations. Inf. Softw. Technol. 79, 17–35 (2016)
Burgueño, L., Ciccozzi, F., Famelis, M., Kappel, G., Lambers, L., Mosser, S., Paige, R.F., Pierantonio, A., Rensink, A., Salay, R., Taentzer, G., Vallecillo, A., Wimmer, M.: Contents for a model-based software engineering body of knowledge. Softw. Syst. Model. 18(6), 3193–3205 (2019). https://doi.org/10.1007/s10270-019-00746-9
OMG, MOF QVT Final Adopted Specification, Object Management Group, OMG doc. ptc/05-11-01 (2005)
Kolovos, D.S., Paige, R.F., Polack, F.A.C.: The epsilon transformation language. In: Proceedings of the 11th International Conference on Model Transformations (ICMT’2008), Vol. 5063 of LNCS. Springer, pp. 46–60 (2008)
Kappel, G., Langer, P., Retschitzegger, W., Schwinger, W., Wimmer, M.: Model transformation by-example: a survey of the first wave. In: Conceptual Modelling and Its Theoretical Foundations: Essays Dedicated to Bernhard Thalheim on the Occasion of His 60th Birthday, pp. 197–215 (2012)
Varró, D.: Model transformation by example, In: Proceedings of the 9th International Conference on Model Driven Engineering Languages and Systems (MODELS’06), pp. 410–424 (2006)
Wimmer, M., Strommer, M., Kargl, H., Kramler, G.: Towards model transformation generation by-example. In: Proceedings of the 40th Hawaii International International Conference on Systems Science (HICSS’07), p. 285 (2007)
García-Magariño, I., Gómez-Sanz, J.J., Fuentes-Fernández, R.: Model transformation by-example: An algorithm for generating many-to-many transformation rules in several model transformation languages. In: Proceedings of the 2nd International Conference on Model Transformations (ICMT’09), pp. 52–66 (2009)
Balogh, Z., Varró, D.: Model transformation by example using inductive logic programming. Softw. Syst. Model. 8(3), 347–364 (2009)
Kessentini, M., Sahraoui, H.A., Boukadoum, M., Benomar, O.: Search-based model transformation by example. Softw. Syst. Model. 11(2), 209–226 (2012)
Mkaouer, M.W., Kessentini, M.: Model transformation using multiobjective optimization. Adv. Comput. 92, 161–202 (2014)
Lano, K., Fang, S., Umar, M.A., Yassipour-Tehrani, S.: Enhancing model transformation synthesis using natural language processing, In: Proceedings of the 23rd ACM/IEEE International Conference on Model Driven Engineering Languages and Systems Companion (MODELS-C’20), Virtual Event, Canada, (2020)
Chowdhury, G.G.: Natural language processing. Ann. Rev. Inf. Sci. Technol. 37(1), 51–89 (2003)
Buttler, D.: A short survey of document structure similarity algorithms. In: Proceedings of ICOMP, Las Vegas, p. 2004., USA NV (2004)
Lavrac, N., Dzeroski, S.: Inductive logic programming. In: Proceedings of WLP 1994, Zurich, Switzerland (1994)
Baki, I., Sahraoui, H.A.: Multi-step learning and adaptive search for learning complex model transformations from examples. ACM Trans. Softw. Eng. Methodol. 25(3), 20:1–20:37 (2016)
Bernstein, P.A., Melnik, S.: Model management 2.0: Manipulating richer mappings. In: Proceedings of the ACM SIGMOD International Conference on Management of Data (SIGMOD’07), pp. 1–12 (2007)
Terwilliger, J.F., Bernstein, P.A., Unnithan, A.: Automated co-evolution of conceptual models, physical databases, and mappings. In: Proceedings of the 29th International Conference on Conceptual Modeling (ER’10), pp. 146–159 (2010)
Bernstein, P.A., Madhavan, J., Rahm, E.: Generic schema matching, ten years later. In: Proceedings of 37th International Conference on Very Large Data Bases (VLDB’11), vol. 4, pp. 695–701 (2011)
Dit, B., Revelle, M., Gethers, M., Poshyvanyk, D.: Feature location in source code: a taxonomy and survey. J. Softw. Evol. Process. 25(1), 53–95 (2013)
Font, J., Arcega, L., Haugen, Ø., Cetina, C.: Feature location in model-based software product lines through a genetic algorithm. In: Proceedings of the 2016 International Conference on Software Reuse, pp. 39–54. (2016)
Holthusen, S., Wille, D., Legat, C., Beddig, S., Schaefer, I., Vogel-Heuser, B.: Family model mining for function block diagrams in automation software. In: Proceedings of the 18th International Software Product Line Conference: Companion Volume for Workshops, Demonstrations and Tools-Volume 2 (2014)
Zhang, X., Haugen, Ø., Moller-Pedersen, B.: Model comparison to synthesize a model-driven software product line. In: Proceedings of the 15th International Software Product Line Conference (2011)
Ho-Quang, T., Chaudron, M. R., Samúelsson, I., Hjaltason, J., Karasneh, B., Osman, H.: Automatic classification of uml class diagrams from images, In: Proceedings of the 21st Asia-Pacific Software Engineering Conference, IEEE (2014)
Marcén, A.C., Lapeña, R., Pastor, Ó., Cetina, C.: Traceability link recovery between requirements and models using an evolutionary algorithm guided by a learning to rank algorithm: Train control and management case. J. Syst. Softw. 163
Barriga, A., Rutle, A., Heldal, R.: Personalized and automatic model repairing using reinforcement learning. In: Proceedings of the 22nd ACM/IEEE International Conference on Model Driven Engineering Languages and Systems Companion (MODELS-C’19), Munich, Germany (2019)
Sutton, R.S., Barto, A.G.: Reinforcement learning: An introduction. MIT Press, London (2018)
Nguyen, P. T., Di Rocco, J., Di Ruscio, D., Pierantonio, A., Iovino, L.: Automated classification of metamodel repositories: a machine learning approach. In: Proceedings of the 22nd ACM/IEEE International Conference on Model Driven Engineering Languages and Systems (MODELS’19), Munich, Germany (2019)
Svozil, D., Kvasnicka, V., Pospichal, J.: Introduction to multi-layer feed-forward neural networks. Chemom. Intell. Lab. Syst. 39(1), 43–62 (1997)
Gilson, F., Irwin, C.: From user stories to use case scenarios towards a generative approach. In: Proceedings of the 25th Australasian Software Engineering Conference (ASWEC’18), pp. 61–65 (2018)
Elallaoui, M., Nafil, K., Touahni, R.: Automatic transformation of user stories into uml use case diagrams using nlp techniques. In: Proceedings of the 9th International Conference on Ambient Systems, Networks and Technologies (ANT 2018) and the 8th International Conference on Sustainable Energy Information Technology (SEIT-2018) - Affiliated Workshops ANT/SEIT (2018)
Narawita, C.R., Vidanage, K.: Uml generator-an automated system for model driven development. In: Proceedings of the 16th International Conference on Advances in ICT for Emerging Regions (ICTer’16) (2016)
Elallaoui, M., Nafil, K., Touahni, R.: Automatic generation of uml sequence diagrams from user stories in scrum process. In: Proceedings of the 10th International Conference on Intelligent Systems: Theories and Applications (SITA’15) (2015)
Chen, X., Liu, C., Song, D.: Learning neural programs to parse programs, CoRR arXiv:1706.01284
Allamanis, M., Barr, E.T., Bird, C., Sutton, C.: Learning natural coding conventions. In: Proceedings of the 22nd International Symposium on Foundations of Software Engineering (FSE’14), p. 281–293 (2014) https://doi.org/10.1145/2635868.2635883
Derksen, A.: aicoodoo, http://aicodoo.com/ (2020)
Wolf, T., Debut, L., Sanh, V., Chaumond, J., Delangue, C., Moi, A., Cistac, P., Rault, T., Louf, R., Funtowicz, M., Davison, J., Shleifer, S., von Platen, P., Ma, C., Jernite, Y., Plu, J., Xu, C., Scao, T.L., Gugger, S., Drame, M., Lhoest, Q., Rush, A.M.: Huggingface’s transformers: state-of-the-art natural language processing (2019) arXiv:1910.03771
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., Polosukhin, I.: Attention is all you need (2017). arXiv:1706.03762
Merity, S.: Single headed attention rnn: Stop thinking with your head (2019). arXiv:1911.11423
Pham, V.C., Li, S., Radermacher, A., Gerard, S., Mraidha, C.: Fostering software architect and programmer collaboration. In: Proceedings of the 21st International Conference on Engineering of Complex Computer Systems, (ICECCS’16), pp. 3–12 (2016)
Acknowledgements
This work is supported by Spanish Research project and TIN2016-75944-R and CEA in the context of the Modelia initiative.
Author information
Authors and Affiliations
Corresponding author
Additional information
Communicated by Jeff Gray.
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Burgueño, L., Cabot, J., Li, S. et al. A generic LSTM neural network architecture to infer heterogeneous model transformations. Softw Syst Model 21, 139–156 (2022). https://doi.org/10.1007/s10270-021-00893-y
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10270-021-00893-y