LNCS 4278 - Scalable Context Simulation for Mobile ... - Springer Link

6 downloads 576 Views 448KB Size Report
be used both for initial prototyping and for the final testing of mobile context- .... application in question will determine the importance the designer attributes to.
Scalable Context Simulation for Mobile Applications Y. Liu1, M.J. O'Grady2, and G.M.P. O'Hare2 1

School of Computer Science & Informatics, University College Dublin (UCD), Belfield, Dublin 4, Ireland [email protected] 2 Adaptive Information Cluster (AIC), School of Computer of Computer Science & Informatics, University College Dublin (UCD), Belfield, Dublin 4, Ireland {michael.j.ogrady, gregory.ohare}@ucd.ie

Abstract. Mobility, and, implicitly, context-awareness, offer significant opportunities to service providers to augment and differentiate their respective services. Though this potential has been long acknowledged, the dynamic nature of a mobile user's context can lead to various difficulties when engineering mobile, context-aware applications. Classic software engineering elements are well understood in the fixed computing domain. However, the mobile domain introduces further degrees of difficulty into the process. The testing phase of the software engineering cycle is a particular case in point as modelling the myriad of scenarios that mobile users may find themselves is practically impossible. In this paper, we describe a scalable framework that can be used both for initial prototyping and for the final testing of mobile contextaware applications. In particular, we focus on scenarios where the application is in essence a distributed multi-agent system, comprising a suite of agents running on both mobile devices and on fixed nodes on a wireless network.

1 Introduction Advances in wireless communications and hardware miniaturization have combined to bring about an era of unparallel access to and availability of computing resources. This is particularly evident in the mobile computing domain with the demarcation between classic computing and traditional telephony becoming increasingly blurred. However, it has been observed for some time now that developments in hardware have not been matched with corresponding advances in software. Thus engineering applications and services for mobile users still remains more an art than a science. Historically, models of use for various applications and services evolved, leading to a reasonably mature understanding of the design and engineering issues involved. The introduction of mobility, along with other aspects of the end-user's situation, or context, challenges some the assumptions underpinning the traditional software development cycle. Granted, the key stages remain the same but the tasks associated with each stage need further augmentation and refinement if they are to successfully address the challenge posed by the mobile computing paradigm. Prototyping and testing phases are particularly susceptible as it is impossible in all but the simplest cases to anticipate and effectively model the countless scenarios that the average R. Meersman, Z. Tari, P. Herrero et al. (Eds.): OTM Workshops 2006, LNCS 4278, pp. 1391 – 1400, 2006. © Springer-Verlag Berlin Heidelberg 2006

1392

Y. Liu, M.J. O'Grady, and G.M.P. O'Hare

mobile user may encounter in the course of their everyday pursuits. Indeed, modeling these scenarios is an increasingly complex endeavor, and how best to do this remains an open question. One approach that has raised much interest is that Agent-Oriented Programming (AOP) where agents represent the core abstractions, as distinct from objects. Such an approach is perceived as being particularly suited to those domains where traditional approaches do not prove adequate. Domains characterized by inherent complexity and dynamism are cases in point; a pertinent example being the mobile computing domain. This paper is structured as follows: Section 2 outlines some related work in this area. In Section 3, some issues for consideration during the software engineering lifecycle are elucidated. Section 4 presents the design and implementation of the framework for simulating context. Some reflections on the system and planned future work are presented in Section 5 after which the paper is concluded.

