Using model-driven engineering to automate software language translation
Kevin Lano, Hanan Abdulwahab Siala · Automated Software Engineering · 2024
Abstract The porting or translation of software applications from one programming language to another is a common requirement of organisations that utilise software, and the increasing number and diversity of programming languages makes this capability as relevant today as in previous decades. Several approaches have been used to address this challenge, including machine learning and the manual definition of direct language-to-language translation rules, however the accuracy of these approaches remains unsatisfactory. In this paper we describe a new approach to program translation using model-driven engineering techniques: reverse-engineering source programs into specifications in the UML and OCL formalisms, and then forward-engineering the specifications to the required target language. This approach can provide assurance of semantic preservation, and additionally has the advantage of extracting precise specifications of software from code. We provide an evaluation based on a comprehensive dataset of examples, including industrial cases, and compare our results to those of other approaches and tools. Our specific contributions are: (1) Reverse-engineering source programs to detailedsemantic modelsof software behaviour, to enable semantically-correct translations and reduce re-testing costs; (2) Program abstraction processes defined by precise and explicit rules, which can be edited and configured by users; (3) A set of reusable OCL library components appropriate for representing program semantics, and which can also be used for OCL specification of new applications; (4) A systematic procedure for building program abstractors based on language grammars and semantics.
Cited by 22 works. doi:10.1007/s10515-024-00419-y Open-access PDF
Authors
References
- LLVM: a compilation framework for lifelong program analysis & transformation
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
- On Formalizing the UML Object Constraint Language OCL
- KM3: A DSL for Metamodel Specification
- Model-Driven Software Engineering in Practice
- CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generation
- On the assessment of generative AI in modeling tasks: an experience report with ChatGPT and UML
- Lexical statistical machine translation for language migration
- An Empirical Study of the Non-Determinism of ChatGPT in Code Generation
- GraphCodeBERT: Pre-training Code Representations with Data Flow