From Formal Modelling to Agent Simulation Execution and Testing Ilias Sakellariou 1 , Dimitris Dranidis 2 , Marina Ntika 3 and Petros Kefalas 2 1 Dept. of Applied Informatics, University of Macedonia, 156 Egnatia Str., 54636, Thessaloniki, Greece 2 Dept. of Computer Science, The University of Sheffield International Faculty, City College, L. Sofou 3, 54624, Thessaloniki, Greece 3 South East European Research Centre (SEERC), Research Centre of the International Faculty of The University of Sheffield, CITY College, 24 Proxenou Koromila Str., 54622, Thessaloniki, Greece Keywords: Formal Methods, NetLogo, Agent Based Simulation, Test Case Generation. Abstract: This work presents an approach to agent-based simulation development using formal modelling, i.e. stream X-Machines, that combines the power of executable specifications and test case generation. In that respect, a domain specific language is presented for effortlessly encoding agent behaviour as a stream X-Machine in a well known simulation platform. The main benefits in using the specific formal approach in such a practical setting, apart from the fact that it offers a clear, intuitive way for specifying agent behaviour, is the existence of tools for test case generation, that allow to systematically generate “agent simulation test scenarios”, i.e. sequences of agent inputs that can be used for validation. 1 INTRODUCTION In the past years the research community has experi- enced an explosive interest in the area of agent based simulations, the latter being applied to wide range of scientific fields, such as biology, pedestrian simula- tions, economics to mention a few (Davidsson et al., 2007). Thus, the number of agent simulation plat- forms (Nikolai and Madey, 2009) (Allan, 2010), and development methodologies proposed in the literature is quite large. However, there is little work in approaches that combine various aspects of the standard software en- gineering process in building simulations. One im- portant issue when developing any system is system- atic testing, i.e. the generation of an (ideally) ex- haustive set of test cases, that will allow checking the conformance of a system to its specification. An- other important aspect is validation, i.e. checking whether the system exhibits the intended behaviour. Validation could be performed by executing the sys- tem with some representative scenarios, thus allowing the developer to investigate the simulation system be- haviour. Towards this direction, this paper advocates the use of Stream X-Machines (SXM), a formal method extending the finite state machines, i.e. a class of state machines augmented with memory and partial func- tions labelling transitions, to develop agent simula- tions. One of the main benefits using the specific for- malism is that SXMs offer a testing method that un- der certain design-for-test conditions ensures the con- formance of a system to its specification (Ipate and Holcombe, 1997). Furthermore, there exist tools that allow encoding of executable SXM specifications of agents in simulation environments, and most impor- tantly, in the current context, tools that allow auto- mated test case generation. Thus, this paper presents TXStates, a domain spe- cific language (DSL) that acts as a layer for specifying and executing agents represented as SXMs in NetL- ogo (Wilensky, 1999), one of the most widely known multi agent simulation platforms. The TXStates DSL has evolved for a number of years and earlier versions of it have been used to develop medium to large scale simulations in NetLogo, including some agent simu- lations that include behaviour under the influence of emotions (Sakellariou et al., 2014). The model devel- oped in TXStates can then be transformed to a JSXM model. JSXM (Dranidis et al., 2012) is a tool, sup- porting modelling and execution of SXMs and most importantly automated test case generation, based on the SXM testing theory. The approach (and not yet a methodology) this work proposes, is to use TXStates to develop a sim- ulation based on a SXM model through the usual it- 87 Sakellariou I., Dranidis D., Ntika M. and Kefalas P.. From Formal Modelling to Agent Simulation Execution and Testing. DOI: 10.5220/0005222200870098 In Proceedings of the International Conference on Agents and Artificial Intelligence (ICAART-2015), pages 87-98 ISBN: 978-989-758-073-4 Copyright c 2015 SCITEPRESS (Science and Technology Publications, Lda.)