2 Related Research A cursory examination of the research literature will illustrate quickly the significance that the research community attaches to the mobile computing paradigm. A number of what may be cautiously termed sub-disciplines including ubiquitous computing, pervasive computing, and more recently, ambient intelligence (AmI) [1], all seek to deliver services to mobile users; though the specifics of how this is achieved differ in each case. While significant progress has been documented in a number of relevant sub-domains, in particular hardware, development methodologies and support tools are, in contrast, notable by their scarcity. Given the relative newness of mobile computing, this is not surprising. However, some researchers have realized that the complexity and dynamicity of the mobile computing environment raises specific difficulties that traditional software engineering techniques do not adequately address. UBIWISE [2] is described by its developers as a simulator for ubiquitous computing. From a software engineering perspective, it would likely be classified as a rapid prototyping toolkit. A model of the physical environment is maintained on a central server. Users can then connect to this server and, while maintaining a firstperson view of the environment, proceed to interact with various devices in the environment using their desktop keyboard and mouse. Morla [3] has developed a test and simulation environment for evaluating locationbased applications. Web services form the core paradigm around which the system is designed. Interestingly, it also incorporates the well known NS network simulator, which allows the application in question be tested under various network configurations. Bylund and Espinoze [4] have demonstrated the potential of using 3D game engines as a basis for testing and prototyping context-aware services without a need for people or objects moving around the real world. Given the broad range of mobile devices currently available, and their different specifications, a particular difficulty arises for network operators who must support a broad range of applications on such devices without compromising the integrity or stability of their networks. In an effort to address this, Ichiro Satoh, at the National Institute of Informatics in Japan, has developed a framework called the Flying Emulator [5][6]. The core constituent of this framework is a mobile agent that

Scalable Context Simulation for Mobile Applications

1393

emulates mobile devices. As it is mobile, the agent can migrate to distant nodes and remote networks and test the software in situ. Should the application behave satisfactorily, the actual software itself can be deployed on a physical device without recompilation or modification. The potential of intelligent agents for simulating various scenarios has been recognized by other researchers. Hou et al [7] describes an environment that utilizes multiple agents for testing web-based applications. Likewise, Narendra [8] also advocates the use of agents for large scale testing of pervasive computing systems.

3 Engineering Context-Aware Applications Context is a dynamic construct [9]. It is this dynamism that introduces additional levels of difficulty into the software engineering process. As a brief illustration of just some of the issues involved, three aspects of an archetypical mobile user's context are now briefly considered. 1. Spatial Context: In essence, a person's spatial context refers to their physical location and orientation. This is normally interpreted as their geographical position and heading. A number of technologies facilitate the measurement of a person's spatial context. The Global Positioning System (GPS) is the de facto standard at present and measures a person's position to within 20 meters of their actual physical position. If Satellite Based Augmentation System (SBAS) technologies are used, for example the European Ground Navigation Overlay Service (EGNOS), positions can be determined to within 5 meters on average. The forthcoming European initiative - Galileo, will offer further possibilities, especially regarding the reliability of the broadcasted signal. However, a key limitation of satellitebased technologies concerns their ineffectiveness in indoor environments. While technologies exist that operate in indoor environments, for example UBISENSE [10], indoor solutions are almost inherently propriety in nature and are not as ubiquitous as GPS. Thus while position forms a critical aspect of a user's context, capturing and interpreting it in a meaningful manner requires careful consideration of the technologies used and their associated limitations. 2. Environment: For brevity, discussion is limited to the data communication's aspect of a person's environment, rather than reflecting on the broad spectrum of issues associated with the physical environment. The availability of wireless or data communications is dependent on a number of factors, but the nature of the available connection is of particular interest, when a subscriber's context is considered. If a basic second generation (2G) network is availed of, data communications speeds of less than 20 kb/s may be the norm. In contrast, a third generation (3G) connection may offer speeds of up to 2 Mb/s. In urban environments, the proliferation of WiFi hotspots offers a viable alternative to 3G. Thus data-rate is an important element of a mobile user's context. However, it is the nature of the mobile application that determines the attention that should be given to it in the design process. Should the application incorporate a significant multimedia component, high data-rates are required if the user experience is to be a positive one. For less data-intensive applications, the nature of the wireless connection may not be so important.

1394

Y. Liu, M.J. O'Grady, and G.M.P. O'Hare

