Model-Level, Platform-Independent Debugging in the Context of the Model-Driven Development of Real-Time Systems Mojtaba Bagherzadeh, Nicolas Hili, Juergen Dingel School of Computing, Queen’s University, Kingston, Canada {mojtaba, hili, dingel}@cs.queensu.ca ABSTRACT Providing proper support for debugging models at model- level is one of the main barriers to a broader adoption of Model Driven Development (MDD). In this paper, we focus on the use of MDD for the development of real-time embedded systems (RTE). We introduce a new platform-independent approach to implement model-level debuggers. We describe how to realize support for model-level debugging entirely in terms of the modeling language and show how to implement this support in terms of a model-to-model transformation. Key advantages of the approach over existing work are that (1) it does not require a program debugger for the code generated from the model, and that (2) any changes to, e.g., the code generator, the target language, or the hardware platform leave the debugger completely unaffected. We also describe an implementation of the approach in the context of Papyrus-RT, an open source MDD tool based on the modeling language UML-RT. We summarize the results of the use of our model-based debugger on several use cases to determine its overhead in terms of size and performance. Despite being a prototype, the performance overhead is in the order of microseconds, while the size overhead is comparable with that of GDB, the GNU Debugger. CCS CONCEPTS Software and its engineering Model-driven software en- gineering; Real-time systems software; Software testing and debugging; KEYWORDS Model-based Debugging, Model-driven Development, UML- RT, Real-time and Embedded systems, MDD, MDE 1 INTRODUCTION Due to the growing complexity of Real-Time and Embedded (RTE) systems, the need for development methods and tools that provide effective means for the efficient development of correct embedded software is increasing. To meet these demands, Model-Driven Development (MDD) has been pro- posed. MDD uses models rather than source code as primary development artifact in an attempt to raise the level of ab- straction. MDD supports the generation of code and can facilitate testing and verification activities [4]. This is a preprint version. Refer ACM website for the final official version. ESEC/FSE’17, September 4–8, 2017, Paderborn, Germany © 2017 Association for Computing Machinery. ACM ISBN 978-1-4503-5105-8/17/09. . . $15.00 https://doi.org/10.1145/3106237.3106278 Typically, developers spend a significant part of their time debugging applications and fixing bugs [30] supported by sophisticated program debugging tools. However, modelling tools currently do not provide proper support for debug- ging and understanding the run-time behaviour at model- level [19, 20, 38]. Instead, developers must use a program debugger on the generated source code to debug their models, which contradicts MDD principles and goals because many of the benefits of the abstraction are lost. Additionally, un- derstanding the generated source code can be challenging and error prone for developers who use only models for de- velopment and are not versed in the target language, i.e., the language the generated code is in [38]. Inadequate debugging support is one of the central barriers to a broader adoption of MDD. Recent efforts have provided a good starting point for understanding the challenges and requirements for model- level debugging [7, 8, 11, 12, 15, 19, 20, 42, 48]. The most frequent proposals are to (1) realize model-level debugging through a model interpreter, or to (2) maintain traceability information between model and code and leverage an existing program debugger. Interpreter-based proposals require the implementation of an interpreter for the modeling language, the action language, and the run-time services library; this is not only time-intensive, but also creates a potentially harmful discrepancy between the environment that the model is debugged in and the environment that the code generated from the model will execute in; this discrepancy might create spurious bugs or mask real bugs that depend on, e.g., the choice of target language or hardware platform; also, we would not expect a large degree of portability of the debugger from one MDE tool to the next. Program debugger-based approaches are very dependent on the target language, the operating system, and the hardware platform, meaning a change in any of these is likely to necessitate substantial changes to the debugger. In this paper, we propose a novel approach for realizing model-level debugging of models of RTE systems. Our ap- proach overcomes the above-mentioned limitations of existing proposals by being completely platform-independent, i.e., it does not depend on any architecture-specific program debug- ger. Instead, our approach relies on model transformation to instrument the model to be debugged with information that allows it to support debugging activities. Since the debug- ging support is realized on the model level, debuggable code can be generated from the model with the standard code generator and without the need for additional, code-level instrumentation or a program debugger.