=Paper=
{{Paper
|id=Vol-2245/mdebug_paper_2
|storemode=property
|title=Towards Providing Debugging in the Domain-Specific Modeling Languages for Software Agents
|pdfUrl=https://ceur-ws.org/Vol-2245/mdebug_paper_2.pdf
|volume=Vol-2245
|authors=Baris Tekin Tezel,Geylani Kardas
|dblpUrl=https://dblp.org/rec/conf/models/TezelK18
}}
==Towards Providing Debugging in the Domain-Specific Modeling Languages for Software Agents==
Towards Providing Debugging in the Domain-Specific Modeling Languages for Software Agents Baris Tekin Tezel Geylani Kardas Computer Science Department, Dokuz Eylul University International Computer Institute, Ege University Izmir, Turkey Izmir, Turkey baris.tezel@deu.edu.tr geylani.kardas@ege.edu.tr ABSTRACT the correctness of the prepared MAS model at the design phase. Domain-specific modeling languages (DSMLs) for Multi-agent Sys- Hence, in this paper, we present our ongoing work which aims tems (MAS) mostly provide checks and validations on modeled at providing debugging inside MAS DSMLs. Thus, it is possible to systems according to the related syntax and semantics descriptions. complete the debugging phase at the modeling level before the code However, they do not have a built-in support for debugging MAS generation which leads to creating a MAS model conforming to models which makes the control of model correctness difficult. the specifications at the beginning. We currently investigate how Hence, in this paper, we present our ongoing work which aims at MAS DSMLs and debugging concepts and procedures pertaining providing debugging inside MAS DSMLs. We describe two possible to general-purpose languages (GPLs) can be bridged. The paper ways of deriving debuggers for MAS DSMLs. The first alternative presents the initial findings of this investigation by describing two is based on the construction of a mapping between MAS model ways of deriving debuggers for MAS DSMLs. A brief evaluation of entities and the generated code while the second one considers these two approaches are also included. the metamodel-based description of the operational semantics of In section 2, we introduce possible debugging approaches which executing agents. Pros and cons of each approach are also discussed. can be applied for MAS DSMLs. In section 3, we discuss the advan- tages and the disadvantages of the proposed debugging approaches by taking into account software agents and MAS context. Finally, 1 INTRODUCTION section 4 concludes the paper. Software agents are autonomous software entities acting to fulfill its duties on behalf of users. Multi-agent systems (MASs) include multiple interacting software agents within an environment to pro- vide solutions for complex systems which cannot be easily solved with individual agents or monolithic systems. However, the devel- 2 DEBUGGING APPROACHES FOR MAS opment of MASs is not trivial due to the various agent properties DSMLS such as autonomy, responsiveness, and proactiveness, and the need In the context of software development, debugging support is for realization of the many different agent interactions [7]. mostly provided by a language and an IDE which enable to watch Agent-oriented software engineering (AOSE) [18] researchers and change executed programs [23]. As indicated in [20], various define various agent metamodels (e.g. [3, 13, 19]), which include debugging techniques (e.g. using breakpoints, stepping operators, fundamental MAS entities and relations. Originating from these symbolic execution) are used for GPLs. However, model devel- metamodel definitions, many model-driven agent development ap- opers need to debug models at the model level, not at the code proaches [14] are provided in order to facilitate design and imple- level in the domain-specific modeling [17], and this new require- mentation of software agents by enriching MAS metamodels with ment caused the researchers on developing new debugging ap- some defined syntax and semantics (usually translational seman- proaches for model-driven development and DSMLs. Compared tics). In AOSE, perhaps the most popular way of applying model- with GPLs, very few debugging methods and tools currently ex- driven engineering (MDE) for MASs is based on creating Domain- ist for DSMLs. For instance, Moldable Debugger [8] provides the specific Modeling Languages (DSMLs) with including appropriate construction of domain-specific debuggers by creating and com- integrated development environments (IDEs) in which both mod- bining domain-specific debugging operations with domain-specific eling and code generation for system-to-be-developed can be per- debugging views. Omniscient debugging, which allows free traver- formed properly [15]. Proposed MAS DSMLs (e.g. [2, 6, 11, 12, 16] sal of the states reached by a system during an execution, is also usually support modeling both the static and the dynamic aspects of used in creating debuggers for executable DSMLs (xDSMLs) [5] agent software from different MAS viewpoints including agent in- or improving model transformations [9]. Motivating from these ternal behaviour model, interaction with other agents, use of other efforts, we investigate different debugging approaches which can be environment entities, etc. Although IDEs of these MAS DSMLs used for MAS DSMLs. Within the scope of our study, two different provide some sort of check and validation on modeled systems approaches have been derived so far. The first one is focused on according to the related DSML’s syntax and semantics descriptions, constructing a mapping between MAS model entities and the gener- they do not have a built-in support for debugging these MAS mod- ated code while the second approach covers the metamodel-based els. That deficiency causes the agent developers not to be sure on description of the operational semantics of executing agents. The following subsections briefly discuss these alternatives. MDEbug’18, October 2018, Copenhagen, Denmark 2018. 2.1 Construction of a Mapping Between MAS The key technique of the approach is the step-by-step execution Model Entities and the Generated Code of DSML instances (MAS models). This makes it possible to intro- duce a generic debugger. Such a debugger can control a program In this approach, we adopt existing, tried and well-known debug- to suspend execution according to active breakpoints, which are ging facilities for the domain-specific models of software agents. based on model elements. The breakpoint can be placed in model Constructing a mapping between model entities and the generated elements representing program locations. If an element marked as code allows the DSML developer to use target language debugging a breakpoint is included in a M2M transformation query, execution facilities for generating debugging perspectives. For this purpose, is automatically suspended. we propose a debugging approach based on the DSL Debugging Step Operations are interpreted with model transformation queries Framework (DDF) presented by Wu et al. [22]. for the target model locations, which extract the model elements. The key technique of the proposed method is the mapping pro- Such target locations are loaded with temporary breakpoints, and cess. This process is recording the link between an agent DSML when one of these breakpoints is reached, execution is automati- (e.g. DSML4MAS [12] or SEA_ML [6]) and the generated target cally suspended. Thus, one step of the execution is provided on the language code conforming to a MAS development framework (such model. as JACK1 or JADE2 ) implemented with a GPL (e.g. Java). The map- It is worth indicating that the definition of a debugging perspec- ping information required by the approach depends on both the tive of a MAS model instance based on the metamodel is possible in source language (an agent DSML) and the target language (a GPL). this approach, and hence the runtime state of agents can be entirely The mapping components consist of the “source code mapping”, contained in the MAS model. Thus, the debugging perspective that “debugging methods mapping”, and “debugging results mapping”. uses domain-specific concepts at the model level, can be provided The results of these first two mapping processes along with the to the users. generated GPL code are re-interpreted to generate GPL debugging commands for the GPL debugger. The “source code mapping” com- ponent is used to determine which entity of the DSML model is 3 DISCUSSION mapped to which segment of GPL code. As a side effect of model- At first glance, it may seem that the first approach can be applied to-text transformation, the source code mapping is generated when to DSMLs developed for software agents. However, there are some an agent DSML model is transformed to target language code. difficulties in implementation at this point, mainly originating from The traditional GPL debugging activities may not be appropriate using the GPL debuggers for debugging. First, the approach assumes for the end user of an agent DSML. For this reason, domain-specific that all generated artifacts of a MAS DSML are executable. However, debugging activities should be defined to be used in the debug- many MAS DSMLs produce MAS specification / configuration files ging perspective of the DSML level. So, the “debugging methods (e.g. for defining agent beliefs in OWL ontology documents or mapping” component is used for receiving DSML user debugging setting agent goals and plans in XML-encoded files) and hence commands from the DSML-level debugging perspective to deter- they can not be included in the debugging process within this mine what types of debugging commands are needed from the approach. For example; some of the artifacts generated from a GPL-level command line debugger and explaining how debugging SEA_ML [6] MAS model instance are ontology documents of the activities at the DSML level are expressed at the GPL level. semantic web services interacting with the agents while some of The GPL-level debugger sends debugging results to the DSML them are the codes pertaining to the target agent execution platform. debugging perspective with the help of the “debugging results This is an important shortage of following the first approach in mapping” component, which converts GPL debug output messages implementing debuggers for MAS DSMLs. Another difficulty is that back to the DSML level. Since the messages in the GPL debugger the generated GPL code has to be used in GPL debugging tools, so are command line output that does not contain any information the GPL code must be complete. However, due to the high level of pertaining to the DSML debugging perspective, it is necessary to abstraction of MAS DSMLs, the generated GPL codes are generally reconstruct the results to the DSML user perspective. code fragments / templates which are architectural and do not mostly have behavioral logic. This causes a problem before using 2.2 Metamodel-based Description of Agent the generated code in the GPL debugger since existing MAS DSMLs Operational Semantics do not have the ability to generate complete codes for implementing Originating from the methods described in [10] and [4], the debug- MAS [7]. In addition, the DSML users with limited programming ging process, in this approach, is accomplished by the metamodel- skills may not have the ability to complete the generated code. based description of a MAS DSML’s operational semantics where The second approach seems to be more appropriate than the possible runtime states are modeled as part of the DSML metamodel previous one while developing debuggers for MAS DSMLs since and transitions are defined as model-to-model (M2M) transforma- the application of this approach is independent from the GPL de- tions. To apply this approach, an operational semantics based on buggers. The implementation would not need to consider whether the metamodel is required in addition to the abstract syntax of the generated outputs are not executable or the executable artifacts are language. By this way, it allows to access runtime state directly on just template codes. Hence, that approach, i.e. constructing a de- a model instance and to control execution by the M2M transforma- bugger over metamodel-based description of the agent operational tion. semantics, looks more suitable for complex modeling environments 1 JACK Autonomous Software, http://aosgrp.com/products/jack/ of MAS DSMLs. However, applying this approach also has several 2 JAVA Agent DEvelopment Framework, http://jade.tilab.com/ difficulties in the implementation phase. The difficulties will be encountered at (1) parts describing the runtime state of a MAS and enriching them with these methods need further investigation model to be added to the metamodel of the language, and (2) the which will be our future work. writing of the rules of the M2M transformation which will refer to transitions between states. Considering the parts that represent the ACKNOWLEDGMENTS runtime state to be added to the metamodel, if the complexity and The first author would like to thank TUBITAK-BIDEB for their the size of the metamodel increase, the number of these elements financial support during his Ph.D. studies. and the number of relations between both themselves and other elements will also increase dramatically. This is a challenging situa- REFERENCES tion for the language developer who will add these elements to the [1] M. Bagherzadeh, N. Hili, and J. Dingel. 2017. Model-level, platform-independent MAS metamodel. The second problem that may arise in practice is debugging in the context of the model-driven development of real-time systems. In Proc. 11th Joint Meeting on Foundations of Software Engineering. 419–430. that most of the languages and technologies for M2M conversions [2] F. Bergenti, E. Iotti, S. Monica, and A. Poggi. 2017. Agent-oriented model-driven are based on rewriting a graph. However, the proposed approach development for JADE with the JADEL programming language. Computer Lan- should not only rewrite MAS model instances that are caught by guages, Systems & Structures 50 (2017), 142–158. [3] G. Beydoun, G. Low, B. Henderson-Sellers, H. Mouratidis, J. J. Gomez-Sanz, J. traversing in accordance with the target metamodel, but rather Pavon, and C. Gonzalez-Perez. 2009. FAML: A Generic Metamodel for MAS it has to represent the transitions in the runtime by looking at Development. IEEE Transactions on Software Engineering 35, 6 (2009), 841–863. [4] A. Blunk, J. Fischer, and Daniel A. Sadilek. 2009. Modelling a Debugger for the relevant model elements, relations and properties. In this case, an Imperative Voice Control Language. In Lecture Notes in Computer Science. the M2M transformation environment has to be constructed from Vol. 5719. 149–164. scratch solely for a specific MAS DSML in order to be implemented [5] E. Bousse, J. Corley, B. Combemale, J. Gray, and B. Baudry. 2015. Supporting efficient and advanced omniscient debugging for xDSMLs. In Proceedings of the and can be used during transformations. 2015 ACM SIGPLAN Int. Conf. Software Language Engineering (SLE 2015). 137–148. In fact, the difficulty of implementing both of these approaches [6] M. Challenger, S. Demirkol, S. Getir, M. Mernik, G. Kardas, and T. Kosar. 2014. On mainly arises from incomplete and/or informal modeling of runtime the use of a domain-specific modeling language in the development of multiagent systems. Engineering Applications of Artificial Intelligence 28 (2014), 111–141. agent behaviors in the current MAS DSMLs. In order to eliminate [7] M. Challenger, G. Kardas, and B. Tekinerdogan. 2016. A systematic approach this deficiency, one option can be the construction of transforma- to evaluating domain-specific modeling language environments for multi-agent systems. Software Quality Journal 24, 3 (2016), 755–795. tions between MAS DSMLs and a formalism, such as Petri nets. [8] A. Chiş, M. Denker, T. Gîrba, and O. Nierstrasz. 2016. Practical domain-specific de- Hence, models for agent plans and tasks can be complete for ex- buggers using the Moldable Debugger framework. Computer Languages, Systems ecution. Although such a model will include a non-deterministic & Structures 44, Part A (2016), 89–113. [9] J. Corley, B. P. Eddy, E. Syriani, and J. Gray. 2017. Efficient and scalable omniscient formalism due to the nature of agent programs, debugging of such debugging for model transformations. Software Quality Journal 25, 1 (2017). models can be assisted with newly emerging tools (e.g. [21]). Model [10] G. Engels, J. H. Hausmann, R. Heckel, and S. Sauer. 2000. Dynamic meta modeling: instrumentation [1] can also be used for debugging without modi- a graphical approach to the operational semantics of behavioral diagrams in UML. In Lecture Notes in Computer Science. Vol. 1939. 323–337. fying the metamodels. Another alternative for debugging agents [11] E. J. T. Gonçalves, M. I. Cortés, G. A. L. Campos, Y. S. Lopes, E S.S. Freire, V. T. da at runtime can be providing xDSMLs for MAS at first and then Silva, K. S. F. de Oliveira, and M. A. de Oliveira. 2015. MAS-ML 2.0: Supporting the modelling of multi-agent systems with different agent architectures. Journal benefiting from the existing approaches on debugging xDSMLs of Systems and Software 108 (2015), 77–109. (e.g. [5], [9]). However, we should re-engineer both the syntax and [12] C. Hahn. 2008. A domain specific modeling language for multiagent systems. In the semantics of each different MAS DSML as to be executable or Proceedings of the 7th International Joint Conference on Autonomous Agents and Multiagent Systems (AAMAS 2008)-Volume 1. 233–240. construct a brand new MAS xDSML in order to use this approach. [13] C. Hahn, C.and Madrigal-Mora and K. Fischer. 2009. A platform-independent metamodel for multiagent systems. Autonomous Agents and Multi-Agent Systems 18, 2 (2009), 239–266. 4 CONCLUSION [14] G. Kardas. 2013. Model-driven development of multiagent systems: a survey and evaluation. The Knowledge Engineering Review 28, 04 (2013), 479–503. We have discussed some possible debugging approaches which may [15] G. Kardas and J. J. Gomez-Sanz. 2017. Special issue on model-driven engineering be used for debugging MAS models conforming to MAS DSML spec- of multi-agent systems in theory and practice. Computer Languages, Systems & Structures 50 (2017), 140–141. ifications. A brief evaluation of these approaches showed that the [16] G. Kardas, B.T. Tezel, and M. Challenger. 2018. Domain-specific modelling lan- application of the first approach is easier since it benefits from using guage for belief-desire-intention software agents. IET Softw. 12, 4 (2018), 356–364. already existing GPL debuggers. However, use of MAS DSMLs do [17] R. Mannadiar and H. Vangheluwe. 2011. Debugging in Domain-Specific Modelling. In Lecture Notes in Computer Science. Vol. 6563. 276–285. not only produce executable codes; other artifacts (e.g. agent config- [18] O. Shehory and A. Sturm. 2014. Agent-Oriented Software Engineering: Reflections uration files, service descriptions) also need debugging. Moreover, on Architectures, Methodologies, Languages, and Frameworks. Springer-Verlag generated codes mostly do not contain complete behavioral logic re- Berlin Heidelberg. [19] B. T. Tezel, M. Challenger, and G. Kardas. 2016. A metamodel for Jason BDI quired for the exact implementation of agents. These can make the agents. In 5th Symposium on Languages, Applications and Technologies (SLATE’16), application of the first approach inefficient. The second approach, Vol. 51. 8:1—-8:9. [20] S. Van Mierlo, E. Bousse, H. Vangheluwe, M. Wimmer, C. Verbrugge, M. Gogolla, utilizing the metamodel-based description of agent operational M. Tichy, and A. Blouin. 2017. Report on the 1st International Workshop on semantics, seems promising since it is free from underlying GPL Debugging in Model-Driven Engineering (MDEbug17). In Proceedings of the 1st structures. However, it is more difficult to apply because it needs International Workshop on Debugging in Model-Driven Engineering. 441–446. [21] S. Van Mierlo and H. Vangheluwe. 2017. Debugging Non-determinism: a Petrinets addition of parts describing the runtime state of MAS model into the Modelling, Analysis, and Debugging Tool. In Proceedings of the 1st International language metamodel and writing the corresponding M2M transfor- Workshop on Debugging in Model-Driven Engineering (MDEbug 2017). 460–462. mation rules. Implementation of these debuggers can be facilitated [22] H. Wu, J. Gray, and M. Mernik. 2008. Grammar-driven generation of domain- specific language debuggers. Software: Practice and Experience 38, 10 (2008), by methods consisting of strengthening MAS model formalism 1073–1103. and/or re-shaping existing MAS DSMLs as xDSMLs. However, both [23] A. Zeller. 2009. Why Programs Fail: A Guide to Systematic Debugging. Morgan Kaufmann. providing implementation platforms for the proposed approaches