3. Device: In recent years, the range of mobile devices in the marketplace has grown significantly. However, the essential features of each model are becoming increasingly disparate. This is a well-known issue and makes the design of applications for mobile devices a difficult and time-consuming task. Devices may differ in several regards including supported network protocols, multimedia formats supported, processor and memory, and screen size. Again, the nature of the application in question will determine the importance the designer attributes to each of these characteristics.

4 Modeling Context in Software Testing software applications is a difficult and time-consuming process. In the case of mobile users, the difficulties are exacerbated. It is just not practical for a developer to physically and repeatedly explore multiple environments while debugging their applications and services. A solution to this issue is the effective and realistic modeling of users' contexts in software. However, given the complexity of the scenarios that could be modeled, a conventional solution is inadequate. In practice, deriving and maintaining a dynamic model of a user's context demands that a degree of intelligence be exhibited. Thus, the intelligent agent paradigm has been identified as one that can encapsulate the necessary intelligence and around which individual context elements can be effectively modeled. A number of agent models exist [11], one of which is the Belief-Desire-Intention (BDI) [12] model. In this model, an agent can maintain a model of its environment via a set of beliefs. Its objectives, or reasons for existing, are maintained as a set of desires. Depending on its mental state, that is, the state of its environment, it may be in a position to satisfy some of its desires (objectives) at certain times. These desires that it can carry out are formulated as intentions which the agent proceeds to fulfill. It can be easily seen that these mentalistic notions of belief-desire-intention offer intuitive constructs around which context may be modeled and resultant user behavior determined. Thus the context simulation framework is envisaged as a Multi-Agent System (MAS) in which a suite of agents collaborate so as to derive a model of a user's behavior based on certain contextual cues. This is a particularly apt solution for those cases where the mobile application is itself an MAS; a scenario that is increasingly realistic, as the recent porting of MAS runtime engines to portable devices testifies. Assuming the agents employ an Agent Communication Language (ACL) that conform to an international standard, for example, the Foundation for Intelligent Physical Agents (FIPA), issues concerning interoperability are reduced significantly. Using the framework with other non-agent solutions is possible. However, this necessitates the development of a protocol translator for interfacing with the framework. In itself, this is not particularly difficult, but it does increase the workload of the designer and programmer somewhat. However, a simpler solution has been adopted using a blackboard metaphor. At present, a snapshot of the prevailing context during a simulation is regularly posted to a shared blackboard from where it can be queried by the application under test.

Scalable Context Simulation for Mobile Applications

1395

4.1 Design The context simulation framework can be divided into two main parts, one part is Graphical User Interface (GUI) that facilitates interaction between the framework and the software engineer to display simulated end-user behaviors in a physical environment. The second part consists of those agents that model the individual context elements. The framework consists of the following components (Fig. 1): − Scenario Agent – simulates the user movement based on policies specified by the software tester. For example, the speed at which the subject follows the selected path may be adjusted. Furthermore, the tester may zoom in around certain buildings and define very fine grained trajectories. In this way, the behavior of the system under examination can be scrutinized in areas where difficulties may be expected. − GUI Manager – updates the display accordingly based on prompts from the Scenario Agent, allowing the tester track the position of the subject. − IO Manager – manages input from the software tester regarding configuration of the framework. − Message Router – passes messages to the application or service under test. − Spatial Agent – Simulates spatial data for the current user position. In this case, standard data that in normal circumstances would be gleaned from GPS NMEA sentences, namely longitude, latitude and orientation, is produced. − Context Agent – an agent template that can be extended by the tester to generate the required simulated context. The context simulated is of course application dependent. A simple m-commerce example might be that of an agent that maintains a model of the shops in a neighborhood and identifies the nearest one to

Context Simulator GUI Manager

Mobile Application IO Handler

Spatial Agent

Scenario Agent

Context Agent

Context Agent

GUI Agent

Spatial Agent

Content Agent

Message Router Message Router

