On the Automated Translational Execution of the Action Language for Foundational UML
Total Page:16
File Type:pdf, Size:1020Kb
View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Springer - Publisher Connector Softw Syst Model DOI 10.1007/s10270-016-0556-7 REGULAR PAPER On the automated translational execution of the action language for foundational UML Federico Ciccozzi1 Received: 11 March 2016 / Revised: 15 July 2016 / Accepted: 28 August 2016 © The Author(s) 2016. This article is published with open access at Springerlink.com Abstract To manage the rapidly growing complexity of 1 Introduction software development, abstraction and automation have been recognised as powerful means. Among the techniques push- Software pervades our everyday life in many ways and ing for them, model-driven engineering has gained increasing its complexity is continuously increasing, thus demanding attention from industry for, among others, the possibility to both methodological and technical enhancements of exist- automatically generate code from models. To generate fully ing engineering approaches. Already from the early 50s, executable code, models should describe complex behav- when software became too complex to be defined in terms of iours. While pragmatically this is achieved by employing machine languages by hand, the need for simplification by programming languages for defining actions within models, abstraction led to the creation of a plethora of programming the abstraction gap between modelling and programming lan- languages [51]. During the 90s, it became clear that the very guages can undermine consistency between models and code fast growth of software’s complexity would lead to the need as well as analysability and reusability of models. In light of of defining even more powerful and flexible development this, model-aware action languages should be preferred. This approaches [20]. Once again the need of further abstrac- is the case of the Action Language for Foundational UML tion arose [29]. On one hand, abstraction can effectively (ALF). In this paper, we provide a solution for the fully help in mitigating software’s complexity. On the other hand, automated translational execution of ALF towards C++. it introduces additional artefacts and development phases Additionally, we give an insight on how to simplify the tran- (e.g. design, transition from design to implementation) and sition from the use of programming languages for modelling thereby the need of ensuring consistency among them. That fine-grained behaviours to model-aware action languages in is to say, while taming the complexity of the software to be industrial MDE. The solution presented in this paper has been developed, abstraction may make the engineering process assessed on industrial applications to verify its applicability more intricate [5]. A common way to mitigate the complex- to complex systems as well as its scalability. ity of an engineering process, especially when dealing with software systems, is boosting automation in the various engi- Keywords Model-driven engineering · Translational neering phases. execution · Code generation · UML · ALF In the profusion of software engineering techniques advo- cating abstraction and automation as compelling needs for effective development, model-driven engineering (MDE) has stood out and got a foothold as a promising way to (i) tackle Communicated by Dr. Timothy Lethbridge. the difficulty of third-generation languages to effectively mitigate software’s complexity and express domain-specific B Federico Ciccozzi concepts, and (ii) alleviate the complexity of the engineer- [email protected] ing process by providing means for automation. To manage software’s complexity, MDE aims at promoting models as 1 Department of Innovation, Design, and Engineering (IDT), MRTC, Mälardalen University, 72123 P.O. Box 883, primary artefacts in the development. Västerås, Sweden 123 F. Ciccozzi MDE advocates automation by means of transformations tion of completely UML-compliant model-driven approach between models at several development stages for model- by designing new models (or parts of them) entirely using based analysis, model simulation, code generation and even UML and ALF can be gradual. The final goal would be to back-propagation from code to models [10], to mention a model using UML (and profiles) and ALF only. few [44]. Generally, in order for the adoption of MDE to The translation mappings have been tested through trans- be profitable from an industrial point of view, it has been formation unit testing [50], while functional correctness of empirically assessed that automated code generation cannot the generated C++ code has been assessed through monitor- be neglected [21]. One of the crucial characteristics for a ing and logging routines on instrumented code. Among the modelling language to suffice as input for full-fledged code applications used for validation and evaluation purposes, the generation is the ability to provide means for specifying fine- self-orienting carrier robot system is used in the paper as run- grained behaviours. Most often, this is done by inserting code ning example for showing the translation process. Moreover, written in common programming languages (e.g. C++, Java) the Asynchronous Transfer Mode (ATM) Adaptation Layer as behavioural descriptions in the model. 2 (AAL2) subsystem, defined within Ericsson Nikola Tesla On one hand, this represents a pragmatic way to address in Zagreb (Croatia) under the supervision of Ericsson AB in the problem in industrial settings since it enables the reuse of Kista (Sweden), has been exploited also to assess scalability legacy models with fine-grained behaviours defined through and applicability to real industrial systems. programming languages. On the other hand, this practice can The remainder of this paper is organised as follows. In bring more drawbacks than benefits when it comes to con- Sect. 2, we describe the core concepts that set the scope of sistency, analysability, reusability, just to mention a few, as our problem and solution. A snapshot of the related works, explained in the remainder of the paper. These drawbacks can the details of the presented contribution and how it is meant to be tamed through promoting the use of model-aware action advance the current state of the art and practice are presented languages, based on the modelling languages themselves, in Sect. 3. In Sect. 4, we provide a high-level description as the preferred way for defining fine-grained behaviours of the solution, while the complete list of mappings from when modelling a software system. This is the case of the ALF syntax elements to C++ is given in Sect. 5. In Sect. 6, Action Language for Foundational UML (ALF) [36] defined we show the application of the transformation process to a by the Object Management Group (OMG) to act as the sur- running example. Details on validation and evaluation of the face notation for specifying executable behaviours within a solution are described in Sect. 7, while Sect. 8 proposes a wider model that is primarily represented using the graph- discussion of core aspects related to problem and solution. ical notations of the Unified Modelling Language (UML)1. The paper is concluded with a short summary of the presented ALF naturally leverages the UML metamodelling elements work as well as possible and planned future enhancements and thereby can boost consistency-by-construction and ease in Sect. 9. model-based activities (e.g. analysis [12], simulation [14]). In this paper, we provide a first of its kind solution for the automatic translational execution (see Sect. 2)ofALF 2ALF:whyandhow? to C++. While in our preliminary results [9] we introduced the idea and showed that such a translation was possible, The central concept of MDE is the model, an abstrac- in this contribution we provide a fully functioning solution tion of a real problem conforming to a metamodel, which for translating (i) all the ALF concepts needed for defining describes the set of concepts and wellformedness rules that a complex behaviours and (ii) a portion of those needed for model shall follow. In the abundance of general-purpose and structural definitions. Moreover, we provide a solution for domain-specific modelling languages, UML has emerged both memory management and type deduction. A detailed and established itself as de facto standard in industrial model- description of the contribution in relation to our preliminary based development of software systems [22], and, more results is provided in Sect. 3. generally, empirically proven to be the most widely used Since the use of programming languages within models architectural description language [31]. The propensity for is rooted in UML-based industrial MDE, we do not advo- adopting UML is partially motivated by its versatility, which cate a radical and sudden shift to ALF which would not be enables (i) its usage as general-purpose language and (ii) feasible in industry. To support this, in the paper we indicate the possibility to customise it through the so-called profiling how our translator from ALF to C++ can be exploited as a mechanisms [1] to give it domain specificity. complement to existing MDE processes that generate exe- Although helping in raising the level of abstraction, cutable C++ from UML with C++ as action code. Doing so, initially UML was not sufficiently powerful to describe legacy models (or parts of them) can be reused and the adop- executable programs as traditional third-generation program- ming languages were, and therefore it had to rely on them 1 http://www.uml.org/. to achieve executable artefacts. This was, and still is, done 123 Promoting ALF for UML behavioural modelling either by employing these languages for describing behav- the modelling languages themselves, should be preferred to iours within the models or by producing structural code programming languages when modelling fine-grained behav- skeletons to be completed by hand with specific behaviours. iours. With UML 1.5, an action semantics for UML was intro- With the standardisation of ALF, we noticed an increas- duced. Moreover, the standardisation of (i) the Foundational ing industrial interest in gradually moving towards legitimate Subset For Executable UML Models (fUML), which gives action languages.