Fig. 1. Architecture of the Context Simulator

1396

Y. Liu, M.J. O'Grady, and G.M.P. O'Hare

the shopper, possibly forming the basis of mobile shopping assistant type application. It is precisely this ease with which additional context simulating agents can be incorporated into the framework that makes it extensible. Though mobile applications differ substantially in the services they offer, experience gained from designing agent-based mobile applications [15][16][17] suggests a core kernel of agents augmented with further agents as the particular application domain demands: − GUI Agent – responsible for all I/O activities including display management and capturing user input. − Content Agent – downloads appropriate content and collaborates with the Spatial Agent and GUI Agent to display the content at the appropriate tine, that is, when the Spatial Agent determines that the user is at the required position − Spatial Agent – will usually interface with a GPS device, ascertain the current position, and inform other agents of the user's current spatial context. 4.2 Implementation The entire framework is implemented in Java. All agents are implemented using Agent Factory [13][14]. The Agent Factory framework is a complete agent prototyping environment, providing a suite of facilities for the rapid prototyping of agent-based applications including: prototype agent designs; language interpreters and compilers; a fully functional IDE; and agent and platform viewers. An Agent Factory agent conforms to the BDI paradigm. The GUI consists of a number of graphical components which are implemented using the Java Swing API. The GUI is dominated by the map panel which has two layers: − the map layer, on which a geo-coded map is rendered; − the route layer, on which routes are specified. Further elements of the GUI include elements for configuring the Scenario Agent, as well as checking the status of the agents that model the user's context. An outline of the GUI may be seen in Fig. 2. The tester initially sets the degree of granularity using the zoom function. A path is then marked out for the simulated user to follow. Using the simulation control buttons, the simulation can be started, paused and stopped as necessary. The Scenario Agent controls the simulation as per the tester's directives. The Spatial Agent calculates the corresponding spatial context. In this case, a Shop Agent has been implemented that identifies the nearest shop. Agent Factory, along with a number of other agent development environments has been extended in recent years such that its agents can operate on standard mobile devices. Agent Factory Micro Edition (AFME) [18] is one example. It requires the lightweight version of Java - J2ME. As most modern mobile phones and PDAs support this implementation, deploying AFME agents on the next generation of mobile devices will be relatively straightforward, even allowing for the limited computational resources characteristic of such devices.

Scalable Context Simulation for Mobile Applications

1397

Defined route for simulation

Initial position of "end-user"

Zoom in function

Stop simulation

Zoom out function

Pause simulation

Highlight area

Pause simulation

Restore Defaults

Erase simulation route Define simulation route

Fig. 2. User paths are specified via the GUI

4.3 Enabling Communication Between Simulator and Application One distinguishing characteristic of intelligent agents is their social ability. All agents support an Agent Communication Language (ACL) of some variety, although most now seek to utilize an ACL that is FIPA compliant. Agent Factory has its own ACL implementation – AF-APL. However, support for an ACL alone is not sufficient. A mechanism for routing message between agents must also be supported. Agent Factory includes a Message Transport Service (MTS) that delivers this functionality. For messages between different physical platforms, the http protocol is used. For messages between agents residing on the same platform, a local MTS has been implemented. So for simulation purposes, the simulator itself can be hosted on one workstation and application for testing may be either hosted on the actual device or, more likely, on a emulator running on a local workstation. In the former case, however, it is essential that security issues are addressed, as in essence, the IP address will belong to the local network operator. To establish communication between the simulator and the application, it is necessary to infuse a number of rules into the appropriate agents. For the purposes of this discussion, we consider the simple case of the Spatial Agent on the simulator sending simulated positional data to its namesake on the application.

1398

Y. Liu, M.J. O'Grady, and G.M.P. O'Hare

1. The Spatial Agent on the Simulator, on being informed that the Scenario Agent has moved the simulation forward one step, calculates the simulated spatial context, in this case, longitude, latitude and heading. It must then inform the Spatial Agent on the mobile application of the new situation. Hence, a rule similar to the following will be activated: BELIEF(newSimulatedPosition(?longitude, ?latitude, ?heading)) & BELIEF(positionRequested(?agent, ?address) => COMMIT(Self,Now,BELIEF(true),(inform(?agent,?address, newPosition(?longitude, ?latitude, ?heading))));

In AF-APL, tokens denoted with the "?" symbol are placeholders, for example "?agent" would have the value "Spatial Agent" and "?address" would contain the IP address of the device the agent is deployed on. So the "Spatial Agent @ " will be informed that a new position is available and that new values for the user's position are represented in the passed parameters. 2. In the case of the Spatial Agent running on the device, it must likewise be augmented with a rule for processing the input from the simulator. In this case, however, the agent will treat the input as though it was from the GPS device, and the application will function as it would be expected do when deployed. BELIEF(fipaMessage(inform,?sender,newPosition(?longitude, ?latitude, ?heading))) => COMMIT(Self,Now,BELIEF(true),processNewPosition(?longitude, ?latitude, ?heading));

This rule completes the process started on the simulator. On being informed that a new position is available, the agent commits to processing this new information. The actuator "processNewPosition" is in essence a method in the agent class file that implements the logic for handling this scenario, perhaps by requesting the GUI Agent to update the display, should the application comprise a component that displays the user's position in real time. In this example, it can be seen that the process of directing output from the simulator to the application under test is relatively straightforward. Moreover, the process for simulating additional contextual cues is identical. An agent is incorporated into the Simulator and infused with the necessary logic to realistically simulate the provision of the required aspect of the user's context. Hence the Simulator is inherently scalable, and the interplay between individual contextual parameters may be explored. In straightforward cases, there may be a peer-to-peer relationship between the agents on the simulator and those on the device, such as with the Spatial Agent case just outlined. However, this will not always be the case, as it may not prove feasible to implement a 1-to-1 relationship between individual agents and the context cues it monitors, due to the computational overhead involved.

5 Future Work Given the wide variety of situations where mobile computing applications and services can be deployed, it can be seen that the more realistic the model of the user's context is, the more useful such a framework would be in the software development process. Therefore it is planned to augment the number of context elements further.

Scalable Context Simulation for Mobile Applications

1399

For example, the accurate simulation of a wireless connection is essential. In particular, the modeling of latency, as well as the variable and unpredictable datarates such as one would normally encounter, would significantly added to the realism of the context model. Another issue concerns developing a more realistic model of spatial context. In the case of GPS, signal quality may vary and, particularly in so called urban canyons, the signal can be lost entire albeit temporally. Verifying the robustness of an application in such circumstances is of critical importance. Though a user's movements can be modeled at present, there is significant scope and motivation for facilitated more realistic and sophisticated user behavior. In practice, people may stop at pedestrian crossings, do some window shopping and so on. They may also get lost! Thus modeling elements of variable and unpredictable behavior, would add a significant degree of realism to the context models. Extensibility is of critical importance if third party software engineers wish to develop models of the context that is relevant to their individual applications. Though intelligent agents offer an intuitive mechanism by which this can be achieved, the process of incorporating third-party agents is currently somewhat unwieldy and difficult. Therefore it is planned to simplify this process considerable. As part of this, the specification of a basic ontology that developers could extend and enhance according to their individual needs will be considered.

6 Conclusion Services and applications for mobile users will form a significant revenue generator for many software houses and consultancies over the coming years. Therefore, there will be an increasing demand for sophisticated toolkits and frameworks that support the modeling of user behaviors and the derivation of appropriate context elements. In this paper, we have described one such framework. Intelligent agents form the core entities around which the framework is constructed and offer interesting possibilities for modeling complex and dynamic user behavior. In developing this context modeling framework, we have demonstrated one viable approach by which the needs of a new generation of software engineers may be addressed.

Acknowledgements This material is based upon works supported by the Science Foundation Ireland (SFI) under Grant No. 03/IN.3/1361.

References 1. Aarts, E, Marzano, S. (editors), The New Everyday: Views on Ambient Intelligence, 010 Publishers, Rotterdam, The Netherlands, 2003. 2. Barton, J., Vijayaraghavan, V., Ubiwise: A Ubiquitous Wireless Infrastructure Simulation Environment, tech. report HPL-2002- 303, HP Labs, 2002. 3. Morla, R., Davies, N., Evaluating a Location-based Application: A Hybrid Test and Simulation Environment, IEEE Pervasive Computing, 3(3), pp. 48-56, 2004.

1400

Y. Liu, M.J. O'Grady, and G.M.P. O'Hare

4. Bylund, M. Espinoza, F., Testing and Demonstrating Context-aware Services with Quake III Arena, Communications of the ACM, 45 (1), 46-48, 2002. 5. Satoh, I., Software Testing for Wireless Mobile Computing, IEEE Wireless Communications, 11(5), pp. 58-64, October 2004. 6. Satoh, I., A Testing Framework for Mobile Computing Software, IEEE Transactions on Software Engineering, 29(12), pp. 1112-1121, December 2003. 7. Hou, Q., Zhu, H., Greenwood, S., A Multi-Agent Software Environment for Testing Webbased Applications. Proceedings of the 27th Annual International Computer Software and Applications Conference (COMPSAC'03), Dallas, Texas, 2003, pp. 10-15. 8. Narendra, N.C., Large Scale Testing of Pervasive Computing Systems Using Multi-Agent Simulation. Proceedings of the Third Workshop on Intelligent Solutions in Embedded Systems (WISES'05), Hamburg, Germany, 2005, pp. 27-38. 9. Greenberg, S. "Context as a Dynamic Construct," Human-Computer Interaction, Vol. 16, pp. 257-268, 2001. 10. Ubisense, http://www.ubisense.net/ 11. Wooldridge, M., Jennings, N.R., Intelligent Agents: Theory and Practice, The Knowledge Engineering Review, vol.10, no.2, 1995, pp. 115-152. 12. Rao, A.S., Georgeff, M.P., Modelling Rational Agents within a BDI Architecture. In: Principles of Knowledge Representation. & Reasoning, San Mateo, CA. 1991. 13. Collier, R., O’Hare, G. M. P. Lowen, T. D., and Rooney, C. F. B., Beyond Prototyping in the Factory of Agents, In Proc. 3rd Int. Central and Eastern European Conference on Multi-Agent Systems (CEEMAS), Prague, Czech Republic, 2003. 14. O’Hare G.M.P., Agent Factory: An Environment for the Fabrication of Multi-Agent Systems, in Foundations of Distributed Artificial Intelligence (G.M.P. O’Hare and N. Jennings eds) pp. 449-484, John Wiley and Sons, Inc., 1996. 15. O'Grady, M.J., O'Hare, G.M.P., Just-in-Time Multimedia Distribution in a Mobile Computing Environment, IEEE Multimedia, vol. 11, no. 4, pp. 62-74, 2004. 16. Keegan, S, & O'Hare, G.M.P., EasiShop - Agent-Based Cross Merchant Product Comparison Shopping for the Mobile User, proceedings of ICTTA '04, Syria, 2004. 17. Strahan, R., O’Hare, G.M.P., Phelan, D., Muldoon, C., Collier, R., ACCESS: An Agent based Architecture for the Rapid Prototyping of Location Aware Services, 5th International Conference on Computational Science, Emory University Atlanta, 2005. 18. Muldoon, C., O’Hare, G. M. P., Collier, R. W., O’Grady, M. J., Agent Factory Micro Edition: A Framework for Ambient Applications, proceedings of the Intelligent Agents in Computing System Workshop, ICCS, Reading, UK, 2006.