scieee AI-readable full text Open interactive document viewer

Repositorio Institucional de Documentos

Abstract

Las arquitecturas software son una valiosa herramienta para la evaluación de las propiedades cualitativas y cuantitativas de los sistemas en sus primeras fases de desarrollo. Conseguir el diseño adecuado es crítico para asegurar la bondad de dichas propiedades. Tomar decisiones tempranas equivocadas puede implicar considerables y costosos cambios en un futuro. Dichas decisiones afectarían a muchas propiedades del sistema, tales como su rendimiento, seguridad, fiabilidad o facilidad de mantenimiento. Desde el punto de vista del rendimiento software, la ingeniería del rendimiento del software (SPE) es una disciplina de investigación madura y comúnmente aceptada que propone una evaluación basada en modelos en las primeras fases del ciclo de vida de desarrollo software. Un problema en este campo de investigación es que las metodologías hasta ahora propuestas no ofrecen una interpretación de los resultados obtenidos durante el análisis del rendimiento, ni utilizan dichos resultados para proponer alternativas para la mejora de la propia arquitectura software. Hasta la fecha, esta interpretación y mejora requiere de la experiencia y pericia de los ingenieros software, en especial de expertos en ingeniería de prestaciones. Además, a pesar del gran número de propuestas para evaluar el rendimiento de sistemas software, muy pocos de estos estudios teóricos son posteriormente aplicados a sistemas software reales. El objetivo de esta tesis es presentar una metodología para el asesoramiento de decisiones arquitecturales para la mejora, desde el punto de vista de las prestaciones, de las sistemas software. La metodología hace uso del Lenguaje Unificado de Modelado (UML) para representar las arquitecturas software y de métodos formales, concretamente redes de Petri, como modelo de prestaciones. El asesoramiento, basado en patrones y antipatrones, intenta detectar los principales problemas que afectan a las prestaciones del sistema y propone posibles mejoras para mejoras dichas prestaciones. Como primer paso, estudiamos y analizamos los resultados del rendimiento de diferentes estilos arquitectónicos. A continuación, sistematizamos los conocimientos previamente obtenidos para proponer una metodología y comprobamos su aplicabilidad asesorando un caso de estudio real, una arquitectura de interoperabilidad para adaptar interfaces a personas con discapacidad conforme a sus capacidades y preferencias. Finalmente, se presenta una herramienta para la evaluación del rendimiento como un producto derivado del propio ciclo de vida software. Gómez Martínez, María Elena; Merseguer Hernáiz, José Javier

Full text

2014 19 María Elena Gómez Martínez Software Perfomance Assessment at Architectural Level: a Methodology and its Application Departamento Director/es Informática e Ingeniería de Sistemas Merseguer Hernáiz, José Javier Director/es Tesis Doctoral Autor Repositorio de la Universidad de Zaragoza – Zaguan http://zaguan.unizar.es UNIVERSIDAD DE ZARAGOZA Departamento Director/es Autor María Elena Gómez Martínez SOFTWARE PERFOMANCE ASSESSMENT AT ARCHITECTURAL LEVEL: A METHODOLOGY AND ITS APPLICATION UNIVERSIDAD DE ZARAGOZA Informática e Ingeniería de Sistemas Director/es Merseguer Hernáiz, José Javier Tesis Doctoral Repositorio de la Universidad de Zaragoza – Zaguan http://zaguan.unizar.es 2013 Departamento Director/es Director/es Tesis Doctoral Autor Repositorio de la Universidad de Zaragoza – Zaguan http://zaguan.unizar.es UNIVERSIDAD DE ZARAGOZA Software Performance Assessment at Architectural Level: a Methodology and its Application Mar´ıa Elena G´omez Mart´ınez Ph.D. DISSERTATION Departamento de Inform´atica e Ingenier´ıa de Sistemas Universidad de Zaragoza Advisor: Dr. Jos´e Javier Merseguer Hern´aiz December 2013 A los tres hombres de mi vida, con todo mi amor: Jos´e Antonio, Alejandro y Carlos. Me lo contaron y lo olvid´e; lo vi y lo entend´ı; lo hice y lo aprend´ı. Confucio S´olo s´e que no s´e nada y, al saber que no s´e nada, algo s´e; porque s´e que no s´e nada. Socrates Agradecimientos En primer lugar, me gustar´ıa agradecer a mi director de tesis, Jos´e Merseguer, por su apoyo, est´ımulo y buenos consejos para realizaci´on de esta tesis, pero sobre todo por la infinita paciencia que ha tenido conmigo. Esta tesis ha sido larga, muy larga, pero al fin ha salido. ¡Muchas gracias! Mi agradecimiento especial es para uno de los mejores profesores que he tenido, Javier Campos, por darme la oportunidad de poder comenzar mi doctorado. Aunque un poco m´as tarde de lo habitual, me permiti´o conocer mi verdadera vocaci´on. No puedo olvidar de mencionar a mis compa˜neros de laboratorio en la Universidad de Zaragoza durante la primera parte de mi doctorado: Juan Pablo, Simona, Mar´ıa, Anacris, Dario, Diego... me olvido de muchos, pero me es imposible poner a todos. Tambi´en quiero agradecer a mis compa˜neros (y amigos) de I+D de Technosite en el proyecto INREDIS, entre ellos Lourdes, Esteban y Marta, a Sara, por ser mi “or´aculo” particular, a Fausto, por su profundo conocimiento de todo lo relacionado con la discapacidad, a Jos´e “Guti”, por ayudarme con las pruebas y, en especial, a Rafa por su imprescindible aportaci´on en la arquitectura de interoperabilidad. Trabajar con todos ellos fue un aut´entico placer. All´ı aprend´ı el valor de la superaci´on personal de muchas personas con discapacidad y de c´omo la tecnolog´ıa puede mejorar sus vidas. Tampoco me puedo olvidar de mis compa˜neros de investigaci´on del grupo Babel en la Universidad Polit´ecnica de Madrid, en particular a Guillem, Ricardo, Clara y, en especial, a ´ Alvaro por sus ´animos en esta ´ultima etapa. ¡Los necesitaba! A mi amiga Esther, por estar siempre ah´ı para escucharme y darme ´animos en los momentos que m´as me hac´ıan falta. Me siento afortunada de tener una amiga como ella. Agradecer a mis familias: De la que vengo, a mis padres y hermanos por ense˜narme el valor del trabajo y el esfuerzo; a la que me “encontr´e”, mis suegros Antonio y Mar´ıa del Carmen, por tratarme como a una hija y darme todo su apoyo; y la que he formado junto a mi marido, mis hijos Alejandro y Carlos, por dejarme robarles tiempo para esta tesis. Sus sonrisas son el motor de mi vida. Os quiero mucho. Finalmente, quiero dar las gracias a mi marido Jos´e Antonio. No encuentro palabras para escribir en unas l´ıneas todo lo que le tengo que agradecer. Gracias por ser mi compa˜nero, amigo, pareja, esposo, amante, padre de mis hijos... por compartir conmigo este extra˜no y apasionante viaje que es la vida. Sin ti, sin tu ayuda y sin tus ´animos, hubiera sido imposible hacer esta tesis. Gracias por todo, cielo. Te quiero. iii 5.3.4 Performance Assessment . . . . . . . . . . . . . . . . . . . . . . 139 5.3.5 Optimal Configuration . . . . . . . . . . . . . . . . . . . . . . . 146 5.3.6 Validation of the Performance Assessment . . . . . . . . . . . . 146 5.3.7 Comparison of Results . . . . . . . . . . . . . . . . . . . . . . . 148 5.4 Discussion.................................. 150 5.4.1 Concerning the Methodology . . . . . . . . . . . . . . . . . . . 150 5.4.2 Concerning the Optimal Configuration . . . . . . . . . . . . . . 152 5.5 RelatedWork................................ 153 5.6 Conclusions................................. 155 6 The ArgoSPE Tool 157 6.1 ArgoSPEFeatures ............................. 157 6.1.1 Queries in the Statechart Diagram . . . . . . . . . . . . . . . . 158 6.1.2 Queries in the Deployment and Collaboration Diagrams . . . . 159 6.1.3 Performance Annotations . . . . . . . . . . . . . . . . . . . . . 159 6.2 Software Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 6.2.1 ModelEditor............................ 160 6.2.2 ModelConfigurer.......................... 161 6.2.3 ModelProcessor .......................... 162 6.3 RelatedWork................................ 164 6.4 Conclusions................................. 165 7 Final Conclusions and Future Work 167 7.1 Achievements................................ 167 7.2 ScientificResults .............................. 169 7.3 FutureResearch .............................. 172 Bibliography 173 Index 190 iv List of Figures Figure2.1: SPEprocess............................. 17 Figure 2.2: PUMA approach . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Figure 3.1: CDSS: UML Sequence Diagram for the invocation process . . . 28 Figure 3.2: CDSS: Performance results obtained by Catley et al. (2004) . . 29 Figure 3.3: CDSS: CSM for invocation . . . . . . . . . . . . . . . . . . . . 30 Figure 3.4: CDSS: CSM for process . . . . . . . . . . . . . . . . . . . . . . 31 Figure 3.5: CDSS: GSPN representing the whole scenario . . . . . . . . . . 32 Figure 3.6: CDSS: Response times obtained from the GSPN model . . . . 33 Figure 3.7: CDSS: UML Sequence Diagram with tunning . . . . . . . . . . 35 Figure 3.8: CDSS: Response times for different XML parsers . . . . . . . . 35 Figure 3.9: CDSS: UML Sequence Diagram with SOAP toolkit . . . . . . . 37 Figure 3.10: CDSS: Response times for different SOAP implementations . . 37 Figure 3.11: CDSS: Response times when EPR file increases in size . . . . . 38 Figure 3.12: CDSS: Response times when CDSS processing time increases . 39 Figure 3.13: SPRINGS: Architecture for mobile agent platforms . . . . . . . 43 Figure 3.14: SPRINGS: UML Sequence Diagram for agent movement . . . . 45 Figure 3.15: SPRINGS: UML Sequence Diagram for agents communication 46 Figure 3.16: SPRINGS: UML Deployment Diagram of the architecture . . . 47 Figure 3.17: SPRINGS: UML IOD of the performance scenario . . . . . . . 48 Figure 3.18: SPRINGS: CSM for agent movement . . . . . . . . . . . . . . . 50 Figure 3.19: SPRINGS: CSM for agents communication . . . . . . . . . . . 51 Figure 3.20: SPRINGS: GSPN for agent movement . . . . . . . . . . . . . . 52 Figure 3.21: SPRINGS: GSPN for agents communication . . . . . . . . . . . 53 Figure 3.22: SPRINGS: Response times . . . . . . . . . . . . . . . . . . . . 54 Figure 3.23: SPRINGS: Response times when multithreading contexts . . . 55 Figure 3.24: SPRINGS: Response times when multithreading (II) . . . . . . 56 Figure 3.25: SPRINGS: Sensitivity analysis . . . . . . . . . . . . . . . . . . 57 Figure 3.26: UCH: Components of the architecture . . . . . . . . . . . . . . 61 Figure 3.27: UCH: UML Sequence Diagram for device control process . . . 63 Figure 3.28: UCH: UML Sequence Diagram for a value set request . . . . . 64 Figure 3.29: UCH: UML Deployment Diagram . . . . . . . . . . . . . . . . 65 Figure3.30:UCH:CSM ............................. 67 v vi LIST OF FIGURES Figure 3.31: UCH: GSPN for a value set request . . . . . . . . . . . . . . . 68 Figure 3.32: UCH: Response times for 40 users . . . . . . . . . . . . . . . . 69 Figure 3.33: UCH: Response times . . . . . . . . . . . . . . . . . . . . . . . 70 Figure 3.34: UCH: Response times when multithreading . . . . . . . . . . . 71 Figure 3.35: UCH: Optimal configuration . . . . . . . . . . . . . . . . . . . 71 Figure 4.1: Performance assessment methodology loop . . . . . . . . . . . . 74 Figure 4.2: Producer-Consumer example: UML Deployment Diagram. . . . 77 Figure 4.3: Producer-Consumer example: UML State Machine Diagram. . 78 Figure 4.4: Producer-Consumer example: UML Sequence Diagram. . . . . 79 Figure 4.5: MARTE: subset of GQAM and GRM . . . . . . . . . . . . . . 81 Figure 4.6: MARTE: pre-declared NFP types . . . . . . . . . . . . . . . . . 82 Figure 4.7: Producer-Consumer example: GSPN. . . . . . . . . . . . . . . 88 Figure 4.8: Producer-Consumer example: Closed-cycle GSPN. . . . . . . . 90 Figure 4.9: Producer-Consumer: Scalability . . . . . . . . . . . . . . . . . 93 Figure 4.10: Producer-Consumer: Utilization . . . . . . . . . . . . . . . . . 94 Figure 4.11: Producer-Consumer: Resource replication . . . . . . . . . . . . 95 Figure 4.12: Producer-Consumer: Utilization when multithreading . . . . . 96 Figure 4.13: Pattern detection algorithm . . . . . . . . . . . . . . . . . . . . 99 Figure 4.14: Antipattern detection algorithm . . . . . . . . . . . . . . . . . 102 Figure 5.1: INREDIS: UML Deployment Diagram . . . . . . . . . . . . . . 111 Figure 5.2: INREDIS: UML IOD of the main processes . . . . . . . . . . . 112 Figure 5.3: INREDIS: UML Sequence Diagram for first interaction . . . . 114 Figure 5.4: INREDIS: UML Sequence Diagram for perimeter calculation . 115 Figure 5.5: INREDIS: UML Sequence Diagram for initial interface generation117 Figure 5.6: INREDIS: UML Sequence Diagram for a navigation . . . . . . 118 Figure 5.7: INREDIS: UML Sequence Diagram for an interface generation 120 Figure 5.8: INREDIS: UML Sequence Diagram for a user’s device interaction121 Figure 5.9: INREDIS: UML Sequence Diagram for a back-to-top . . . . . . 122 Figure 5.10: INREDIS: UML Activity Diagram for AS selection . . . . . . . 124 Figure 5.11: INREDIS: GSPN for first interaction scenario . . . . . . . . . . 127 Figure 5.12: INREDIS: GSPN for navigation scenario . . . . . . . . . . . . . 128 Figure 5.13: INREDIS: GSPN for device interaction scenario . . . . . . . . 129 Figure 5.14: INREDIS: GSPN for back-to-top scenario . . . . . . . . . . . . 130 Figure 5.15: INREDIS: GSPN for ASSM scenario . . . . . . . . . . . . . . . 131 Figure 5.16: INREDIS: Empirical response times . . . . . . . . . . . . . . . 135 Figure 5.17: INREDIS: Response times of performance models . . . . . . . 136 Figure 5.18: INREDIS: Empirical response times of ASSM . . . . . . . . . . 137 Figure 5.19: INREDIS: Response times of ASSM using models . . . . . . . 138 Figure 5.20: INREDIS: Resource utilization . . . . . . . . . . . . . . . . . . 140 Figure 5.21: INREDIS: Response times when multithreding . . . . . . . . . 141 Figure 5.22: INREDIS: Resource utilization (II) . . . . . . . . . . . . . . . . 141 Figure 5.23: INREDIS: Response times when multithreding (II) . . . . . . . 142 Figure 5.24: INREDIS: Response times when multithreding (III) . . . . . . 142 LIST OF FIGURES vii Figure 5.25: INREDIS: Response times with Fast Path pattern . . . . . . . 143 Figure 5.26: INREDIS: The Ramp antipattern . . . . . . . . . . . . . . . . . 145 Figure 5.27: INREDIS: Response times for specific recommender of ASSM . 146 Figure 5.28: INREDIS: Response times for the optimal configuration . . . . 147 Figure 5.29: INREDIS: Comparison of results (I) . . . . . . . . . . . . . . . 148 Figure 5.30: INREDIS: Comparison of results (II) . . . . . . . . . . . . . . . 149 Figure 6.1: ArgoSPE: An example . . . . . . . . . . . . . . . . . . . . . . . 158 Figure 6.2: ArgoSPE: Architecture proposed by OMG . . . . . . . . . . . . 161 Figure 6.3: ArgoSPE: Snapshot . . . . . . . . . . . . . . . . . . . . . . . . 162 Figure 6.4: ArgoSPE: Example of a configuration file . . . . . . . . . . . . 163 viii LIST OF FIGURES List of Tables Table 3.1: CDSS: Mean execution times of XML parsers . . . . . . . . . . 34 Table 3.2: CDSS: Mean execution times of SOAP toolkits . . . . . . . . . 36 Table 3.3: CDSS: Mean execution times of EPR size . . . . . . . . . . . . 38 Table 3.4: SPRINGS: Mean execution times of operations . . . . . . . . . 49 Table 3.5: UCH: Mean execution times of operations . . . . . . . . . . . . 65 Table 4.1: Subset of performance annotations in MARTE. . . . . . . . . . 85 Table 4.2: Translation rules of the performance annotations in MARTE intoGSPNmodels.......................... 86 Table 4.3: Performance patterns . . . . . . . . . . . . . . . . . . . . . . . 98 Table 5.1: INREDIS: Results in seconds for each performance scenario . . 136 Table 5.2: INREDIS: Probabilities rates of ASSM . . . . . . . . . . . . . . 137 Table 6.1: ArgoSPE: Supported performance annotations . . . . . . . . . 160 ix xLIST OF TABLES List of Acronyms AD Activity Diagram AS Assistive Software ASSM Assistive Software Selection Mechanism CDSS Clinical Decision Support Systems CSM Core Scenario Model CTMC Continuous-Time Markov Chain DD Deployment Diagram DOM Document Object Model EQN Extended Queueing Network FTP File Transfer Protocol GRM Generic Resource Modeling GSPN Generalized Stochastic Petri Nets GQAM Generic Quantitative Analysis Modeling HCI Human Computer Interaction HTTP HyperText Transfer Protocol ICT Information and Communications Technology INREDIS INterfaces for RElations between Environment and people with DISabilities IOD Interaction Overview Diagram ISO International Standard Organization KB Knowledge Base xi xii LIST OF ACRONYMS LQN Layered Queueing Network MARTE Modeling and Analysis of Real-Time and Embedded systems MDA Model Driven Architecture NFP Non Functional Properties OMG Object Management Group PASA Performance Assessment of Software Architectures PDF Probability Distribution Function PEPA Performance Evaluation Process Algebra pmf probability mass function PN Petri nets PSM Platform Specific Models PUMA Performance by Unified Model Analysis QN Queueing Network QoS Quality of Service SA Software Architecture SAX Simple API for XML SD Sequence Diagram SM State Machine Diagram SMG Stochastic Marked Graph SMTP Simple Mail Transfer Protocol SOA Service-Oriented Architecture SOAP Simple Object Access Protocol SPA Stochastic Process Algebra SPE Software Performance Engineering SPN Stochastic Petri net SPPN Stochastic Process Petri Net SPT UML profile for Schedulability, Performance and Time Chapter 2 Preliminary Concepts This chapter relates the work of this thesis to relevant research fields. It is subdivided into a number of sections. First, software architectures are described including architectural styles in Section 2.1. This is followed by the explanation of UML in Section 2.2 that allows to model software architecture. Then, software performance engineering in Section 2.3 is contextualized to be aware with its principles and objectives and to know the techniques and models used in this area. Finally, a brief introduction to Petri nets in Section 2.4 is presented. In each section, there is also an explanation of how the thesis is related to each area. Finally, some conclusions concerning this chapter are given in Section 2.5. 2.1 Software Architectures The Software Architecture (SA) of a program or computer system is the structure or structures of the system, which comprise software components, the externally visible properties of those components, and the relationships among them (Bass et al., 2005). A software architecture is an abstraction of the run-time elements of a software system during some phase of its operation. A system may be composed of many levels of abstraction and many phases of operation, each with its own software architecture (Shaw, 1990; Shaw and Garlan, 1996). Hence, at the heart of software architecture is the principle of abstraction: hiding some of the details of a system through encapsulation in order to better identify and sustain its properties (Shaw, 1990). A complex system will contain many levels of abstraction, each with its own architecture. An architecture represents an abstraction of system behaviour at that level, such that architectural elements are delineated by the abstract interfaces they provide to other elements at that level (Bass et al., 2005). Other definition can be found in the 42010:2011 standard, which defines a architecture as “the fundamental organization of a system embodied in its components, their relationships to each other and to the environment and the principles guiding its designs and evolution” (ISO/IEC/IEEE, 2011). This standard describes an archi- 5 62. Preliminary Concepts tecture using Unified Modeling Language (UML) class diagrams to represent these elements. Therefore, a software architecture models the structure and behaviour of a system. Focussing on these aspects, quality attributes such as usability, performance, reliability, and security indicates the success of the design and the overall quality of the software application. Moreover, some of these properties are determined by the structure or architectural style. In this work, we analyse and assess software architectures in the design phase with respect to software performance using Software Performance Engineering (SPE) techniques. Thus, we describe software architectures expressed in terms of UML diagrams. 2.1.1 Architectural Style Software architecture of a large system can be guided by using architectural styles and design patterns (Bass et al., 2005; Monroe et al., 1997). It describes the organization of a family of systems that share common features. Architectural styles are closely related to design patterns in two ways. First, architectural styles can be viewed as kinds of patterns (Shaw and Garlan, 1996) or perhaps more accurately as pattern languages (Kerth, 1995). There are many recognized architectural patterns and styles (Garlan and Shaw, 1993): •Data-centered architectures. They aim to achieve the quality of integrability data. Basically, a centralized data store communicates with a number of clients, which use data manipulation protocols to work with the data. Some of the most well-known example are a database architecture or web architecture. •Data-flow architectures. They aim to achieve the quality of reuse and modifiability. This style is characterized by viewing the system as a series of transformations on successive pieces of input data. Some examples are networking architectures. •Abstraction layer architectures. The structure of the system is organized into set of layers. These architectures focus on a hierarchical distribution of roles and responsibilities. The role denotes the type and the mode of interaction with other layers and the responsibility indicates the functionality. Operating Systems are typically organized into layers, as well as network protocol stack, such as TCP/IP. •N-tier architectures. The functionality is divided into different segments, but each segment is physically located on separated platforms. Each layer interacts with only the layer directly below, and has specific function that it is responsible for. Client-Server systems are defined with two-tier architectures. Most of the web applications are based on three-tier architectures, which typically comprise a presentation tier, a business or data access tier, and a data tier. 2.1. Software Architectures 7 •Notification architectures. The information and activity is propagated by a notification mechanism. Thus, when an event occurs the interested component is notified. •Remote invocation and service architectures. These architectures involve distributed processing components. Typically, a client component invokes a method (function) on a remote component. Service-oriented architectures introduce a special component where services are registered. Any component interested in a services asks that component for the address of that service. •Heterogeneous architectures. Since no real system follows strictly only a single style, architectures might be conceptually, structurally, executional heterogeneous. For instance, a Web-based search engine might be conceptually data-centric, layered and three tier. From the structure viewpoint might follow layered and notification style. And its execution might be distributed, serviceoriented and notification. Next, we briefly describe Service-Oriented Architectures and Mobile Agent-Based System, since our work is mainly focused on them. Service-Oriented Architecture Service-Oriented Architecture (SOA) is a technology architectural model for service oriented solutions with distinct characteristics in support of realizing service orientation and the strategic goals associated with service oriented computing (Erl, 2007). Hence, SOA is a paradigm for developing and deploying business applications as a set of reusable services. SOA is not based on a specific technology or programming languages. Therefore, SOA is an architectural style whose goal is to achieve loose coupling among interacting software service, some of them acting as providers and others, as consumers (Erl, 2007). A service is a unit of work done by a service provider to achieve desired end results for a service consumer in SOA, services are the mechanism by which needs and capabilities are brought together. When a service is deployed on the net, it is named Web Service (WS). Web Services are universally accessible software components deployed on the Web, thus in a Web service architecture clients and services are loosely coupled and geographically distributed. One important characteristic is the heterogeneous and architecture-neutral of the computing platform. Therefore, one of the key ideas is that a Web service’s implementation and deployment platform are not relevant to the application that is invoking the service (Alonso et al., 2004). A refined definition is supplied by the World Wide Web Consortium (W3C) in (W3C, 2004): A Web service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP-messages, typ- 82. Preliminary Concepts ically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards. A Web service is a collection of protocols and standards used for exchanging data between applications. Software applications written in various programming languages and running on various platforms can use Web Services to exchange data over computer networks like the Internet, in a manner similar to inter-process communication on a single computer. This interoperability is due to the use of open standards such as the following and others: •Simple Object Access Protocol (SOAP) (W3C, 2007) is a W3C specification describing a way to use XML and HTTP to create information delivery and remote procedure mechanisms. It is a lightweight protocol for the exchange of information decentralized, distributed environment; therefore, it is a specification that defines a uniform way of passing XML-encoded data. Examples of transport protocols that may be used are HTTP, SMTP, FTP or POP3. Currently, the most used is HTTP over port 80, originally reserved by Web browsers. •Web Service Description Language (WSDL) (W3C, 2001) is an XML format for describing network services as a set of endpoint operating on messages containing either document-oriented or procedure-oriented information. WSDL is used to describe what services does, where they resides and how to invoke them. •Universal Description Discovery and Integration (UDDI) (OASIS, 2005) specifications define a way to publish and discover information about Web Services. It consists of several related documents and an XML schema that defines a SOAP-based programming protocol for registering and discovering Web Services. UDDI is a framework for Web Services integration. From a performance perspective, the discovery process involves the time to look up the service in the Web Services directory using UDDI. It is possible to assume a more simplistic approach, where the client has prior knowledge of the service addressed. In our work, we focus on the performance issues of industrial cases based on UCH and SOA with web services, cfr. Chapters 3 and 5. Mobile Agent Architecture In the traditional client/server architecture, a server at a certain computer offers a set of services to interested parties. Then, three steps take place: 1. a client located at another computer requests the execution of a service by interacting with the server, 2. the server performs the requested service, 3. the server returns the result to the client. 2.1. Software Architectures 9 As opposed to this classical approach, a mobile agent (Milojiˇci´c et al., 1999) is a software component that can move autonomously among computers, and so it can decide itself when and where to move in order to perform its tasks. Thanks to their mobility, mobile agents offer a range of unique advantages, such as autonomy, flexibility, and effective usage of network bandwidth (Lange and Oshima, 1999). For example, in a distributed information system a mobile agent can travel where the data are stored and process them locally, avoiding the need to communicate all the data over the network. Furthermore, in certain contexts they also exhibit a good performance compared with the traditional client/server approach (Spyrou et al., 2004; Mena et al., 2002). We analyse SPRINGS, a mobile agent-based architecture, from performance perspective in Chapter 3. 2.1.2 Architecture Assessment In the 24765:2010 Standard for Vocabulary of Systems and software engineering (ISO/IEC/IEEE, 2010), software quality is defined as the degree to which a system, a component, or a process meets specified requirements. Architecture assessment is an activity of the architecting process that is targeted to evaluate the degree of fulfillment of quality, or non-functional requirements (Del Rosso, 2006). Although there is a lack of consensus about the meaning and of non functional requirements or properties (NFP), as pointed out some authors (Glinz, 2007; Chung and Prado Leite, 2009), along this work, we follow the simple, but in our opinion very concise, definition proposed in (Espinoza et al., 2005): Functional properties describe what a system model does, and non-functional properties how it does it. Hence, nonfunctional requirements mostly define the overall attributes of the “resulting” system. The 29148:2011 Standard for Requirements engineering of Systems and software engineering (ISO/IEC/IEEE, 2011) enumerates a lists of 13 non-functional properties, among them: safety, security, usability, reliability and performance requirements. The 25010:2011 Standard for System and software quality models of Systems and software engineering (ISO/IEC, 2011b) denotes performance as a quality attribute that meets the functionality of the system with timeless and correctness. It defines also performance as efficiency that requires two main factors: time behaviour and resource efficiency. These factors usually address common performance metrics such as response time, throughput and utilization. Software performance assessment aims to evaluate and refine software architectures with respect of performance objectives as early as possible in the system development life-cycle. Thus, performance objectives include performance metrics with specific threshold. In this dissertation, we propose a scenario-based software architecture assessment that aims to meet performance objectives and is carried out using principles and techniques of the Software Performance Engineering (SPE) field, which are described in the following sections. 10 2. Preliminary Concepts 2.2 The Unified Modeling Language The UML, defined by the Object Management Group (OMG, 2011b), is a semi formal general-purpose visual modeling language that is designed to specify, visualize, construct and document the artifacts of software systems (Rumbaugh et al., 1999; Fowler, 2000). UML offers a standard way to write a system’s blueprints, including conceptual things such as business processes and system functions, as well as concrete things such as programming language statements, database schemas, and reusable software components (Rumbaugh et al., 1999). UML has been formally published as the standard 19505-1:2012 by the International Standard Organization (ISO/IEC, 2012). 2.2.1 UML Diagrams UML defines thirteen types of diagrams, divided into three categories: Six diagram types represent static application structure; three represent general types of behaviour; and four represent different aspects of interactions. •Structural Diagrams. Structure (or static) diagrams are intended to model the static structure (logical and architectural) of the objects in a system. That is, they depict those elements in a specification that are irrespective of time. They include the Class Diagram, Object Diagram, Component Diagram, Composite Structure Diagram, Package Diagram, and Deployment Diagram. •Behaviour Diagrams Behaviour diagrams show the dynamic behaviour of the objects in a system, including their methods, activities, and state histories. The dynamic behaviour of a system can be described as a series of changes to the system over time. They include the Use Case Diagram (used by some methodologies during requirements gathering), Activity Diagram, and State Machine Diagram. •Interaction Diagrams Interaction diagrams are all derived from the more general Behaviour Diagram. They include the Sequence Diagram, Communication Diagram, Timing Diagram, and Interaction Overview Diagram. In the following paragraphs, we outline the diagrams used for our work. For a more extended description, see the specification (OMG, 2011b). UML Deployment Diagram A UML Deployment Diagram (DD) depicts a static view of the execution architecture of a system that represents the allocation (deployment) of software artifacts to deployment nodes. It identifies the system software components as well as the hardware nodes in which the former are deployed and their relationships. Nodes (drawn as cubes) represent either hardware devices or software execution environments. Software components (represented as a rectangle and associated to a node through an arrow labelled deploy) represent the software that is installed. The relationships 2.2. The Unified Modeling Language 11 (drawn as lines) represent the middleware or the network used to connect the machines to one another. Use Case Diagrams A UML Use Case Diagram (UC) is used to model user (called actor) or system interactions in a horizontal way. They defines behaviour, requirements and constraints in the form of scripts or scenarios. UCs do not only represent details of individual features of a system, but they show all of its available functionality. A UC can extend another UC when the former is a special case behaviour of the latter. An actor does not necessarily represent a specific physical entity but merely a particular facet or role. An actor is represented by a “stick man” with its name. UML Activity Diagrams A UML Activity Diagram (AD) emphasizes the sequence of activities and conditions for coordinating lower-level behaviours of an object. Therefore, it shows the work flow from a start point to the finish point detailing the many decision paths that exist in the progression of events contained in the activity. State Machine Diagrams A UML State Machine Diagram (SM) depicts the various states that an object may be in and the transitions between those states. A state represents a stage in the behaviour pattern of an object. An initial state is the one that an object is in when it is first created, whereas a final state is one in which no transitions lead out of. UML Sequence Diagrams A UML Sequence Diagram (SD) is used primarily to show the interactions between objects in the sequential order that those interactions occur. It is used to model usage scenarios with respect to a timeline. Interaction Overview Diagrams A UML Interaction Overview Diagram (IOD) constitutes a high-level structuring mechanism that is used to compose scenarios through sequence, iteration, concurrency or choice. IODs are a special and restricted kind of ADs where the activity nodes are interactions or interaction uses and the activity edges denote control flow only. 2.2.2 SPT/MARTE Profiles UML is enriched with Profiles, i.e., tailored subsets of the UML metamodel for specific purposes, such as safety (de Miguel et al., 2008), dependability (Bernardi et al., 2012) or fault-tolerant systems (OMG, 2008). The field of real-time embedded software systems is one such domain for which extensions to UML are required to provide more 12 2. Preliminary Concepts precise expression of domain specific phenomena (e.g., mutual exclusion mechanisms, concurrency, deadlines, and the like). The OMG had already issued a UML profile for this purpose, called the UML profile for Schedulability, Performance and Time (SPT), (OMG, 2005), Since SPT is based on UML 1.4, when UML 2.0 was adopted, it became necessary to upgrade the SPT profile to new one, named MARTE (Modeling and Analysis of Real-Time and Embedded systems) (OMG, 2011a). MARTE is also compliant with the UML Profile for Modeling Quality of Service and Fault Tolerance Characteristics and Mechanisms (QoS & FT) (OMG, 2008), developed by de Miguel (2003), in order to define Quality of Service (QoS) properties and requirements. The content of this section is taken from (OMG, 2005, 2011a). MARTE builds on previous UML profiles and consists of a set of sub-profiles dedicated for different aspects, globally divided into foundations, design, analysis and annexes. The foundation part defines general concepts such as non-functional properties and time. The modeling part contains concepts that are useful for modeling, e.g. the component model and high level application modeling concepts dealing for instance with time properties of service invocations. The modeling part also contains for instance the possibility to characterize the properties of hardware resource like for example bandwidth/jitter of busses. In the context of components, it is a useful to annotate target platforms (deployment) with these properties in order to enable timing analysis. The annex of MARTE standardizes common non-functional characteristics, for instance durations, frequencies or arrival patterns. Since, MARTE introduces the notion of time as annotations in the UML diagrams, it is the most comprehensive proposal for performance assessment using UML. Key features of MARTE are the Non Functional Properties (NFP) framework and the Value Specification Language (VSL). NFP framework is used to define data-types characterized by several properties: measurements by means of magnitude and unit (e.g. energy, data size and duration); and qualifiers, such as value source, statistical measure and value precision. VSL is an expression language which VSL aims at the specification of NFPs, say performance, dependability and security. VSL specifies mathematical expressions (such as arithmetic and logical), time expressions (delays, periods, triggers conditions and so on) and variables, i.e., placeholders for unknown parameters. Since the present work spanned a long period of time, we use in an interchangeably way a subset of SPT and MARTE profiles to address performance aspects in software designs. In addition, we partly automate the translation process from UML diagrams to GSPNs using ArgoSPE, an ArgoUML plugin, see a detailed description in Chapter 6. Performance annotations supported by ArgoSPE are not in MARTE, but in SPT profile format. 2.3 Software Performance Engineering Architectural decisions are among the earliest made in a software project, as Williams and Smith (2002) point out. Early performance assessment for system architecture is highly desirable to prevent underperformance during system deployment. Neverthe- 2.3. Software Performance Engineering 13 less, performance evaluation of software systems has been traditionally accomplished after deployment. This is the well-known fix-it later approach and it has well-known problems (Smith, 1990). For example, the cost of re-architecting, re-implementing and re-deploying the system when performance goals are not fulfilled. Also the overbudget for being out of schedule as Woodside et al. (2007) described. Software Performance Engineering (SPE) was introduced by Smith in 1981 as a systematic, quantitative approach to constructing software systems that meet performance objectives. Smith (1990) refined the latter SPE definition as a research field that tries to use quantitative methods and performance models in order to assess the performance effects of different design and implementation alternatives during the development of a system. SPE promotes the integration of performance analysis into the software development process from its earliest life-cycle stages, in order to assure that the system will meet its performance objectives. Therefore, SPE represents the entire collection of software engineering activities and related analyses used throughout the software development cycle, which are directed to meeting performance requirements (Woodside et al., 2007). As Smith (1990) pointed out, SPE augments others software engineering methodologies; it does not replace them. 2.3.1 Performance Scenarios and Objectives Performance scenarios are those Use Cases of a software system that are executed frequently or are critical to the user’s perception of performance (Williams and Smith, 2002). Each performance scenario corresponds to a workload. Aworkload is the collection of request made by the users of the system. The workload intensity is a measure of the number of request made by a workload in a given time interval Smith and Williams (2000), i.e., it specifies the level of usage of a scenario. Workloads can be classified in closed, open or partly open. Performance objectives specify quantitative criteria for evaluating the performance characteristics of performance scenarios in the system (Smith and Williams, 2002b). Thus, performance objectives not only include performance metrics with specific threshold; it is typically a set of numbers describing a combination of the inputprocessing-output for a particular situation in a performance scenario. Performance objectives can be expressed in several different ways, including response time, throughput or constrains on resource usage (Smith, 1990). Jain (1991) defines these performance indices as follows: •Response time is the time interval between a user request of a service and the response time of the system •Throughput of a system is the number of requests that can be processed in some specified time interval. It is defined as a rate and is measured in request per time. 14 2. Preliminary Concepts •Utilization is the ratio of busy time of a resource and the total elapsed time of measurement period. Taking these quantitative measures, two important dimensions to software performance timeless are introduced by Smith (1990): •Responsiveness is the ability of a system to meet its objectives for response time or throughput. •Scalability is the ability of a system to continue to meet its response time or throughput objectives as the demand for the software functions increases. This dissertation proposes a scenario-based performance assessment methodology for software architectures to meet performance objectives. 2.3.2 Performance Models Performance models are formal models that help to obtain measures of interest (e.g., system response time) by analysis or simulation. They describe the system behaviour, expressed as scenarios which are realizations of Use Cases, and have the special capability of predicting some of its properties before it is built. Performance models can be created from scenarios, which denotes a realizations of Use Cases that are frequently executed; or from objects and components, which interact between them and modify the complete system behaviour. There are different kinds of performance formalisms widely accepted in SPE. In the following paragraphs they are briefly introduced. Queueing Network Queueing Network (QN) was introduced by Lazowska et al. (1984) and it models a system as a network of queues. A network of queues consists of a set of queues, named stations. Each station consist of a queue and one or more resources, called servers (either single-server, multiple-server, or infinitive-server). Entities called customers or jobs generated by an external arrival process join the queue to receive service at one of the servers. Extended Queueing Network Extended Queueing Network (EQN) (Cortellessa and Mirandola, 2002) inherits all components of queuing networks, i.e., sources where jobs enter the network, sinks where jobs leave the network, active queues consisting of a number of servers in which jobs are served and waiting areas where jobs wait for service, and finally interconnections between those network elements. Additionally, passive queues are introduced. A passive queue consists of one token pool and a number of network nodes assigned to this token pool. Passive queues allow for simulation of simultaneous resource possession and resource consumption. 2.4. Petri Nets 21 firing delay is associated with each transition. This specifies the amount of time that must elapse before transition can fire. Formally, a SPN is a pair (S, w) where Sis a PN system and w:T→(0,∞) is a function which associates to each transition a random variable with negative exponential probability density function (pdf) with w, its random firing time or firing delay. A Stochastic Marked Graph (SMG) is a Stochastic Petri net whose underlying Petri net is a Marked Graph. A Stochastic Process Petri Net (SPPN) system is a Stochastic Petri net system whose underlying Petri net is a Process Petri net. By definition, all the places of a SPPN are covered by p-semiflows, and therefore it is structurally bounded. There exist different semantics for the firing of transitions, being infinite and finite server semantics the most frequently used. Given that infinite server semantics is more general (finite server semantics can be simulated by adding self-loop places), we will assume that the timed transitions work under infinite server semantics. The average behaviour of the PN in the limit of time is the existence of a steady state behaviour. Ergodicity, introduced by Ross (1983), allows to speak about the average behaviour estimated on the long run of the system, but it is valid only for very strong assumptions on the probability distribution functions (PDF) defining the timing of the model (Campos et al., 1991). The average marking vector, m, in an ergodic Petri net system is defined as (Florin and Natkin, 1989): m(p)=AS lim τ→∞ 1 τ∫τ 0 m(p)udu where m(p)uis the marking of place pat time uand the notation =AS means equal almost surely. Similarly, the steady state throughput, χ, in an ergodic Petri net is defined as (Florin and Natkin, 1989): χ(t)=AS lim τ→∞ σ(t)τ τ where χ(t)τis the firing count of transition t at time τ. Markov process that describes the time evolution(Ajmone Marsan et al., 1995) of these nets is ergodic(Campos et al., 1991), i.e., when the observation period tends to infinite, the estimated values of average marking and steady state throughput tend to a certain value, what implies the existence of the above limits. 2.4.3 Generalized Stochastic Petri Nets Generalized Stochastic Petri Nets (GSPN) are a graphical and mathematical modeling tool for describing concurrent systems (Ajmone Marsan et al., 1995). They extends SPN which include immediate transitions in order to model conflicts with specific 22 2. Preliminary Concepts routing rates. They are very useful in practical modeling, without losing, except for some special cases, the possibility of performing quantitative and qualitative studies. Formally, a GSPN is a tuple G= (N,Π,Λ,r), where Nis a PN system and the set of transitions Tis partitioned in two subsets Ttand Tiof timed and immediate transitions, respectively. Timed transitions are depicted as thick white bars, immediate ones are depicted as thin black bars, Πis a natural valued, |T|sized, vector that specifies a priority level of each transition; timed transitions have zero priority, immediate transitions have priority greater than zero. A transition t∈T, enabled in marking M, can fire if no transition t′∈T:Π[t′]>Π[t] is enabled in M. Immediate transitions fire in zero time. Instead, the firing of a timed transition is a random variable, distributed according to a negative exponential probability distribution function PDF with rate parameter λ(i,e., mean 1 λ). Then Λis the non negative real valued, |Tt|sized, vector associated to the transition firing rates (accordingly, the transition firing delay is the inverse of the corresponding firing rate). The positive real valued vector ris |Ti|sized, and specifies the weights of the immediate transitions for probabilistic conflict resolution. A marking of a GSPN is called vanishing if at least one immediate transition is enabled in the marking and tangible otherwise. It has been proved that exactly one Continuous-Time Markov Chain (CTMC) corresponds to a given GSPN under condition only a finite number of transitions can fire in a finite time with no-zero probability (Ajmone Marsan et al., 1984). In this work, to obtain performance measures we translate UML diagrams into GSPNs by means of ArgoSPE, an ArgoUML plugin, crf. Chapter 6, which implements translation approach proposed by Bernardi et al. (2002); Merseguer (2003); L´opez- Grao et al. (2004); Bernardi and Merseguer (2007). 2.4.4 Petri Nets Analysis Performance models can be used to estimate some quantifiable performance measures in the first stages of the life-cycle to evaluate alternatives for some system parameters. With this purpose a performance model can be simulated or analysed, both approaches have been followed in the examples developed in this work. Responsiveness and utilization performance measures can be calculated, either operationally or stochastically, see Campos (1998) for a survey. As an example, it can be calculated for places, the average steady-state marking; for transitions, the average steady-state enabling degree, utilization or the throughput. Traditionally, techniques for the analysis (computation of performance measures or validation of logical properties) of Petri nets are classified in three complementary groups (Colom et al., 1998): enumeration, transformation, and structural analysis: •Enumeration methods are based on the construction of the reachability graph (coverability graph in case of unbounded models), but they are often difficult to apply due to their computational complexity, the well-know state explosion problem. 2.4. Petri Nets 23 •Transformation methods obtain a Petri net from the original one belonging to a subclass easier to analyse but preserving the properties under study, see (Berthelot, 1987). •Structural analysis techniques are based on the net structure and its initial marking, they can be divided into two subgroups: Linear programming techniques, based on the state equation and graph based techniques, based on “ad hoc” reasoning, frequently derived from the firing rule. A complementary classification of the techniques for the quantitative analysis of the SPNs based on the quality of the results obtained can be: exact, approximation and bounds. •Exact techniques are mainly based on algorithms for the automatic construction of the infinitesimal generator of the isomorphic Continuous Time Markov Chain (CTMC). Refer to Colom et al. (1998) for numerical solutions of GSPN systems. In general, these techniques suffer the referred state explosion problem. In Donatelli and Franceschinis (1996) the model is decomposed for the exact computation of the steady state distribution of the original model. Others techniques based on tensor algebra to obtain exact solutions are proposed in Campos et al. (1999). •Approximation techniques do not obtain the exact solution but an approximation. Some of them substitute the computation of the isomorphic CTMC by the solution of smaller components (Campos et al., 1994). In P´erez-Jim´enez (2002) techniques based on divide and conquer strategies are presented for the approximated computation of the throughput. •Finally, bounds are techniques that offer the further results from the reality. Nevertheless, they can be useful in the early phases of the software life-cycle. Performance Analysis of GSPN Models The analysis of a GSPN model requires the solution of a system of linear equations comprising as many equations as the number of reachable tangible markings (Ajmone Marsan et al., 1984). The steady state solution of the model is obtained by solving the system of linear equations: ΠQ= 0 ∑ M∈RS Π[M] = 1. Qis the infinitesimal generator matrix, whose elements outside the main diagonal are the rates of the exponential distributions associated with the transitions from state to state, while the elements on the main diagonal make the sum of the elements of each row equal to zero. 24 2. Preliminary Concepts Π is the equilibrium probability mass function (pmf) over the reachable markings; being Π[M] the steady-state probability of a given marking M. The transient solution of the model is instead obtained solving the set of differential equations: dΠ(t) dt =QΠ(t) where Π(t)[M] is the probability of the system being in state Mat time t. Some of the most commonly computed aggregate results obtained from steadystate distributions over reachable markings are (Ajmone Marsan et al., 1995; Reisig and Rozenberg, 1998): •The pmf of the number of tokens at steady-state in a place, say p, can be obtained by computing the individual probabilities in the pmf as probabilities of the event “place p contains k tokens”. •The average number of tokens in a place can be computed from the pmf of tokens in that place. •The frequency of the firing of a transition (throughput) can be computed as the weighted sum of the transition firing rate. In this dissertation thesis, performance measures are calculated or simulated from GSPNs obtained by ArgoSPE, an ArgoUML plugin, cfr. Chapter 6. ArgoSPE internally calls GreatSPN (Chiola et al., 1995) and/or TimeNET (Zimmermann et al., 2000) to analyse or simulate GSPNs. Both tools are software packages for the modeling, validation, and performance evaluation of distributed systems using Petri Nets. We compute all the measures (response time, utilization and scalability) under steady state assumption. Steady state means that the system reaches an equilibrium, so, measures obtained will continue in the future, which is a more general assumption than transient state. In a GSPN, steady state analysis can be carried out when the net is cyclical. 2.5 Conclusions This chapter examines the background for this dissertation. It introduces and formalizes a set of terminology and annotations for software architecture concepts, software performance engineering, UML, including their SPT and MARTE profiles, and some concepts of Petri nets. These four research fields are the foundations of our work. Chapter 3 Foundations of the Methodology As a step previous to develop the performance assessment methodology described in Chapter 4, we started addressing some sample applications. The work presented in this chapter paved the development of the methodology, which is completely established in the industrial case study. Applying SPE techniques to different software technological environments permitted us to detect potential shortcomings and improvements in the methodology to assess software architectures. We started following the SPE principles and applying the Performance by Unified Model Analysis (PUMA) approach (Woodside et al., 2005, 2013) with GSPNs as formal method to analyse performance issues in three case studies from different domains: a Web-based application, named CDSS, a mobile agent tracking approach called SPRINGS and a gateway oriented architecture for devices controllers, UCH. CDSS service is recalled from literature (Catley et al., 2004) and we analysed it in G´omez-Mart´ınez and Merseguer (2006b). Thus, we have studied middleware performance issues and proposed different technological alternatives and tunning for determining the optimal system configuration. Our analysis of SPRINGS, a mobile tracking approach, was presented in G´omez- Mart´ınez et al. (2007) and allowed us to validate the experimental results previously obtained by Ilarri et al. (2006), and to evaluate a mobile agents platform in a variety of hypothetical situations without the burden of real experimentation. The UCH (Zimmermann and Vanderheiden, 2007) is a realization of the Universal Remote Console (URC) that acts as a gateway for communicating devices. We analysed three implementations of UCH from the performance point of view to achieve the optimal system configuration in G´omez-Mart´ınez and Merseguer (2010). This chapter is organized as follows. Section 3.1 evaluates performance aspects of the CDSS software system. Section 3.2 analyses SPRINGS tracking approach for mobile agents. Then, Section 3.3 studies the performance of the UCH interoperable architecture. Finally, some conclusions are given in Section 3.4. 25 26 3. Foundations of the Methodology 3.1 CDSS: Web Service Application A web service is a collection of protocols and standards used for exchanging of XML messages between applications (Alonso et al., 2004). Unlike other middleware technologies, web services allow to communicate heterogeneous environments deployed on the network, offering flexibility and interoperability. This interoperability is due to the use of open standards such as SOAP (W3C, 2007), Web Service Description Language (WSDL) (W3C, 2001) and Universal Description Discovery and Integration (UDDI) (OASIS, 2005). A more extended description of these standards can be found in Section 2.1.1. Performance is one of the key aspects and probably the Achilles’ heel of web services and in general of services offered over the Internet (Woodside and Menasc´e, 2006). In this case study, we try to overcome some aspects of this lack by accomplishing an in-depth study of different key aspects of web services performance at the middleware layer: the Simple Object Access Protocol (SOAP) implementations and the eXtensible Markup Language (XML) parsers. Our study is based on an interesting performance case study of a web service developed, also under the SPE principles, in Catley et al. (2004). We rearchitect this case study following the PUMA approach to get a Generalized Stochastic Petri Nets (GSPN) (Ajmone Marsan et al., 1995). The GSPN, properly analysed with the TimeNET tool (Zimmermann et al., 2000), allows us to offer interesting results about performance middleware key aspects and to contrast them with the results obtained from pragmatic (non-formal) studies. In this section, firstly we address key issues concerning performance of web services at middleware layer. Then, we recall the web service under study and we obtain the GSPN that models the target system. Such net will be useful to accomplish the study proposed in this section. Therefore, the impact of SOAP implementations and XML parsers is studied by means of that formal model. Finally, we revise the state of the art and places our proposal for study performance of web services in the current scene. 3.1.1 Performance Issues of Web Services Web service technology has not been developed with performance as a goal. Performance issues affect several aspects: the XML protocols, such as discovering using UDDI (Menasc´e and Almeida, 2001), transporting using usually HTTP (Elfwing et al., 2002), the latency of SOAP implementations (Davis and Parashar, 2002) or the use of an XML parser (Head et al., 2005). Furthermore, web services can be provided with dynamic composition of web services, affecting performance in any way (Chandrasekaran et al., 2003; Menasc´e, 2004). The software infrastructure is other significant factor (Liu et al., 2004). Although all these issues are relevant, we focus on those that being closer to the middleware layer can be parameterized in a UML design. Among them, SOAP implementation is one of the key factors that have influence on performance, as previous studies have shown (Davis and Parashar, 2002; Elfwing et al., 2002; Head et al., 2005). Therefore, it is important to determine which particular SOAP toolkit can meet the 3.1. CDSS: Web Service Application 27 performance requirements of an application. These studies remark the following topics: •Serialization is the process to convert an in-memory object into an XML stream. This includes to pack the XML message in the SOAP envelope and to build the message which will be sent by the corresponding transport protocol, mainly HTTP (Head et al., 2005). •Deserialization converts XML streams in wire-format objects in memory. In this process two phases must be emphasized: (1) unpacking the SOAP envelope and (2) parsing and interpreting the XML document. The most widely models used for parsing are Document Object Model (DOM) (W3C, 2009), Simple API for XML (SAX) (SAX, 2004) and XML Pull Parser (XPP) (Slominski, 2004). DOM parsers are suitable for small documents which must be validated and/or modified. SAX parsers are better for large documents. XPP is optimized when the XML elements are processed in succession and do not need to be visited again. The parser process has a great impact in the performance of SOAP implementation, as previous works have studied (Elfwing et al., 2002; Head et al., 2005). Note that XML native parsers and those embedded in SOAP have to be differentiated, since they exhibit different features and performance characteristics (Sosnoski, 2002; Slominski, 2004). However, not only these processes affect the performance of a SOAP toolkit, others such as data structure support, optimizations to handle scientific data or algorithms implementation and protocols have influence too (Davis and Parashar, 2002; Head et al., 2005). These topics will not be addressed in this work, since they are out of scope of the case study which guides it. Other significant factors that may impact in performance are the service processing time, i.e., the business logic, and the XML file size (Catley et al., 2004). The goal is to study the impact of the following aspects in web service performance: (G1) XML parsers and (G2) SOAP toolkits. Furthermore, other factors that may impact in performance will be studied, such as (G3) the sensibility of a web service with respect to the document file size exchanged and (G4) the service processing time. The implementations of XML parsers under consideration are: Xerces (Apache Software Foundation, 2010a), Xerces2 (Apache Software Foundation, 2010b), Crimson (Crimson, 2005) and XML Pull Parser (XPP) from (Slominski, 2004). The SOAP toolkits considered are AxisJava and .NET, since they are widely used. We have also included XSUL for its excellent performance for large documents (Slominski, 2004). In order to study the impact of the previous goals, we recall a performance case study taken from (Catley et al., 2004), first we summarize it and show its results. Then, we apply the PUMA approach to obtain a GSPN model from the UML system description. 28 3. Foundations of the Methodology 3.1.2 CDSS Web Service Catley et al. proposed in (Catley et al., 2004) “an infrastructure to support artificial intelligence-based clinical decision systems (CDSSs). The system processes multidomain medical data in high-risk medical environments in order to reduce medical errors and alert detection systems”. It integrates and accesses CDSSs and distributed databases from different medical domains in order to predict medical outcomes. These CDSSs are offered as web-services. The paper models a representative subset of this infrastructure, which invokes a CDSS as a web service and accesses the patient’s Electronic Patient Record (EPR). <<PAresource>> WSRequestor <<PAresource>> WSCoordinator <<PAresource>> SOAP1 <<PAresource>> XML1 <<PAresource>> CDSS <<PAresource>> SOAP2 <<PAresource>> XML2 <<PAresource>> EPR <<PAresource>> DISK User requestWS() protocolProcessing() transmitWSRequest() parseXMLDoc() processWebService() retrieveEPR() validate() transformXMLDoc() CDSS_Processing() parseXMLDoc() updateEPR() na ve XML DB Write() na ve XML DB Read() WebServiceDone() determineOutputFormat() pack() transmitWSResult() display() unpack() <<PAstep>> {PAdemand=(’asmd’, ’mean’,(1.2,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(12.5,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(60,’ms’)), PArep=12} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(5,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(50,’ms’)), PArep=8} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(0.8,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(18.75,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(25,’ms’))} <<PAstep>> {PAdemand=(’asmd’,’mean’,(0.03,’ms’)), PAextOp=(network,$packets)} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(0.7,’ms’))} <<PAstep>> {PAdemand=(’asmd’,’mean’,(2,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(500,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(2.1,’ms’))} <<PAstep>> {PAdemand=(’asmd’,’mean’, (12.5,’ms’))} <<PAstep>> {PArespTime=((’req’,’percen le’,100,(10,’s’)), (’pred’,’percen le’,100,$UserR))} <<PAstep>> {PAdemand=(’asmd’,’mean’,(25,’ms’))} <<PAclosedLoad>> {PApopula on=$NUsers} <<PAstep>> {PAdemand=(’asmd’,’mean’, (0.03,’ms’)), PAextOp=(network,$packets)} <<PAstep>> {PAdemand=(’asmd’,’mean’, (12.5,’ms’))} Figure 3.1: UML Sequence Diagram taken from (Catley et al., 2004) describing the CDSS system invocation process. 3.1. CDSS: Web Service Application 29 Figure 3.1 depicts the SD of such CDSS invocation process, that proposes an initial system configuration made of one instance per hardware and software resource. The system parses XML documents using the Xerces parser through a DOM interface. The required response time for 50 users requesting the system should not exceed 8 seconds. Catley et al. applied the SPE techniques developed in Petriu and Shen (2002) to assess the required metric. Then they modeled the system by means of deployment and UML Sequence Diagrams annotated according to the UML-SPT profile, cfr. Section 2.2.2, and translated them into an LQN model (Woodside et al., 1995). This model was solved with the initial configuration, determining that the system can not meet the performance target, see Figure 3.2(a) where the response time for 50 users is 39.9 seconds. They identified system bottlenecks and proposed a new configuration that replicates processors and threads (10 WSCoordinator, 10 CDSS, 3 AppCPU and a variable number of EPR). Figure 3.2(b) depicts the results of multithreading the EPR task when the system is executed by 50 concurrent users. They determined that the target is achieved in this new configuration with 8 threads of EPR. Number of Users Response Time(sec) 0 20 40 60 0 10 20 50 40 30 (a) Ini!al configura!on Number of EPR threads Response Time(sec) 0510 15 0 2 4 6 8 (b) New replicated configura!on Figure 3.2: Performance results obtained by Catley et al. (2004). 3.1.3 Applying SPE to the CDSS As mentioned in Section 2.3.3, PUMA was designed as a framework to obtain performance models from design models (Woodside et al., 2005, 2013). Therefore, we used PUMA to obtain a GSPN model from the SD in Figure 3.1, which models the CDSS. The GSPN model aims for validating the CDSS results obtained in (Catley et al., 2004) and for dealing with the performance goals previously given. PUMA offers a translation process to get a Core Scenario Model (CSM) from a UML SD annotated with UML-SPT. Figures 3.3 and 3.4 depict the resulting CSM for our target SD. Observe that this CSM is made of two scenarios, the one corresponding to the CDSS invocation process in Figure 3.3 and the CDSS processing in Figure 3.4. The CDSS processing scenario comprises the messages from processWebService() to 30 3. Foundations of the Methodology Start ResAcq protocolProcessing transmitWSRequest ResAcq WSControl ResAcq unpack ResRel ResAcq parseXMLDoc ResRel ResRel ResAcq ResAcq WSControl determineOutputFormat ResAcq pack ResRel transmitWSResult ResRel ResRel ResRel UserP Processing Resource Network ExtOp WSCoordinator Component WSP Processing Resource SOAP Component processWebService ResRel End XML Component CDSS Component App_CPU Processing Resource Network ExtOp ResAcq WSRequestor Component Figure 3.3: Core Scenario Model for the SD of Invocation Scenario. 3.1. CDSS: Web Service Application 37 <<PAresource>> WSRequestor <<PAresource>> WSCoordinator <<PAresource>> SOAP Toolkit <<PAresource>> CDSS User requestWS() protocolProcessing() transmitWSRequest() processWebService() WebServiceDone() determineOutputFormat() serialize() transmitWSResult() display() deserialize() <<PAstep>> {PAdemand=(’asmd’,’mean’,(2,’ms’))} <<PAstep>> {PAdemand=(’asmd’,’mean’,($tl,’ms’))} <<PAstep>> {PAdemand=(’asmd’,’mean’,(0.03,’ms’)), PAextOp=(network,$packets)} <<PAstep>> {PAdemand=(’asmd’, ’mean’,($td,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,($ts,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(0.7,’ms’))} <<PAstep>> {PAdemand=(’asmd’,’mean’,(0.03,’ms’)), PAextOp=(network,$packets)} <<PAclosedLoad>> {PApopula!on=$NUsers} <<PAstep>> {PArespTime=((’req’,’percen!le’,100,(10,’s’)), (’pred’,’percen!le’,100,$UserR))} Figure 3.9: UML Sequence Diagram describing the proposed key performance scenario with SOAP toolkit Number of Users Response Time (sec) 0 10 20 30 40 50 0 10 20 30 40 50 (a) Ini!al configura!on Number of Users Response Time (sec) 0 2 4 6 8 10 0 10 20 30 40 50 AXIS .NET XSUL (b) New replicated configura!on Figure 3.10: Response times for different SOAP implementations. 38 3. Foundations of the Methodology ure 3.7 and 3.9. We have taken into account that XPP is the native parser for XSUL and for Xerces through DOM or SAX interface for AxisJava. Table 3.3: Performance parameters from Sosnoski (2002) and Head et al. (2005). Mean Execution Time (ms) Parameter 100 KBytes 1 MBytes in SD AxisJava AxisJava DOM SAX XSUL DOM SAX XSUL (A) $tp 27.68 10.19 40.79 297.8 78.37 501.56 (C) $tv 1.37 ≃0 0.68 31.34 ≃0 15.67 (D) $tt 11.36 ≃0 26.51 282.13 ≃0 203.76 (E) $tl 8.35 8.35 2.435 8.35 8.35 2.435 (F) $td 44.39 44.39 26.78 917.11 917.11 431.464 (G) $ts 32.00 32.00 35.53 291.82 291.82 265.81 Figures 3.11(a) and 3.11(b) show the response time with the initial configuration when the EPR file size is 100 KBytes and 1 MBytes, respectively. If we observe the results when EPR file size is 100 KBytes, these are similar to those when it is only 5 KBytes, see Figure 3.10(a). However, the response time increases meaningfully with 1 MBytes. As Elfwing et al. (2002) expected, comparing the SOAP implementations, AxisJava through SAX interface outperforms AxisJava through DOM. Surprisingly, in spite of the good results of XSUL presented in Head et al. (2005) for large sizes, it performs poorly in this case. It may be due to the time required by XPP to build the document in memory, as suggested by (Sosnoski, 2002). Number of Users Response Time (sec) 0 10 20 30 40 0 10 20 30 40 50 AXIS DOM XSUL AXIS SAX Number of Users Response Time (sec) 0 10 20 30 40 50 60 70 0 10 20 30 40 50 (a) EPR file sized with 100 KBytes. (b) EPR file sized with 1 MBytes. Figure 3.11: Response time for the CDSS web service when EPR file increases in size. 3.1. CDSS: Web Service Application 39 Impact of the CDSS Processing Time Once studied the impact of EPR file size, we come back to Section 3.1.4 to verify if the time required for processing this EPR file (with SOAP and the XML parser) is irrelevant with respect to the time taken by the CDSS Processing() process. In order to validate this supposition, the service processing time will be modified. See the annotation of the CDSS Processing() message self dispatched by the CDSS in the UML Sequence Diagram depicted in Figure 3.1. In previous Sections, we guess that XML parser and SOAP toolkits have not influence in CDSS web service, since XML-based EPR file size is small. Therefore, the time required for being processed it by SOAP and XML parser is irrelevant with respect to the time taken by CDSS Processing() process. In order to validate this supposition, the service processing time is modified. Figure 3.12(a) depicts the response times for 50 users with the initial configuration when the CDSS Processing() service time varies from 0.1 to 2.5 seconds and the EPR file is 5 KBytes; in Figure 3.12(b) the EPR file is 100 KBytes and in Figure 3.12(c), 1 MBytes. Axis DOM Axis SAX XSUL Time for CDSS process (sec) Response Time (sec) 0 20 40 60 80 100 120 140 0,0 0,5 1,0 1,5 2,0 2,5 (a) EPR file sized with 5 KBytes Time for CDSS process (ms) Response Time (sec) 0 20 40 60 80 100 120 140 0,0 0,5 1,0 1,5 2,0 2,5 (b) EPR file sized with 100 KBytes Time for CDSS process (ms) Response Time (sec) 0 25 50 75 100 125 150 175 0,0 0,5 1,0 1,5 2,0 2,5 (c) EPR file sized with 1 MBytes Figure 3.12: Response time when CDSS processing time increases. 40 3. Foundations of the Methodology The response time of the different SOAP implementations and XML parsers follows the same tendency while sizing EPR file to “small sizes”, 5 KBytes or 100 KBytes. However, when EPR file is 1 MBytes, “big sizes”, and CDSS Processing() is less than 0.4 seconds, AxisJava through SAX parser performs poorly compared to AxisJava through DOM and XSUL. But, when service time increases, AxisJava through SAX parser outperforms them. We guess that XSUL performs better when the service time is small because it is oriented to slightly processed scientific data. Similarly, we guess that DOM and SAX outperform XSUL when the processing time is greater than 0.4 seconds since they are conceived to process generic information which may be repeatedly accessed. This experiment shows that the CDSS processing time (CDSS Processing()) and the EPR file size condition the impact of the XML parser and the SOAP implementation. 3.1.5 Related Work Performance is an important aspect of web services. Nevertheless, from the best of our knowledge, very few papers focus on performance evaluation of web service-based applications. And a very few of them follow the techniques proposed in the SPE by Smith and Williams (2002b). Menasc´e and Almeida (2001) developed a methodology from we have learnt the key issues of performance evaluation of web services. While this methodology is focussed on capacity planning using queuing networks (QN), we aim at its performance prediction using PN and the UML. Chandrasekaran et al. (2003) proposed a simulation technique for analyzing performance of composite web services in order to obtain efficient web processes. Menasc´e (2004) studies QoS issues of composite web services. Datla and Goˇseva-Popstojanova (2005) presented a measurement-based study of performance of e-commerce applications. They study the impact of web services together with other components on integrated applications using benchmark techniques. Ng et al. (2004) evaluated diverse SOAP implementations by means of benchmarks of a simple service with three types of message. In contrast to us, they probe that serialization and deserialization are the primary important bottleneck for this application. Liu et al. (2004) proposed an approach to predict performance metrics for a middleware-hosted application using QN models. Although, this work is focussed on a J2EE application, their modeling approach is suitable to other middleware technologies, such as CORBA and COM+/.NET. Verdickt et al. (2005) proposed a Model Driven Architecture (MDA) model transformation for Platform Specific Models (PSM), including middleware performance details. It is based on SPE and the UML-SPT (OMG, 2005) profile. The transformation process is made by a tool which generates LQN models. Gilmore et al. (2005) proposed a UML-based methodology for analyzing security and performance aspects using PEPA models. This method is implemented in the Choreographer design platform. 3.1. CDSS: Web Service Application 41 3.1.6 Concluding Remarks on CDSS Our experiments indicate that the XML parser choice slightly affects web services performance when the XML-based file size is small, whereas the SOAP implementation influence is even smaller. However, when the EPR file increases in size, the response times obtained are worst and there exist noticeable differences among XML parsers and SOAP implementations. These differences intensify when the service processing time changes. We can conclude that the impact of the XML parsers and the SOAP implementations is conditioned by both XML-based file size and service time, i.e., the serialization and deserialization processes are not bottlenecks for large data applications and large service times. 42 3. Foundations of the Methodology 3.2 SPRINGS: Mobile Agents Tracking Mobile agents have arisen as an interesting paradigm to build distributed applications, due to the unparalleled advantages they offer. However, along with the advantages they also present new challenges. One of the most relevant is that it is not easy to ensure efficient communication among agents that move continually from one computer to another. In this section, we analyse the performance of the SPRINGS tracking approach developed by Ilarri et al. (2006). Our analysis allows us to validate the experimental results previously obtained by Ilarri et al. (2006), and to evaluate the platform in a variety of other hypothetical situations without the burden of real experimentation. The structure of this section is as follows. In Section 3.2.1, we introduce basic aspects of mobile agent technology, which is important for this work. In Section 3.2.1, we describe and model the SPRINGS architecture for tracking mobile agents. In Section 3.2.2, the latter model is annotated with performance information. In Section 3.2.3, the PUMA approach is applied in order to get the performance models corresponding to the modeled architecture. Section 3.2.4 exploits the performance models to deal with the proposed analysis goals. Section 3.2.5 revises the related literature. 3.2.1 Mobile Agent Technology Mobile agents (Milojiˇci´c et al., 1999) have stirred up a lot of interest and research efforts. They are programs that can autonomously travel from computer to computer, and present a range of unique advantages, such as autonomy, flexibility, and effective usage of network bandwidth (Lange and Oshima, 1999). Due to their features, the use of mobile agent technology is very attractive in wireless (Spyrou et al., 2004), pervasive, and distributed computing in general. One of the main challenges in applications based on mobile agents is how to keep track of the current locations of the agents in order to allow an efficient communication among them. If the location of an agent cannot be obtained in a short time, the agent can move to another computer before such location data is used for communication purposes; this situation may occur indefinitely, leading to livelock problems from the point of view of the agents that want to communicate with the agent. The vital importance of designing efficient communication and tracking schemes for mobile agents have been highlighted in many works, such as (Kastidou et al., 2003; Aridor and Oshima, 1999). Moreover, according to the experiments in (Ilarri et al., 2006), this is a key issue to ensure the scalability of a mobile agent platform, especially in highly dynamic contexts. Several models for tracking agents are conceivable; thus, the work in (Aridor and Oshima, 1999) suggests three methods to locate agents (brute force, logging, and redirection), and in (Milojiˇci´c et al., 1998) were proposed four (updating at the home node, registering, searching, and forwarding). A mobile agent platform, called SPRINGS (Ilarri et al., 2006) (Scalable PlatfoRm for movING Software) proposes a new tracking approach; in (Ilarri et al., 2006) has been experimentally shown to 3.2. SPRINGS: Mobile Agents Tracking 43 be highly scalable and how it outperforms other popular platforms, especially in environments with a high number of mobile agents. So how can an agent move to another computer and resume its execution there? Mobile agents need a specific execution environment, which we call context1. Thus, for an agent to travel to another computer, a context must be available there: an agent needs a context in the same way that a web page request needs a web server. Contexts are provided by a specific mobile agent platform (Silva et al., 2001), from which several alternatives are available, e.g., Aglets (Lange et al., 1997), Grasshopper (B¨aumer and Magedanz, 1999) or SPRINGS; and provides them with different services, such as communication and mobility. The two mentioned services are interrelated. Particularly, mobile agents must be able to communicate among themselves, via remote method invocation or message passing, even if they move across computers. Contexts and Regions The architecture, depicted in Figure 3.13, of an agent platform is usually made of agents, contexts and regions. Region 1 Region k Region n Agent4 calling a method of Agent3 Agent1 reques!ng moveTo from Context1 to Context3 RNS Updater Proxy Updater Proxy RNS RNS Updater Proxy NodeRNS k Proxy Updater Agent2 Agent4 Agent6 Context4 Context3 Node 4 Agent3 Agent7 Context2 Node 3 NodeRNS 1 NodeRNS n Agent1 Context1 Agent5 Node 2 Figure 3.13: Architecture for mobile agent platforms. •Contexts (also called places for example in Grasshopper) are the environment where agents execute: a computer can host several contexts, each one assigned to a different communication port and execution process. A context provides 1In the literature of mobile agents, the term place is frequently used instead. 44 3. Foundations of the Methodology agents with services such as a call routing service irrespective of the target agents’ locations2, and a transportation service to move to other contexts. •Aregion is a set of related contexts. In SPRINGS, for example, the functionality of a region is provided through a remote object called Region Name Server (RNS), which can be located on any computer in the network. An RNS has several functions, such as ensuring the uniqueness of agent/context names, mapping from context names to context addresses, and assigning tracking responsibilities to contexts. Modeling Tracking A key functionality of a mobile agent platform is to offer a communication service that allows an agent to communicate with another without the need of knowing its current location. Most agent platforms use the idea of proxy as an abstraction to communicate with an agent (if an agent a1 wants to communicate with another agent a2, it must first obtain a proxy to a2); location transparency means that the proxy routes the message to its corresponding agent efficiently, wherever it is. SPRINGS hides the proxies to the programmer and stores them in the contexts3: an agent can communicate with another one by just specifying the name of the target agent, without the need of using proxies explicitly. An agent proxy stores the (remote) reference to that agent: its name and current context. If the agent moves to another context, the information contained in the proxy becomes invalid. In SPRINGS, dynamic proxies are considered: when an agent arrives at a new context, the remote proxies to that agent (i.e., held by other contexts) are updated to reflect the new agent location. These proxies are updated before resuming the agent’s execution in order to maximize the probability that another interested agent succeeds in communicating with it. In each context, a Proxy Updater thread is in charge of updating the remote proxies to the incoming agents efficiently (see (Ilarri et al., 2006) for more details). Regarding agent mobility, two important related concepts are considered: •Location servers. A location server of an agent ais a context that stores a dynamic proxy to abecause it has been assigned by the RNS to do so. •Observer contexts. A context cis an observer of a certain agent awhen it is interested in knowing the current location of a, which happens when: 1) a local agent has communicated recently with a, which means to include ain its ProxyList, or 2) it is a location server for a. An observer of an agent aalways stores a dynamic proxy to the agent. Following the concepts given so far, the SD in Figure 3.14 describes the scenario of how an agent changes its context and how the platform keeps track of it. Firstly, 2Not all the existing platforms feature this property. 3All the agents in a context that want to communicate with another one use a shared proxy that points to that agent. 3.2. SPRINGS: Mobile Agents Tracking 45 an agent a1requests to its current context c1to travel to a new one c2. The origin context unregistries the agent. Just before traveling, the agent prepares its departure and when it has finished, the current context sends it to c2. When it arrives, a new instance a2of the agent is created; meanwhile the old instance a1at origin ends its departure and it is completely removed from the origin context. Assuming that the agent has successfully arrived, it prepares its arrival and then it is registered. Afterwards, its proxies have to be updated, so the Proxy Updater thread, embedded in the Context component, informs all observer contexts of the agent to update its dynamic proxy. After this, the arrival has finished. <<PAresource>> a₁:Agent <<PAresource>> c₁:Context <<PAresource>> c₂:Context <<PAresource>> a₂:Agent RequestMove₍c₂₎ UnregistryAgent₍a₁₎ preDeparture SendAgent₍a₁₎ postDeparture CreateAgent preArrival RegistryAgent₍a₂₎ UpdateProxies₍a₂,c₂₎ postArrival RemoveAgent₍a₁₎ delete <<PAstep>> {PAdemand=(’asmd’, ’mean’,(0.1,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(3.86,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(13.14’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(20.2,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(0.1,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(3.86,’ms’))} <<PAstep>> {PAdemand=(’asmd’,’mean’,(46.3,’ms’)), PAextOp=(’network’,1,’ms’)} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(43.82,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(0.1,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(0.1,’ms’))} Figure 3.14: Annotated UML Sequence Diagram for agents movement in SPRINGS architecture. The SD in Figure 3.15 models how agents communicate. Let us assume that an agent a1executing on context c1wants to communicate with another agent a2on context c2. If any agent on c1has recently communicated with a2, a dynamic proxy to a2will be locally available (c1is an observer of a2); in this case, the callAgent will be directly routed through that proxy, without executing the locationTransparency fragment. Otherwise, c1must find a2in the following way: 1) c1obtains from its RNS a location server for a2; 2) c1obtains a proxy to a2from that location server (ls2), which registers c1as a new observer for a2(UpdateProxyList task); and 3) the 46 3. Foundations of the Methodology retrieved proxy is used to route the call to a2, and it is stored by c1(so the RNS will not need to be contacted the next time). Information about agents not located in the region would be requested by the local RNS to other RNS. In that case, the sequence diagram in Figure 3.15 must be augmented with a lifeline representing the RNS which knows a location server for the called agent. sd callTo <<PAresource>> a₂:Agent <<PAresource>> ls₂:Context <<PAresource>> r:RNS <<PAresource>> c₁:Context <<PAresource>> a₁:Agent RequestCall₍a₂₎ callAgent AskLoca$on₍a₂₎ UpdateProxyList₍a₂,proxy₎ FindProxy₍a₂₎ return₍proxy₎ return₍ls₂₎ opt loca$onTransparency [$prob=0.04] <<PAstep>> {PAextOp=(’network’,0.1,’ms’)} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(20,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(32,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(1.0,’ms’))} <<PAstep>> {PAdemand=(’asmd’, ’mean’,(9.3,’ms’))} <<PAstep>> {PAextOp=(’network’,1,’ms’)} Figure 3.15: Annotated UML Sequence Diagram for agents communication in SPRINGS architecture. Finally, the modeling of the physical structure in Figure 3.13 is provided using a UML Deployment Diagram (DD), see Figure 3.16, which describes resources on the system connected through a network. The DD depicts the system architecture for only one region; new regions with their contexts can be incorporated by duplicating this structure. Since a node may host several contexts and each of them provides services to a number of agents, there may exist several instances of both agents and contexts on each node. 3.2.2 System Performance View In this section, we present the performance view of the proposed mobile agents tracking approach. We use the UML-SPT profile (OMG, 2005) to annotate both the performance metrics, that characterize the goals of our performance analysis, and the 3.2. SPRINGS: Mobile Agents Tracking 53 a1 c1 RNS a2 ls2 CPU1 CPU_RNS CPU2 t_c1 RequestCall acq_RNS UpdateProxyList t_ls2 r_CPU_RNS t_a2 rel_a2 rel_c1 rel_ls2 FindProxy CallAgent AskLocaon first rest t_CPU1 r_CPU1 t_CPU2 r_CPU2 t_CPU_RNS r_RNS t_CPU2_ls r_CPU2_ls Figure 3.21: GSPN for communication between agents in SPRINGS architecture. 54 3. Foundations of the Methodology Finally, the GSPNs in Figures 3.20 and 3.21 are composed in order to obtain a performance model, i.e., a new GSPN that models the performance scenario in Figure 3.17. GSPN composition is based on merging the net places that represent common elements in the CSMs, such as resources or components. 3.2.4 Performance Analysis Once the performance model has been built, we use TimeNET (Zimmermann et al., 2000) to compute the given metric in it by means of simulation techniques. Validation of the Performance Models Figure 3.22 depicts the response times given by the experimental test in (Ilarri et al., 2006) and the performance model. The configuration for each one was described in Section 3.2.2. As it can be observed, the results are very similar, and in both cases the response time increases linearly. 0 1 2 3 4 5 6 7 8 1 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 Number of agents Response Time (sec) Analy!cal Experimental Analy!cal0,16 0,39 0,77 1,15 1,54 1,92 2,32 2,71 3,09 3,46 3,87 4,25 4,63 5,01 5,42 5,77 Experimental0,16 0,53 0,94 1,37 1,81 2,24 2,69 3,13 3,54 4,01 4,58 4,97 5,52 5,89 6,58 7,04 Figure 3.22: System response times of SPRINGS architecture. In Ilarri et al. (2006), linear scalability was considered acceptable, since the experiments were carried out to test the platform in a stressful scenario for highly mobile agents (Murphy and Picco, 2002). Moreover, for a platform to support 1500 agents in such scenario is a real challenge. Mobile agents platforms can get lower response times when agents do not move and communicate so frequently. In the following we describe the stressful scenario. The goal is to make agents stay on a context for a very short time and continually calling among themselves. To do so, in the experimental configuration described in 3.2. SPRINGS: Mobile Agents Tracking 55 Section 3.2.2, each agent has a communication peer and performs the following steps: 1) calls its peer; 2) moves randomly to another context; and 3) steps 1 and 2 are repeated without delay until reaching 50 iterations. While the number of agents increases up to 1500, the performance of agent communication decreases; thus, a target agent could move to another context before a message reaches it. So, the scalability of the platform is studied in terms of the time that an agent needs to perform one entire iteration (callTo +moveTo) as the number of agents increases. Optimal Configuration and Sensitivity Analysis Optimal configuration for a platform means to minimize the number of context threads needed to execute the agents while keeping the response time. The analytical experiment in Figure 3.22 was very relaxed in this sense and it considered up to 1500 threads, i.e., a thread per agent. However, in a new experiment, depicted in Figure 3.23, we drastically reduced the number of threads, in a range from 50 to only 1, while keeping the rest of the parameters. The response time grows exponentially with values under 10 threads. 1 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1 10 20 30 40 50 0 20 40 60 80 100 120 140 160 180 200 220 240 Response !me (sec) Number of agents Number of threads Figure 3.23: Response times when multithreading contexts in SPRINGS architecture. Finally, Figure 3.24 enlarges Figure 3.23 in the range from 50 to 15 threads. Now, we can observe that the response times obtained in Figure 3.22 are preserved only for the range from 50 to 40 threads. Therefore, 40 threads is the optimal configuration 56 3. Foundations of the Methodology for the agent platform, because values lower than 40 cause response times greater than 6 sec. with 1500 agents. 1 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 15 20 25 30 35 40 45 50 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Response !me (sec) Number of agents Number of threads Figure 3.24: Detail of Figure 3.23. The network speed may also affect the performance of the platform, influencing the time spent by agents traveling to another context, which is captured by the SendAgent task. Using the optimal configuration with 1500 agents and considering that the SendAgent() message size is 2 KBytes, Figure 3.25 illustrates the system response time when the delay of the SendAgent() message varies. Be aware that a send delay of 10 ms corresponds with a network speed of 200 KBytes per second, while 250 ms corresponds with 8 KBytes per second. The system is sensitive to the network speed; although from 33 KBytes per second (60 ms), it does not perform better. 3.2.5 Related Work To the best of our knowledge, there is no other work that analyses the performance of mobile agent tracking strategies using a model-based approach; an experimental analysis can be found in (Ilarri et al., 2006). In the following, we study the most relevant works related with the modeling of mobility with performance analysis purposes. Currently, there is no standard way for modeling mobility, although different pro- 3.2. SPRINGS: Mobile Agents Tracking 57 0 2 4 6 8 10 12 14 1030507090110130150170190210230250 Sending Time (ms) Response Time (sec) Figure 3.25: Sensitivity analysis of SPRINGS architecture. posals exist, some of them based on UML (Baumeister et al., 2003; Balsamo and Marzolla, 2003b; Grassi et al., 2004; Bracchi et al., 2004), while others such as (Hillston and Ribaudo, 2004) follow some formalism, in this case PEPA nets. The work in (Baumeister et al., 2003) presents an extension of the UML class, sequence and UML Activity Diagrams to model mobile systems and performance and security characteristics, but they do not explain how to get any performance model or how to compute metrics. In (Grassi et al., 2004), a non-standard UML profile for modeling mobile systems using activity, deployment and state machine diagrams is proposed, as well as an extension for collecting performance information according to the UML-SPT. The models are automatically translated into queueing networks to analyse performance. Balsamo and Marzolla (2003b) described a UML- based methodology for modeling and evaluating the performance of mobile systems using use case, activity and UML Deployment Diagrams augmented with the UMLSPT. They use simulation techniques to compute metrics. Bracchi et al. (2004) proposed a framework to model performability for mobile software systems using use case, sequence, collaboration and deployment diagrams, from which Stochastic Activity Networks (SANs) are obtained. Finally, it is worth noticing some works that use Petri nets for mobility and performance. In (Scarpa et al., 2002), the performance of different communication paradigms is compared using stochastic Petri nets. Merseguer et al. (2003) compared the performance of two software retrieval systems applying SPE techniques using high-level Petri nets. 3.2.6 Concluding Remarks on SPRINGS In this section we have analysed the performance of the SPRINGS tracking approach. The most interesting conclusion for the SPE point of view is that it has been 58 3. Foundations of the Methodology possible to analyse one of the key aspects concerning performance of mobile agent platforms without tailoring a SPE methodology for this purpose. Therefore, the paper shows that the PUMA approach is powerful enough to deal with complex performance problems in the mobile agents software domain. Nevertheless, PUMA method lacks assessment proposal about performance improvements. 3.3. UCH: Universal Control Hub 59 3.3 UCH: Universal Control Hub In industrial societies, people massively use electronic devices in everyday life: mobile phones, TV sets or washing machines are some of several examples. Nevertheless, their use may became very complicated, and even impossible, to people with special needs, such as impaired or elderly people. Their user interfaces are not generally designed considering their needs neither Design for all principles proposed by Newell (2008). According to last reports of Eurostat office (2013), the majority of the European countries own more mobile subscriptions than inhabitants. Internal studies of ONCE4 foundation demonstrate similar trends for people with disabilities. So, the achievement of moving the proper control of electronic devices to adapted devices (e.g., mobile phone) may solve most user interface accessibility issues. Therefore, interoperability is critical to realizing the vision of personalized and pluggable user interfaces for electronic devices and services. An International Standard on pluggable user interfaces has here a key role to play, Universal Remote Console (URC) (ISO/IEC, 2008). Such a standard would facilitate user interfaces that adapt or can be adapted to user’s personal needs and preferences. It would allow easy to use interfaces that employ various modalities for input and output. Limitations in URC advised to develop an architecture called Universal Control Hub (UCH) (Zimmermann and Vanderheiden, 2007) to make URC practical in real scenarios. In short, UCH is a URC realization that acts as a gateway for communicating devices. UCH has been implemented, using different languages and technologies (URC Consortium, 2010c,b), and currently is offering adequate and interoperable service within environments of a reduced number of users. However, for UCH is not only interoperability the critical issue, performance is or will be a must when the amount of plugged devices depletes the infrastructure to the point of exhausting its resources. This may happen in real scenarios such as intelligent buildings where hundreds or thousands of users will concurrently access the deployed architecture. Although UCH and underlying implementations have not been tested in such environments, we propose to assess whether UCH can offer quality of service in these interesting settings. Note that the costs (in budget as well as in technical difficulties) prevent the architecture from testing in the new proposed environments, then in our opinion the use of predictive performance models can play a role in this context. Besides, in case of identifying adversities that turn UCH into a non practicable solution, the testing investment would be a waste in resources. So, the assessment should be also useful to pinpoint where in the UCH architecture are the problems located, again predictive models can offer cheaper solutions than real experimentation. The study of the performance of UCH in future real situations is then a necessity that we will carry out using the formal model of Petri nets (Ajmone Marsan et al., 1995) in the context of the PUMA approach (Woodside et al., 2005, 2013). In the following, the URC-UCH architecture is detailed in order to understand potential performance problems it may provoke. We analyse UCH and propose a set 4National Organization of blind people in Spain. 60 3. Foundations of the Methodology of experiments that will allow to compare their results with results obtained from current real implementations, then they will validate the performance model. From the validated model, the system will be tested to assess its usefulness for future necessities above described. 3.3.1 URC-UCH Architecture The URC is an ISO published as the standard ISO/IEC 24752 in 2008. URC describes an interoperable architecture with a set of elements that allow users to control one or various devices by means of a remote console, in a transparent way for them. So, URC, or remote console, defines a framework of remote access to control devices or services. It can be designed both, as a dedicated hardware (e.g., a universal remote control), or as a URC-complaint software to run on specific devices such as personal computer, PDA or mobile phone. Therefore, it is a device or software architecture (gateway) through which the user accesses other devices, then being capable of rendering its user interface. This fact allows to develop adaptable user interfaces, which can satisfy users with special needs. In the following, the devices or services that the user wants to control are referred as targets, and the controller may be any user device. For instance, a blind person can control the washing machine, in this case the target device, by means of his/her mobile phone (controller device). So, URC allows to show washing machine functionalities in accessible manner. ISO/IEC 24752 does not impose how it must be implemented. Besides, it does not assume a specific network protocol between controller and targets, but only network requirements. So, a URC interaction could be implemented on top of existing networking platforms as long as they support device discovery, control and eventing, such as UPnP (universal plug and play), Web services and/or HomePlug (IEEE 1901:2010). Among others, URC defines the following XML documents: Target Description (TD) and User Interface Implementation Description (UIID). The TD document permits the remote console to learn how to use the target device, locate its functionalities, current status, and other interesting information. The main advantage of UIID is that delivers a generic user interface, so the remote console can implement it under the most adaptive way to the user (optical, audible, tactile), addressing Design for All principles (Newell, 2008). Nevertheless, URC presents some issues: lack of devices with URC technology, lack of plugging in several targets and multiplicity of communication protocols. The Universal Control Hub (UCH)architecture fixes some of the above mentioned problems (Zimmermann and Vanderheiden, 2007) . Indeed, UCH is seen as an “open box” between the target and the controller, acting as gateway between various controllers and various targets, which overcomes communication limitations of URC. Basically, UCH is a manner to implement URC, that focusses on normalizing how the Control Hub works. So, UCH defines APIs and interfaces between internal modules of Control Hub, inheriting the URC XML documents. Figure 3.26 depicts the components in UCH: •User Interface Protocol Module (UIPM): is a “pluggable user interface” 3.3. UCH: Universal Control Hub 61 that specifies a protocol between the controller and the Socket Layer via an API. URC-HTTP protocol is a UIPM specification based on HTTP. •Socket Layer: is the core part of UCH, hosting the sockets of the targets. •Target Adaptor (TA): synchronizes one or multiple targets with their sockets (running in the Socket Layer). TAs can be dynamically loaded at runtime. •Target Discovery Module (TDM): discovers specific targets, connects to the Socket Layer via API, and to the targets via any protocol. TDMs can also be dynamically loaded at runtime. •UIList: contains a dynamic list of available user interfaces, as given by the currently loaded UIPMs. UCH (Socket Layer) IUPMListener ITDMListener ITAListener UIPM IUPM proprietrary ITDM proprietrary ITDM proprietrary TDM ITA proprietrary ITA proprietr ary TA Control UIList Controller Target Control Discovery Discovery UCH Figure 3.26: Components of UCH architecture taken from (URC Consortium, 2005). Currently, there are three implementations of UCH, two of them developed under open source: UCHj (2010c) and UCHe (2010b), and another one under proprietary software. UCHj is a Java implementation designed for a closed delimited network, such as an office or home. UCHe is developed in C/C++ for embedded systems. Recently, a UIPM client for iPhone smart phone has been published (URC Consortium, 2010a), however this one does not implement UCH core. These different implementations could seriously affect performance in a scenario with concurrent users. As URC and UCH are based on exchanging XML messages, they suggest poor performance, as previous studies have observed (Elfwing et al., 2002; Davis and Parashar, 2002; Head et al., 2005). Since both UCHj and UCHe implement UIPM on HTTP, then UIPM performance should be also taken into account. Moreover, dynamic loading of modules (TA, TDM) will impact system performance. Considering that the Socket Layer is the UCH core module, then it will play a decisive role from a performance point of view, since it is attending all system requests. 3.3.2 Applying SPE to UCH UCH and related implementations comprise a complex software for which, as above described, their performance was considered critical in project. Complexity advised 62 3. Foundations of the Methodology to carry out the evaluation from different points of view, so to allow comparison, gain insights on the products and also validate results. Therefore, it was decided that performance of current implementations should be traced both, experimentally and within a benchmark approach (Catal´an and Catal´an, 2010), but also it was pointed out the interest of an evaluation with formal methods, hence to be able to test the system not only in its current form but under future variations (mainly concurrent users). Design Models For an initial understanding and in order to determine the interactions that mostly affect system performance, we start summarizing the necessary steps to control a target device, see UML Sequence Diagram in Figure 3.27. In a first step, the UCH core is initialized and then it discovers and registers connected target devices by means of TDM module. Targets are listed (UIPM) as accessible devices for users to eventually manage their services. Then UCH waits for requests from user devices. When a request arises and compatibility is checked, the UIPM module opens a session and obtains the target devices list and corresponding services or functionalities which are granted in the form of a list (UIList document), that is eventually shown in the user interface. Hitherto, the system has performed two complex processes, discovery and user interface auto-adaptation, that obviously spend a considerable amount of time and resources. However, we will leave them out of our performance study since they are executed only once, i.e., they are the equivalent to start up the system, and all we understand the need for this process and its implications. So, we assume that from now on, the user is able to control the target device (i.e., to invoke commands through setValues message), which also means to modify the device status and variables. Indeed, this is the normal usage of the system and it repeats as many times as invoked commands (as indicated by the loop in the diagram), besides, several concurrent users (all those initialized in the system) will be executing. Then this loop interaction turns to be the performance critical part of the system. UML Sequence Diagram in Figure 3.28 models how a user requests a target by means of setValue() operation, i.e., it details the previous critical loop. Firstly, the User Device communicates to UCH core by means of UIPM via URC-HTTP protocol. The Socket Layer module, i.e., UCH core, connects to TA module in order to send a setValue() request to the Target Device. Once the request is made, the response is rendered in the User Device in an adaptive way. The physical structure of the system is necessary to describe the resources where to allocate the modules of the architecture, as well as their connections through a network, which obviously will delay the interchange of messages among modules according to the size of the messages. A UML Deployment Diagram, Figure 3.29, will help to understand these issues. 3.3. UCH: Universal Control Hub 69 environments, such as intelligent buildings, business buildings, hospitals or hotels. In this case, the system will have to support requests from several concurrent users. Firstly, both implementations, UCHj and UCHe, were experimentally tested within the INREDIS project (Catal´an and Catal´an, 2010; INREDIS Consortium, 2010a). These experiments assumed that each user wanted to control his/her own device, i.e., one user per target device. Results regarding response time (Catal´an and Catal´an, 2010; INREDIS Consortium, 2010a) could be hardly obtained up to forty users due to the difficulties of real experimentation. We reproduced these experiments using our performance model, which meant to put as many tokens as users in places users and p userDevice of the GSPN, so to also match one user to one interface, and then we obtained the results in Figure 3.32. Differences in the results between our performance model and the Java and C/C++ real implementations accounted for less than a ten percent, then we assumed our GSPN as a valid performance model and ready to address experiments initially not feasible to carry out with the real implementations. 0 5 10 15 20 25 30 1 5 10 15 20 25 30 35 40 Number of users Response Time (sec) UCHj UCHe Figure 3.32: Response time of UCHj and UCHe implementations from 1 to 40 concurrent users. On the other hand, the discussion about what could be considered a good response time is controversial, since besides the times so far considered, it may also depend on the kind of impairment the user has and on the kind of target device the user wants to control. For example, elderly people could request commands in their personal telecare device at a rate of few seconds. However for a blind person it could last much more time to operate for instance the washing machine. Pragmatically, we will assume quantities around ten seconds as acceptable response times, according to (Miller, 1968; Nielsen, 1993). This is so because in the experiments (both, real and GSPN) we did not want to consider the time spend by the impaired persons and 70 3. Foundations of the Methodology neither the time to operate the target5. Therefore, for concrete scenarios (persons and targets with defined profiles) the response times will be higher. Our next step, assuming valid the performance model, was to exercise the same for a larger amount of concurrent users. Figure 3.33 extends experiments in Figure 3.32 up to 1000 users, so offering response time of the GSPN w.r.t. both implementations, where we observe that UCH performs poorly, specially Java implementation. Therefore, although UCHe outperforms UCHj, UCH should not be considered as a practicable architecture in a real time environment with hundreds of concurrent users. Now, we will try to get solutions by means of replication. 0 200 400 600 800 1000 1200 1400 1600 1 100 200 300 400 500 600 700 800 900 1000 Number of users Response Time (sec) UCHj UCHe Figure 3.33: Response times of UCHj and UCHe implementations. UCH specification does not define whether UIPMs, TDMs and TAs modules should be executed as independent processes or threads, or if they should be allocated in different memory spaces, hence these are choices for each specific implementation. In the case of both UCHj and UCHe, all UCH components execute in the same space of memory and are attended by a unique process. Now, we want to study an “optimal configuration” for the architecture by means of modules replication. In fact, we replicated the two implementations of UCH modules, i.e., UIPM, Socket Layer and TA modules (represented by places p uipm, p uch, p ta in Figure 3.31), which were populated with threads ranging from 1 to 25 in the same space of memory. Figure 3.34(a) shows the effect of adding threads in UCHj implementation and Figure 3.34(b) in UCHe. Although both graphics have similar shape, the order of magnitude is quite different. As expected, UCHe outperforms UCHj. Note that using 15 threads, the response times improve significantly in both cases, but adding more threads they do not perform better. For a few hundreds of users, UCHe may get acceptable values with 15 threads, around 8 seconds, however 5Note that this is not a limitation to evaluate the UCH architecture. 3.3. UCH: Universal Control Hub 71 UCHj in these cases still is not feasible, around 50 seconds. Figure 3.35 summarizes the response times of both implementations with 15 threads. 1 100 200 300 400 500 600 700 800 900 1000 1 5 10 15 20 0 200 400 600 800 1000 1200 1400 1600 Response Time (sec) Number of users Number of threads 1 100 200 300 400 500 600 700 800 900 1000 1 5 10 15 20 25 0 25 50 75 100 125 150 175 200 225 250 275 Response Time (sec) Number of users Number of threads 25 a) UCHj implementa!on b) UCHe implementa!on Figure 3.34: Response times of UCH implementations adding threads. As a conclusion, a solution for an “optimal configuration” for populated environments could be a UCHe implementation of 15 threads, since as it can be observed in the graph, UCHe response times in this setting may be acceptable. 0 20 40 60 80 100 120 1 100 200 300 400 500 600 700 800 900 1000 Number of users Response Time (sec) UCHj UCHe Figure 3.35: Response times of UCHj and UCHe implementations using 15 threads. 3.3.3 Concluding Remarks on UCH We have analysed the performance of the UCH interoperable architecture through two open source implementations, UCHe and UCHj. The use of GSPNs has made 72 3. Foundations of the Methodology possible to validate experimental results and to analyse scenarios that otherwise could not be afforded with real experimentation. The performance results demonstrate that current UCH implementations fit in a very delimited context, with very few users. However we assessed that system performance can be improved by adding threads, but also that UCHe will always outperform UCHj, confirming that it is the best option for achieving user requirements. We think that further analyses of the GSPN can help improving URC architecture and consequently related implementations. The solution explored, i.e., module replication, have to be supplemented with other architectural decisions that indeed we hope could be assessed by the GSPN analysis. 3.4 Conclusions Taking our models and results as a background, the chief contribution of this chapter is the use of SPE principles, concretely the PUMA approach, in different case studies, with different architectural styles and from different domains, being one of them a real-complex case study in the industrial setting. To the best of our knowledge, PUMA has been applied in examples or academic studies, but not in an industrial setting. We remark that case studies presented along this chapter are delimited, they are studied in isolation, i.e., without taking into account interactions with other components of the complex systems which they are within. In addition, we carried out the assessment of the performance of these software architectures in hypothetical situations, note the case of UCH where over budget hampers the benefits of the evaluation. The use of GSPNs has made possible to validate experimental results and to analyse scenarios that otherwise could not be afforded with real experimentation. The final objective of these assessments is to gain insight in closing the “assessment loop” (Design →Performance Model →Analysis →Results →new Design). Actually, the first transitions in the loop are well-known today and even some tool support exists for them. However, very different is the case for the last one (from Results to a new Design), and our interest is to further exploit these case studies to gain insight at this regard and then to try to automate some aspects of this transition, i.e., how to automate design decisions based on analysis results. Chapter 4 A Performance Assessment Methodology Architecture design is a crucial part of the software development process, where decisions about which software elements will make up the system and their relationships are taken, as pointed out Williams and Smith (2002). Software architectures have emerged in the last years as the cornerstone for early evaluation of qualitative and quantitative properties of the software (QoSA, 2013). In the SPE field, architecture design is recognized as an asset for performance assessment. In this chapter, we present a scenario-based methodology to apply SPE principles and techniques to assess software architecture at design. Our methodology has been developed in G´omez-Mart´ınez et al. (2013a) taking the insight gained in (G´omez- Mart´ınez and Merseguer, 2006b; G´omez-Mart´ınez et al., 2007; G´omez-Mart´ınez and Merseguer, 2010; G´omez-Mart´ınez et al., 2013b) and makes use of the concepts and notations given in Chapter 2. This methodology allows to assess performance as a “by-product” of the software life-cycle. Along this dissertation thesis, we describe the iterative process leading to develop this methodology by means of examples. In Chapter 3, we apply SPE principles to different systems: a Web-based service application, a mobile agent tracking system and an interoperability gateway. In Chapter 5, we offer advise by indicating how we actually applied the methodology in an industrial project. The remainder of the chapter is organized as follows. Section 4.1 outlines the assessment approach. Then, Section 4.2 presents the phase of designing a system architecture. Section 4.3 explains how performance models are obtained. Section 4.4 defines performance objectives. Section 4.5 details the assessment stage, proposing alternatives to meet performance objectives and to improve software architectures. Section 4.6 revises the state of the art and places our proposal in the current scene. Finally, some conclusions are given in Section 4.7. 73 74 4. A Performance Assessment Methodology 4.1 Overview of the Methodology In this chapter, we resort to well-established SPE principles and techniques (Smith, 1990) for performance assessment of software architectures. The methodology we propose, outlined in Figure 4.1, loops to decide whether the proposed performance objectives are met and to obtain the architecture that can meet these objectives. The methodology is inspired by the Performance by Unified Model Analysis (PUMA) approach proposed by (Woodside et al., 2005, 2013). Design Performance Model Performance Analysis Assessment [No] [Yes] performance objec!ves? New Design First Design Design + Op!mal Configura!on Results Figure 4.1: Performance assessment methodology loop We base our work on PUMA for several reasons, among others because PUMA was developed by one of the most experienced performance evaluation groups worldwide1, and because we have had satisfactory industrial experiences using it in the past (G´omez-Mart´ınez et al., 2007; G´omez-Mart´ınez and Merseguer, 2010). However, PUMA not only presents advantages, we were aware that PUMA is a methodology that demands performance expertise, at this regard we had to simplify PUMA in order to ease its application by software engineers. Unlike PUMA, which was designed for managing various formalisms in the same project, we only focus on Petri nets, 1http://www.sce.carleton.ca/rads/index.html 4.1. Overview of the Methodology 75 concretely GSPN, and we also include an assessment stage, being this phase the chief contribution of our methodology. Although we based on PUMA for the reasons above, there exist other methodologies that could have been used provided that the authors would have had previous industrial experiences with them. Among these proposals it is worth mentioning Q-ImPrESS (2009), PASA by Williams and Smith (2002) or the Palladio Component Model (PCM) by Becker et al. (2009); these methodologies are reviewed in Section 4.6. Our methodology is then composed of four phases, which are outlined in the following paragraphs: •Design. The methodology begins by modeling the system architecture using UML diagrams. We also address the behaviour of those scenarios of the system critical for performance. Finally, in the design, it is also introduced the performance view of the system, which identifies the scenarios that are important from a performance perspective. These scenarios are called performance scenarios (Smith, 1990). •Performance Model. For each critical scenario, a performance model is obtained. We use Generalized Stochastic Petri Nets (GSPN) proposed by (Ajmone Marsan et al., 1995) as performance model. Section 2.4.3 offers an introduction to this formalism. •Performance Analysis. According to Smith (1990) measures of interest in our work are response time, scalability and resources utilization. They are computed by analysis or simulation of the performance model. We will carry out sensitive analysis, which means to modify performance parameters to test different system configurations. Sensitive analysis is managed in the assessment step to locate performance issues (e.g., high response times or overused resources) and solutions. In fact, the assessment of these outcomes will help us to get responsive and scalable systems. •Assessment. The assessment stage proposes alternatives to meet performance objectives and to improve the software architecture. Resource replication, threading and improvement of service times are the choices commonly explored. In our work, we also considered performance patterns and performance antipatterns as choices that could improve performance. This methodology for assessing software architectures is transparent for software designers. By “transparent” we mean that the software designer should be concerned as less as possible to learn new processes since the analysis and design task already implies the use of the aforementioned methodology. Although goal of this methodology is to apply it at architectural level, we put into practice our methodology to a running example in order to illustrate the process along this chapter. We adapt the classical in concurrency Producer-Consumer problem (Gomaa, 2000). This problem describes two processes: the Producer and the Consumer. The Producer generates a piece of data and puts it into a shared 76 4. A Performance Assessment Methodology common resource, called Buffer. The Consumer is waiting to receive the data and, then, consume it. In our example, a User calls to the Producer-Consumer. 4.2 Performance-Oriented Design The first step in our methodology is to describe a software architecture by means of UML diagrams. Thus, software engineers elaborate the UML design of a system; in particular, the architectural design with special emphasis on the behavioural view, which is of primary importance for performance assessment. Therefore, this step includes two activities: software architecture design by means of UML diagrams and performance view using performance information annotated with MARTE, a UML profile. 4.2.1 Software Design: UML diagrams We use UML as the modeling language for software design. We mainly focus on those UML diagrams which allow us to extract performance information for the next steps of our approach: Use Case Diagram, Deployment Diagram, Interaction Overview Diagram, Sequence Diagram, Activity Diagram and State Machine Diagram. The following paragraphs explain how we use each of these diagrams. For a more extended explanation of these UML diagrams, see Section 2.2. •UML Use Case Diagram (UC) is a behavioural diagram that describes the functionality of a system in a horizontal way. In our approach, UCs model scenarios, see Section 2.3.1, as well as the population, that is, the number of concurrent users in each scenario. •UML Interaction Overview Diagram (IOD) is a special and restricted kind of UML Activity Diagram which represents the flow relationships among fragments and UML Sequence Diagrams. IODs represent high-level scenarios, as well as their population. •UML Deployment Diagram (DD) identifies the system software components as well as the hardware nodes in which the former are deployed. DDs are used to have a static view of the software architecture and, for the performance perspective, to show potential communication delays and/or the number of available resources. •UML Sequence Diagram (SD) shows object interactions; more specifically the messages exchanged between the system components arranged in time sequence. It provides useful constructors such as loops, alternatives or parallel execution. SDs represent the performance scenarios with time information, host demands, messages size exchanged and acquisition/release of resources. •UML Activity Diagram (AD) specifies the control flow of a component, subsystem, or system. An activity represents an action in the execution of the 4.2. Performance-Oriented Design 77 activity. In our methodology, ADs are employed to express execution times of actions within a specific activity, as well as the acquisition/release of concrete resources. •UML State Machine Diagram (SM) describes the lifetime of objects. A state represents a time period in the life of an object during which the object satisfies some condition, performs some action or waits for an event. SMs are mainly used to get information concerning activities duration. The software engineer decides which of these UML diagrams better express the performance design of the software architecture, as well as the level of detail, i.e., an IOD shows high-level interactions while a SM specifies object level. Nevertheless, from the performance perspective, it is sufficient to model at least one behavioural view (IOD, SD, AD and/or SM). In the following, we document the Producer-Consumer example. The static view is represented with the DD in Figure 4.2. Thus, the Producer node deploys the Producer package; and the Consumer node, the Consumer package. Both nodes are connected through a communication node, concretely a network. network Producer Processor Producer Consumer Processor Consumer <<deploy>><<deploy>> <<gaCommHost>> <<resource>> {resMult=$nConsumers} <<resource>> {resMult=$nProducers} <<gaExecHost>> {u!liza!on=(expr=$uProducer, source=req, statQ=mean)} <<gaExecHost>> {u!liza!on=(expr=$uConsumer, source=req, statQ=mean)} Figure 4.2: Producer-Consumer example: UML Deployment Diagram. Figure 4.3 depicts the SM of the Producer-Consumer example. The Producer produces an item, which could be an Integer or a String with a probability of 30% and 70%, respectively. Then, it waits for a signal of IsConsumed from the Consumer. Meanwhile, the Consumer is waiting to get an item from the Producer to consume. 78 4. A Performance Assessment Methodology /Producer.IsConsumed() IsProduced() Consuming do/Consume Wai ngForProducer Consumer /Consumer.IsProduced() IsConsumed() ProducingString do/ProduceString Init Wai ngForConsumer Producer ProducingInteger do/ProduceInteger /Consumer.IsProduced() do/Init <<gaStep>> {hostDemand=(100.00,unit=ms, statQ=mean,source=est)} <<gaStep>> {hostDemand=(20.00,unit=ms, statQ=mean,source=est), prob=0.3} <<gaStep>> {hostDemand=(5.00,unit=ms, statQ=mean,source=est), prob=0.7} <<gaStep>> {hostDemand=(0.01,unit=ms, statQ=mean,source=est)} Figure 4.3: Producer-Consumer example: UML State Machine Diagram. 4.3. Performance Model 85 Table 4.1: Subset of performance annotations in MARTE. Stereotype Tag Value Diagram Element Annotation GaWorkload- Event pattern (closed (population= NFP Integer)) IOD, SD, AD Scenario Closed population that executes a scenario. GaScenario respTime NFP Duration IOD, SD, AD Scenario Required response time for a Scenario. hostDemand NFP Duration SD, AD, SM Scenario The sum of all demands for all its steps, executed in the same host. GaStep hostDemand NFP Duration SD, AD, SM Step CPU demand on the host of the process that executes the Step. rep NFP Integer SD, AD, SM Step Repetition count for a Step or loop. prob NFP Real SD, AD, SM Step The probability that the Step (subpath) is executed. host GaExecHost SD, AD, SM Step To deploy a step to a particular execution host. GaCommStep msgSize NFP DataSize SD Messages Size of exchanged messages. GaAcqStep acqRes Resource DD Step Resource to be acquired within the step. GaRelStep relRes Resource DD Step Resource to be released within the step. Resource resMult NFP Integer DD Node Number of an specific resource. StorageResource- - DD Node A storage resource. GaExecHost utilization NFP Real DD Node The fraction of time that an execution resource is busy. GaCommHost utilization NFP Real DD Node The fraction of time that a communication resource is busy. speedFactor NFP DataTxRate DD Node Speed of a communication resource. 86 4. A Performance Assessment Methodology Table 4.2: Translation rules of the performance annotations in MARTE into GSPN models. Stereotype Tag Annotation GSPN GaScenario respTime Required response time for a Scenario. Variable to be computed. hostDemand The sum of all demands for all its steps, executed in the same host. Firing delay rate of a timed transitions. GaWorkload- Event pattern Closed population that executes a scenario. Number of tokens in the place which represents the initial state of each scenario. workload Scenario GaStep hostDemand CPU demand on the host of the process that executes the Step. Firing rate of a timed transitions. rep Repetition count for a Step or loop. The arcs are weighted with the number of repetitions. ini_loop end_loop Loop reprep prob Probability rate that a Step (subpath) is executed. Routing rate of subpaths is specified by the firing rate of a immediate transitions. i prob₁ prob₂ prob ... being, ∑ i probi= 1 host To deploy a step to a particular execution host. The host is acquired before the step execution and released after the completion of the step. acq_host rel_host Step host 4.3. Performance Model 87 Stereotype Tag Annotation GSPN GaAcqStep acqRes Resource to be acquired within the step. The resource is acquired before the step execution. acq_host rel_host Step host GaRelStep relRes Resource to be released within the step. The resource is released after the completion of the step. acq_host rel_host Step host GaCommStep msgSize Size of exchanged messages. See below speedFactor stereotype. Resource resMult Number of specific resources. By populating the place representing a resource with as many tokens as resources indicated. acq_host rel_host Step host n GaExecHost utilization The fraction of time that an execution resource is busy. Variable to be computed. GaCommHost utilization The fraction of time that a communication resource is busy. Variable to be computed. speedFactor Speed of a communication resource. The transmission of a message through a communication node is modeled with a timed transitions, being delay firing time: t=size speed ini_comm end_com Comm t 88 4. A Performance Assessment Methodology Furthermore, we developed ArgoSPE, an ArgoUML (2013) plug-in which implements the aforementioned algorithms. A detailed description of ArgoSPE is found in Chapter 6. Thus, we model the system using ArgoSPE and translate each critical scenario identified in the former step. For each critical scenario, we obtain the corresponding structure of a GSPN. Nevertheless, the translation using ArgoSPE, although automatic and, in principle, transparent for the software architect, requires some additional effort as we remark in Chapter 6, since ArgoSPE only supports a subset of performance annotations in UML-SPT. Thereby, we need to introduce some of the latter performance parameters in the GSPN models manually. Recalling the Producer-Consumer example, if we translate the UML diagrams depicted in Figures 4.2, 4.3 and 4.4 into a GSPN according to the aforementioned algorithms and rules, we obtain the GSPN shown in Figure 4.7. produceInteger init produceString $nUsers p=0.7p=0.3 t=0.1 t=5t=20 $nProducers Producer end_producer Wai ngForConsumer cycle User Consume $nConsumers t=100 Consumer end_consumer Figure 4.7: Producer-Consumer example: GSPN. 4.4. Performance Analysis 89 4.4 Performance Analysis Once obtained the performance models of the key performance scenarios, the software engineer reviews the performance objectives, which were defined during the design step, and carries out the analysis of the performance model. According to Smith and Williams (2002b), performance objectives are quantitative measures that can be computed in the performance models. We chiefly focus on: responsiveness and scalability. Responsiveness is the ability of a system to meet its objectives for response time (or throughput). Scalability is the ability of a system to continue to meet its response time as the demand for the software function increases. The response time of a software architecture is the time required to response a user request or an external request from other system. The scalability of a software architecture is the ability to support a very large amount of concurrent users or external requests. Beyond these objectives, that are generally established by the software architect during design step, we also determine software resource utilization as a performance objective, due to its relation to scalability. Utilization appropriately measures the effect of software as it scales in usage (Smith and Williams, 2002b). Furthermore, in the case of a software architecture would be deployed in a “pay-per-use” cloud infrastructures, the resources utilization affects directly with the economic cost. Although the most important task in this step is to validate that the software architecture meets the proposed performance objectives by analysing the performance models of its critical scenarios for obtaining results, previously it is needed to compute these performance objectives by means of performance measures. Next, we discuss implications of performance objectives and how performance measures are computed in the GSPN models. Section 2.4 offers an introduction of Petri nets concepts, as well as some techniques of analysis. Computation of Measures in the GSPN Models We compute all the measures (response time, utilization and scalability) under steady state assumption. Transient state is the probability of the system of being in state iat time tand steady state is the probability of being in state i. Therefore, steady state means that the system reaches an equilibrium. Thus, measures obtained will continue in the future, which is a more general assumption than transient state. In consequence, transient solution is more meaningful than steady state solution when the system under investigation needs to be evaluated with respect to its short-term behaviour (Bolch et al., 2001). Using steady state measures instead of transient measures could lead to substantial errors in this case. From the software architecture point of view, steady state assumption represents a typical run execution of an application or component. Transient state could be interpreted as a snapshot of its execution. Although transient analysis can be interesting to study reliability assessment (Gokhale and Trivedi, 2002), we only focus on steady state analysis, since we propose to obtain mean response times of running software architectures. 90 4. A Performance Assessment Methodology In order to calculate the steady state, i.e., the values of the average behaviour, all the places of a GSPN must be covered by p-semiflows, and therefore it must be structurally bounded (Ross, 1983). Thus, in a GSPN, steady state analysis can be carried out when the net is cyclical. However, the translation of a UML behavioural diagram, such as a UML Sequence Diagram, produces an acyclical GSPN. It starts with a place representing an initial state (see in Figure 4.7, place $np) and ends with a transition for the last scenario message, (see in Figure 4.7, transition tcycle). Therefore, we need to add an arc from this last transition to the starting place, then achieving a cyclical net and all the places are covered by p-semiflows. Observe the red arc depicted in Figure 4.8, which illustrates the GSPN with the closed cycle of the Producer-Consumer example. Now, the scenario can be analysed under steady state assumption. produceInteger init produceString $nUsers p=0.7p=0.3 t=0.1 t=5t=20 $nProducers Producer end_producer Wai ngForConsumer cycle User Consume $nConsumers t=100 Consumer end_consumer $nUsers $nUsers Figure 4.8: Producer-Consumer example: Closed-cycle GSPN. In addition, since we only consider closed workloads, we assume that the entire execution cycle is finished when all the population finishes its cycle, i.e., the first 4.4. Performance Analysis 91 token must “wait” until the last one completes its cycle. We model this behaviour by adding weight to the aforesaid arc, being this weight equals to the number of tokens that populates the initial state. Figure 4.8 illustrates this weighted arc in red (from transition cycle to place User). 4.4.1 Responsiveness Responsiveness is the ability of a system to meet its objectives for response time or throughput (Smith and Williams, 2002b). The response time of scenario is the time required to response a user request or an external request from other system. Therefore, it is important to determine who or what interacts with each critical scenario of the software architecture under analysis. We only consider average response time of critical performance scenarios. In software systems with Human Computer Interaction (HCI), the response time is defined from the users’s perspective as the number of seconds required to response a user request. Basic advice regarding response times has been studied by Miller (1968) and Card et al. (1991), among others. The Usability Engineering principles, proposed by Nielsen (1993), establish the following intervals: •0.1 second is about the limit for having the user feel that the system is reacting instantaneously. •1.0 second is about the limit for the user’s flow of thought to stay uninterrupted, even though the user will notice the delay. •10 seconds is about the limit for keeping the user’s attention focused on the dialogue. Users should be given feedback indicating when the computer expects to be done. Furthermore, in software architectures with human interaction, it would be desirable to analyse its target audience, as we demonstrate in the case study described in Section 5.3.3. For instance, if in our target audience are people with special needs, we should study the kind of impairment the user has and the kind of devices or services they use; or if the potential users are kids, the response times should be less, since they need quick responses. Generally, in any software architecture, all the expected response times of HCI scenarios should be within these intervals. For real-time systems, response time is the amount of time required to respond to a particular external event or the number of events that can be processed in a given time (Smith and Williams, 2002b). In these cases, the response times depend on the purpose of the system and the application domain. Consequently, software engineers must define the objective of response times in those cases. In the presented methodology, we specify the response time of a scenario using <<GaScenario>> stereotype and the annotation respT. Since the average response time is calculated (source=calc), a variable $RT in VSL gathers the following computation result. The unit of measurement is a time unit, usually seconds s, and the statistical measure is a mean. 92 4. A Performance Assessment Methodology Computation of Responsiveness in GSPN Models The average response time RT of a scenario is calculated as the inverse of the throughput χof the transition tcycle that closes the entire execution cycle. RT =1 χtcycle As mentioned, the result of this computation is gathered in the variable $RT and translated to the UML behavioural diagram that represents the scenario. 4.4.2 Scalability A software architecture is scalable if, when there is a significant increase in the number of resources and the number of users, it will remain (Coulouris et al., 2005). Then, the software architecture scalability can be defined as the ability to support a very large amount of concurrent users. Scalability of a software architecture depends on the usage context as well as its deployment. The same software architecture can be deployed in very different environments, e.g., building automation, urban, leisure or financial. The number of concurrent users can vary considerably, even for the same kind of environment it changes by orders of magnitude, for example, in the building automation case we could have smart homes, asylums, hospitals or hotels. Considering that a software architecture has to be the same for all environments, it needs to scale accordingly. In an embedded system, the scalability is also conditioned for its own internal demand of resources and services. As such, the execution context, not only users, is of crucial importance for scaling up the system. In consequence, the number of potential users (or internal demands) of a software architecture should be studied taking into account the context of use. If this number is large, the scalability must be analysed. Otherwise, this step can be skipped. As mentioned previously, we model the scalability of a software architecture parameterizing the number of concurrent users that populates the system, which is specified through a variable $nUsers in VSL in the <<GaWorkloadEvent>> stereotype. The annotation pattern=closed shows that we only consider closed workloads. This population is represented in the GSPN with the initial marking of the first place of the net. Computation of the Scalability in GSPN Models We determine the scalability of the system by calculating the response times using future workload intensities (Smith and Williams, 2002b). To study the system scalability, we compute the system response time varying the parameter that represents the population. For each population value we obtain its corresponding response time. Figure 4.9 depicts the response times for the Producer-Consumer example with concurrent users. 4.4. Performance Analysis 93 0 1 10 20 30 40 50 60 70 80 90 100 Response Time (sec) Number of users 2 4 6 8 10 12 Figure 4.9: Producer-Consumer: Response times for concurrent users. 4.4.3 Utilization Lazowska et al. (1984) defined the utilization of a resource as the proportion of time the resource is busy, or, equivalently, as the average number of customers in service. From the SPE perspective, Smith and Williams (2002b) denoted the determination of software resource utilization to appropriately measure effect of software as it scales in usage. Therefore, resource utilization analysis detects resource saturation and potential bottlenecks when the system is highly populated and consequently, it permits to tune up the resource configuration. The optimal resources configuration directly defines resource optimization. When resources are not well-dimensioned, it may happen that either the throughput is constrained by lack of available resources (then performance is lower than it could be), or there are idle resources (then money has been squandered) (Goldratt and Cox, 1992). In addition, the resource utilization relates with the power consumption. Accordingly, apart from detecting bottlenecks, it is crucial an appropriate resource utilization, since it determines how to deploy the software architecture into an infrastructure. For instance, if the architecture is planned to be deployed into cloud-based infrastructure, which imply pay-per-use services. Being each new instance of a thread independently invoiced, resource utilization must be optimized. If the case of infrastructure such as datacenter, the deployment of a new software architecture directly impacts in the economic cost for the acquisition of new hardware. As pointed out, resources are represented in the UML Sequence Diagrams by lifelines or in the UML Deployment Diagrams as nodes. The number of copies of a resource is modelled with the <<Resource>> stereotype annotated with restMult. The utilization of a resource is specified through the annotation utilization of the <<GaExecHost>> and the <<GaCommHost>> stereotype in the variable U, which 94 4. A Performance Assessment Methodology is computed. Computation of the Utilization in the GSPN Models According to the rules described in Table 4.2, each resource, software or hardware, is represented by a place pin the GSPN. The number of tokens Min the place prepresents the available copies of that resource. Sereno and Balbo (1997) defined that the utilization of a place is given by the steady state probability that the place is non-empty. On the other hand, the average number of tokens nin steady state represents the mean occupancy of the place. Therefore, the utilization Uof a place pthat represents a resource can be calculated as: Up=M(p)−n(p) M(p) Finally, the variable Uin the corresponding UML-DD gathers the utilization rate of the resource in the software architecture. A resource is saturated when its utilization ratio is closed to 1. Nevertheless, both Lazowska et al. (1984) and Smith and Williams (2002b) advice that percentages higher than 80% should be analysed. Figure 4.10 plots the utilizations of the Producer-Consumer example. As it can be observed, Producer resource is high saturated. 0,00% 10,00% 20,00% 30,00% 40,00% 50,00% 60,00% 70,00% 80,00% 90,00% 100,00% U liza on Producer Consumer 1 10 20 30 40 50 60 70 80 90 100 Number of users Figure 4.10: Producer-Consumer: Utilization of each resource. 4.5 Performance Assessment In the light of the analysis results, the aim of the assessment is to introduce changes in the system for getting the best possible software architecture configuration. For each assessment iteration, we consider to apply at least: resource replication, performance patterns and performance antipatterns. Next, we describe to which extend we use these techniques. 4.5. Performance Assessment 101 use of available bandwidth, and inefficient interface, or both. The Batching performance pattern combines items into messages to make better use of available bandwidth is the best solution. •Roundtripping (Smith and Williams, 2003) occurs when many fields in a user interface must be retrieved from a remote system. The solution will be to buffer all the calls together and make them in one trip. The Facade design pattern and the distributed command bean accomplish this buffering. •Tower of Babel (Smith and Williams, 2003) occurs when processes excessively convert, parse, and translate internal data into a common exchange format such as XML. To detect this antipattern, the Fast Path performance pattern identifies paths that should be streamlined. The solution will be to minimize the conversion, parsing, and translation on those paths. •One-Lane Bridge (Smith and Williams, 2000) occurs at a point in execution where only one, or a few, processes may continue to execute concurrently. Other processes are delayed while they wait for their turn. To alleviate the congestion, use the Shared Resources Principle to minimize conflicts. •Excessive Dynamic Allocation (Smith and Williams, 2000) occurs by the overhead required when an application unnecessarily creates and destroys large number of objects during its execution. The two solutions are: 1) “Recycle” objects (via an object “pool”) rather than creating new ones each time they needed. 2) Use the Flyweight pattern to eliminate the need to create new objects. •The Ramp (Smith and Williams, 2003) occurs when processing time increases as the system is used. The solution will be to select algorithms or data structures based on maximum size or use algorithms that adapt to the size. •Traffic Jam (Smith and Williams, 2000) occurs when one problem causes a backlog of jobs that produces wide variability in response time which persists long after the problem has disappeared. To solve this antipattern is necessary to begin by eliminating the original cause of the backlog. If this is not possible, provide sufficient processing power to handle the worst-case load. •More is Less (Smith and Williams, 2002a) occurs when a system spends more time “thrashing than accomplishing real work because there are too many processes relative to available resources. The solutions will be to Quantify the thresholds where thrashing occurs (using models or measurements) and determine if the architecture can meet its performance goals while staying below the thresholds. •Sisyphus Database Retrieval (Dugan-Jr. et al., 2002) occurs when performing repeated queries that need only a subset of the results. The solutions will be to use advanced search techniques that only return the needed subset. 102 4. A Performance Assessment Methodology •Falling Dominoes (Smith and Williams, 2003) occurs when one failure causes performance failures in other components. To solve this antipattern is necessary to make sure that broken pieces are isolated until they are repaired. •Unnecessary Processing (Smith and Williams, 2002a) occurs when processing is not needed or not needed at that time. The solution will be to delete the extra processing steps, reorder steps to detect unnecessary steps earlier, or restructure to delegate those steps to a background task. As we can observe, each antipattern is characterized by its name, problem and textual solution description. Cortellessa et al. (2010, 2012) formalized this textual description, by means of logical predicates, in order to systematize their identification. Figure 4.14 illustrates the algorithm for the antipattern detection process that we adopt in our methodology. Detecon Step Detecon engine Performance Anpa!erns instances Extracng Step Extractor engine Anpa!erns boundaries XML representaon architectural Model Transform into Performance model Performance indices UML Model annotated with MARTE Modelling Step Anpa!erns modelling XML schema <<conformTo>> <<implement>> Performance anpa!erns Performance Anpa!erns as logical predicates Figure 4.14: Adapted antipattern detection algorithm from (Cortellessa et al., 2012). 4.5. Performance Assessment 103 Cortellessa et al. (2012) thus partitioned performance antipatterns in two categories: single-value performance antipatterns detectable by single values of performance indices (such as mean, min or max) and multiple-value performance antipatterns, that require the trend or evolution of the performance indices during the time to capture performance problems. The logical representation of performance antipatterns is based on the following rationale: an antipattern identified unwanted software or hardware properties, hence an antipattern is formulated as predicate on the software architectural model elements. Thereby, an antipattern is composed of a set of basic predicates, which are first described as semi-formal natural language and then formalized by means of first-order logics; and three different views of the software architectural model elements: Static View (software elements), Dynamic View (interactions) and Deployment View (hardware elements). The formalization of the elements that they proposed provides only the concepts that antipatterns require to be automatically detected. The basic predicates are XML Schema elements. The detection process identifies the system elements encountered in performance antipatterns organized in XML schemas and bounded antipatterns indices in order to identify performance antipatterns in software architecture. In addition, Cortellessa et al. built an engine to automatically detect performance antipatterns and to refactorize them by generating a feedback step at the software architecture level. The detection engine returns as output the specific model elements that participate in the occurrence of the antipattern, and if any device causes it. We follow Cortellessa’s approach to automatically identify performance antipatterns in software architectures. Like our methodology, they also model software architecture by means of UML diagrams annotated with MARTE as input. However, they transform the software architecture model to Queueing Network (QN) using PRIMAUML tool (Cortellessa and Mirandola, 2002) in order to obtain performance measures, while we propose to use GSPN models. Moreover, we adapt their XML schemas which represent the logical predicates of the performance antipatterns, to only consider our subset of performance annotations, which slighly differs that Cortellesa’s approach. Since the Producer-Consumer example is very simple, no performance antipattern is detected. 4.5.4 Optimal Configuration Finally, the final step in the assessment phase is the obtaining of the optimal configuration of the software architecture. In other words, we apply all the improvements proposed in the previous steps to our initial software architecture design in order to verify if our software architecture meets the performance objectives. Once, all the proposed improvements are applied, the assessment loop of our methodology is closed when we validate that the software architecture under study meets performance objectives. In the case of the Producer-Consumer example, the optimal configuration is the following: the increasing of the number of Producer threads. 104 4. A Performance Assessment Methodology 4.6 Related Work Software architecture assessment constitutes an important stage in the software design process, in order to guarantee non-functional requirements. Nevertheless, to the best of our knowledge, there are very few initiatives to assess architectures based on SPE principles at industrial level. An exception is the PASA (Performance Assessment of Software Architectures) method, proposed by Williams and Smith (2002). PASA, focused on performance scenarios, is a performance-based software architecture analysis method that provides a framework for the whole assessment process. PASA inspired us in order to automatically systematize the process to detect performance issues, as well as to propose the corresponding potential solutions. As in PASA, our methodology carries out performance analysis considering responsiveness, but also resource utilization and scalability. Moreover, we have included automatic detection of performance patterns and antipatterns, by considering the work of Cortellessa et al. (2012). Pooley and Abdullatif (2010) defined Continuous Performance Assessment of Software Architecture (CPASA). This method adapts PASA to the agile development process. To the best of our knowledge, CPASA has not been applied to an industrial case yet. Liu et al. (2005) developed a methodology for component-based applications to predict their performance under various workloads. As in our approach patterns play an important role, but at architectural level in this case. Patterns are modeled by means of UML Activity Diagrams, while system scenarios using UML Sequence Diagrams, as in our approach. Queuing networks were used for prediction. To verify the approach they implemented different systems and established errors of prediction around 11 and 15 percent. Basing on component-based software engineering, Becker et al. (2009) proposed a meta-model to predict extra-functional properties component-based software architectures designed with Palladio Component Model. They modeled parametric context dependencies to system resources and dependencies to parameter usages. Following this work, Huber et al. (2010) described an industrial case study where they applied the Palladio Component Model to a storage system. A model was firstly implemented, next they conducted several experiments on a prototype to derive the resource usage of each model component and finally, the model was calibrated with realistic resource demands and validated. The approach presented by Trubiani and Koziolek (2011) aimed to identify flaws in Palladio Component Models basing on performance antipatterns. They suggested design alternatives to solve these antipatterns. The Software Engineering Institute (SEI) created some well-known scenario assessment methods: the Scenario-Based Analysis of Software Architecture (SAAM) and the Architecture Tradeoff Analysis Method (ATAM). SAAM tries to measure the software’s quality through scenarios, rather than the general and inaccurate quality attributes description (Bass et al., 2005). ATAM is a method for evaluating software architectures relative to quality attribute goals (Clements et al., 2002). ATAM evaluations expose architectural risks that potentially inhibit the achievement of an 4.7. Conclusions 105 organization’s business goals. Nevertheless, neither of these two approaches follow SPE principles. As above stated, PUMA (Woodside et al., 2005; Petriu et al., 2012; Woodside et al., 2013) also guided our work. PUMA is not a methodology, but a model transformation chain. It translates behavioral UML diagrams annotated with performance attributes into different formalisms using intermediate performance models, concretely Core Scenario Models (CSM). Unlike PUMA, which is focused on performance analysis, we go one step beyond taking performance results of software architectures at design phase and exploring different alternatives to meet performance objectives and, consequently, improve the system. Nevertheless, we only use GSPN as performance model. 4.7 Conclusions In this chapter, we have presented a scenario-based methodology for assessing software architectures at design level. This methodology is based on SPE techniques and principles and inspired by the PUMA approach (Woodside et al., 2005, 2013). The use of SPE in the early phases of the life-cycle avoids the fix-it later approach (Smith, 1990). This methodology closes the “assessment loop” (Design →Performance Model → Analysis →Results →new Design), since it automates some design decisions based on performance analysis results. The proposed methodology is a part of the software development life-cycle in early stages, being the performance assessment a “by-product”. Therefore, software engineer and practitioner does not need an additional effort to learn about software architecture assessment from performance viewpoint, as well as GSPNs or other performance models. 106 4. A Performance Assessment Methodology Chapter 5 Industrial Case Study: An Interoperable Architecture Once we have gained insight in the performance assessment of software architectures by means of the case studies in Chapter 3, we have applied our proposal of the performance assessment methodology, developed in Chapter 4, to a case study. This chapter is an industrial experience since we report results regarding the application of the performance assessment methodology to a real-complex industrial project, which we exhibited in (G´omez-Mart´ınez et al., 2013a). This case study is an interoperable architecture to automatically adapt interfaces for people with disabilities. Moreover, some of the components and functionalities of the system were presented in G´omez-Mart´ınez and Merseguer (2010); Iglesias-P´erez et al. (2010); Murua et al. (2011) and G´omez-Mart´ınez et al. (2013b). We have developed this chapter following recommendations from Runeson and H¨ost (2009) about case study research methodology for software engineering. Thus, the objective of the chapter is twofold. First, we want to describe how we applied SPE in the project, with special attention to performance patterns and antipatterns. Therefore, this chapter tries to be a blueprint for practitioners needing to evaluate performance in a software project. On the other hand, we want to assess the software architecture for performance, which is of interest not only for the project engineers but also for designers of accessible user interfaces. The rest of the chapter contains the following sections. Firstly, Section 5.1 summarizes the industrial project and its objectives. The software architecture is outlined in Section 5.2, where chief software components are described. Section 5.3 applies the assessment approach to the aforementioned architecture. Section 5.4 discusses obtained results. Section 5.5 covers related work. Finally, Section 5.6 gives some conclusions of the chapter. 107 108 5. Industrial Case Study: An Interoperable Architecture 5.1 Overview Universal Access continues being a critical quality target for Information and Communications Technology (ICT), as Stephanidis (2001) stated, especially in industrial societies where there is a growing number of people with functional diversity, including those with aging-related conditions. Indeed, ICTs may require particular skills and abilities to interact with platforms, the plethora of wireless communication systems and smart devices such as kiosks or ATMs. The inexistence of these skills and abilities extends in some cases the traditional concept of disabled people towards people with functional diversity or special needs. The growing gap between their abilities and access to ICT is called the digital divide. Interoperable software architectures that support universal designed user interfaces and Assistive Software (AS from now on) are two approaches to bridge this gap, e.g., (Margetis et al., 2012; Cabrera-Umpi´errez et al., 2011; Zimmermann and Vanderheiden, 2008). The INREDIS project (INterfaces for RElations between Environment and people with DISabilities) (INREDIS Consortium, 2010b) aimed to develop environments that enable the creation of communications and interaction channels between people with some kind of special need and their context, where the targets are a set of autodiscoverable devices. More than 200 researchers from 14 Spanish companies and 19 research organizations collaborated to carry out this project during 48 months and a budget of e23.6 millions. In the context of this project, an interoperable architecture, capable of adapting different types of interfaces to users needs and preferences, was designed and developed. In addition, we also developed an autonomous AS selection mechanism that makes the environment able to automatically select the most suitable AS according to user’s profile, user’s device capabilities and target device services. Although goal of the INREDIS project was to completely develop an accessibility architecture for disabled people, here we only focus on the analysis and design steps of the project, in particular in the performance assessment carried out. The basis for the assessment is to explore the feasibility of deploying this architecture in environments with a large number of concurrent users. Early performance assessment for the system architecture is highly desirable to prevent underperformance during system deployment. For achieving this performance assessment of the software architecture, we have followed our proposed methodology, detailed in Chapter 4, based on the principles of Software Performance Engineering (SPE) (Smith, 1990). Nevertheless, the performance assessment was intricate, due to several reasons: •INREDIS is a very large system, various developing teams of tens of people were involved. •Technologies were new for these teams. So, it was unknown how to capitalize these technologies for system performance maximization. •Being the product targeted to people with special needs, performance requirements may differ from the habitual ones. 5.2. An Interoperable Architecture 109 •We expected to deploy the system in various settings, most of them not yet completely defined. For example, hotels or facilities where hundreds of users could leverage the system. Performance evaluation of software systems has been traditionally accomplished after deployment. This is the well-known fix-it later approach and it has well-known problems (Smith, 1990). For example, the cost of re-architecting, re-implementing and re-deploying the system when performance goals are not fulfilled. Also the overbudget for being out of schedule as Woodside et al. (2007) described. Moreover, our project had specific reasons for rejecting the fix it later approach: •Although the operative versions of the system should be deployed at the very end of the project, we needed to deploy prototypes at the beginning of the project, for users experimentation. •We needed to experiment with the potential environments previously referred. So, to gain some insight about their potential system performance. Otherwise, successful implementations in real deployments could not be reused in potential environments, which could imply to start a new project for each new deployment. We have applied the methodology at software architecture design level. In fact, architecture design is a crucial part of the software design process, where decisions about which software elements will make up the system and their relationships are taken. In the SPE field, architecture design is recognized as an asset for performance assessment. 5.2 An Interoperable Architecture The INREDIS architecture further develops the idea of Universal Control Hub (UCH) proposed by Zimmermann and Vanderheiden (2007), see Section 3.3 for its description and performance analysis. Its rationale is that a person with its adapted device (e.g., smartphone, PDA or universal controller) should be able to interact and control different devices (television, door locks, ATMs, and a long etcetera), as well as external software services. For instance, a blind person can control the washing machine (target device), by means of his/her mobile phone (controller device). The controller device allows to introduce assistive technologies to bridge the gap between the user and the target device. The INREDIS architecture was conceived as a universal solution capable to provide disabled and elderly people with accessible and personalized interfaces according to their preferences and needs. Consequently, the architecture was designed for a general purpose context of use. Nevertheless, some running prototypes were built for different environments, covering a wide range of real world scenarios, among them leisure services (location and purchase tickets for events), smart home (Sainz et al., 2011), urban networking (Gim´enez et al., 2012), social networks (Murua et al., 2011), 110 5. Industrial Case Study: An Interoperable Architecture eGoverment (Alvargonz´alez et al., 2010) and banking services (ATMs) (Pous et al., 2012). While users with functional diversity are able to fully exploit the architecture capabilities, “any” user should be able to obtain benefits when using the system (e.g., using their mobiles as universal remote controllers in the smart environment). The most important components of the INREDIS architecture are depicted in the UML Deployment Diagram in Figure 5.1. Recall that the grey notes in the UML diagrams are performance annotations which were explained in Chapter 4. •Knowledge Base (KB in Figure 5.1). It stores ontologies and instances sets that provide formal descriptions of the elements in the INREDIS domain (e.g. user, assistive software instances, devices, software, etc.). The KB also stores the terminology and a collection of rules. It also provides mechanisms for reasoning with each of these type of knowledge and allows querying all the instances set using SPARQL (Prud’hommeaux and Seaborne, 2006). •Adaptive Modelling Server (AMS in Figure 5.1). It keeps updated the KB content using information from different and heterogeneous sources (application context, user interaction logs or complex events processing). •Assistive Technology Server (ATS server in Figure 5.1). It provides automatic discovery and configuration of assistive technologies, in a smart and transparent fashion reducing the existing accessibility gap that may exist between the users and their universal controller device. •Interface Generator (IG in Figure 5.1). It adapts interfaces expressed in a generic and abstract language, a subset of the User Interface Markup Language (UIML) (Phanouriou, 2000), into concrete utilizable and accessible ones (implemented in XHTML (W3C, 2010)). This activity is made in terms of the user characteristics, the device capabilities and the context. All this is possible using the reasoning capabilities provided by the KB. The main processes performed by the INREDIS architecture are pictured by the UML Interaction Overview diagram (IOD) in Figure 5.2. In the following we summarized them. •First Interaction. It consists in the creation of the initial interface that acts as the access medium to the environment for the user. In the generation of such interface the system must take into consideration the relevant set of devices and services for the user (the INREDIS perimeter) and their state (without forgetting the special needs of the user). This process involves an interface generation subprocess, for building an accessible XHTML interface, and the determination of the set of assistive software instances that permit the user to interact which such interface. •Navigation. Once the user has selected the device or service to interact with, the navigation process starts. Devices and services are defined by complex multistaged interface descriptions that users can navigate. Through navigation, we 5.2. An Interoperable Architecture 117 sd Inial Interface Generaon : KB <<control>> : interfaceGenerator <<control>> : Adaptor <<control>> : ATS <<control>> :Container <<control>> : Injector <<control>> : Context <<control>> : Generator <<control>> : InialCreator <<control>> : Servlet <<control>> : Decisor <<control>> getInialInterface() AskAT() getProfiles() profiles configATList chooseAdaptaonTransformaon() getTransformaons() transformaons adaptaons adaptInialInterface() Interface applyATTransformaon() finalInterface finalInterface getUserPerimeterServices() devicesPerimeter getInteraconGeneratorContext() <<create>> context() generateInterface() generateInterface() abstractInterface concrezeInterface() concreteInterface chooseAdaptaonParameters() getUser() userInstance parameters adaptedInterface getInialInterface() <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaStep>> {hostDemand=(166.6,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(34.14,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(1.6,unit=ms, statQ=mean,source=meas)} <<gaCommStep>> {hostDemand=(0.01,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(199.6,unit=ms, statQ=mean,source=meas)} <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaStep>> {hostDemand=(6.4,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(969,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(0.1,unit=ms, statQ=mean,source=meas)} <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaStep>> {hostDemand=(27.8,unit=ms, statQ=mean,source=meas)} <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaStep>> {hostDemand=(3.4,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(10.6,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(9.6,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(1.6,unit=ms, statQ=mean,source=meas)} <<gaAcqStep>> {acqRes=ATS,resUnits=1} <<gaAcqStep>> {relRes=ATS,resUnits=1} Figure 5.5: UML Sequence Diagram modeling the Initial Interface Generation process. 118 5. Industrial Case Study: An Interoperable Architecture formation asking to the KB for information about the user, and it also takes into account information contained in the IG context. Once the IG posses all the necessary information (i.e., the initial interface as a concrete UIML interface, the set of transformations, and the adaptation parameters) it invokes the adaptInitialInterface() method of the Adaptor module. It returns the XHTML document that represents the initial user interface. Finally, there may be some transformations that must be applied to the initial interface XHTML document that stem from the set of assistive software provided and configured by the ATS. They are applied by the Adaptor module (the applyATTransformation() method). After these transformations have been applied, the final version of the interface has been created and can be delivered to the user’s controller device. 5.2.2 Navigation Scenario As we have already stated users interaction with a device often implies navigating through different atomic interfaces. Figure 5.6 shows the SD of the Navigation process. sd Navigaon <<boundary>> UI <<control>> :StarngPoint <<control>> :InteraconEnacter <<control>> :Servlet <<control>> :IntefaceGenerator navigate finalInterface initInteraconEnacter() requestProcess() inredis() ack getInterface() interface Interface Generaon ref <<gaCommStep>> {msgSize=((value=$1,unit=B,statQ=min), (value=$2,unit=B,statQ=max))} <<gaCommStep>> {hostDemand=(0.01,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(16.1,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(62.1,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(34.5,unit=ms, statQ=mean,source=meas)} Figure 5.6: UML Sequence Diagram modeling a simple navigation The interaction starts with the interface requesting a navigation to the Starting Point that acts as a gateway between the user interface and the system. The Interaction Enacter is the module that handles the navigation between interfaces. It is so because the Navigation activity is considered a subclass of the Device Interaction activity, as from a user perspective, the kind of buttons that perform device interaction activities are the same as those that allow the user navigate within the complex interface. In the request Interaction Enacter accesses to the navigation graph of the complex interface and determines which is the next interface that should be gener- 5.2. An Interoperable Architecture 119 ated. This information is stored in the context of the IG. Finally, a new interface generation process starts. As the context of the IG has been updated with the next interface to be rendered, this is the one that is rendered. Interface Generation Process INREDIS devices UIML interfaces are composed of two types of documents: •Views, a set of UIML documents that describe structure and its interaction elements of each atomic interface. As described in Abrams et al. (1999), the use of UIML allows the abstract and platform-independent definition of user interfaces. •Navigability graph, which defines the how and on what conditions the complex interfaces navigates throw the different views. Only one view at a time is shown, we refer to it as the current view. Generating an interface for a user means to transform the current view of an interface into an accessible XHTML document taking into account the characteristics of the user and the needed assistive technology. Most part of the process, depicted in Figure 5.7, is identical to the one defined for the first interaction. The difference is that this process does not adapt the initial interface, but it transforms the current view of the device interface that the user is using at present (which like in the case of the initial interface created by the Initial Creator is an abstract UIML interface). The first part of the diagram, the one related with the detection of accessibility gaps and the determination of the necessary assistive technology, is the same as the one defined for the first interaction with the INREDIS system. When the Generator module receives the petition of generating an interface by means of the generateInterface() module the first step is to determine which is the current view of the interface. This information is stored in the context of the IG (getCurrentView() method). The current view is a URL that points to the location of the abstract UIML document that should be used as the starting point of the final user interface. The Generator module invokes the retrieveXMLSource() method of the helper class Resource Manager, and retrieves an abstract UIML interface. The rest of the steps of the generation of the interface are exactly as the ones described for the first interaction. Instead of using the abstract UIML interface created by the Initial Creator, they use the abstract UIML interface retrieved by the Resource Manager from the interface current view URL. 5.2.3 Device Interaction Scenario The interactions with devices, and services are realized by the Interaction Enacter, see the SD in Figure 5.8. This module once initialized executes the action involved in the device/service interaction. In order to do so it invokes the executeAction() method of the 120 5. Industrial Case Study: An Interoperable Architecture sd Interface Generaon : KB <<control>> : Servlet <<control>> : Interface Generator <<control>> : Adaptor <<control>> : ATS <<control>> : Decisor <<control>> :Container <<control>> : Injector <<control>> : Context <<control>> : Generator <<control>> :ResourceManager <<control>> getInterface() AskAT() getProfiles() profiles configATList chooseAdaptaonTransformaon() getTransformaons() transformaons adaptaons applyATTransformaon() finalInterface finalInterface getInteraconGeneratorContext() generateInterface() getCurrentView() abstractInterfaceURL retrieveXMLSource() abstractInterface concrezeInterface() injectContextVariables() getA"ributeValue() a"ributeValue applyInitRules() chooseAdaptaonParameter() parameters adaptInterface() adaptedInterface adaptedInterface getUser() userInstance getInterface() <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaStep>> {hostDemand=(110.1,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(16.1,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(3.1,unit=ms,statQ=mean,source=meas)} <<gaCommStep>> {hostDemand=(2.1,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(0.6,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(51.1,unit=ms, statQ=mean,source=meas)} <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaStep>> {hostDemand=(6,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(1303.5,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(0.1,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(0.1,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(50.1,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(10,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(50.1,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(60.2,unit=ms, statQ=mean,source=meas)} <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaStep>> {hostDemand=(3.4,unit=ms, statQ=mean,source=meas)} <<gaAcqStep>> {acqRes=ATS,resUnits=1} <<gaAcqStep>> {relRes=ATS,resUnits=1} <<gaStep>> {hostDemand=(0.1,unit=ms, statQ=mean,source=meas)} Figure 5.7: SD modeling the Interface Generation process 5.2. An Interoperable Architecture 121 sd Device Interacon : Servlet <<control>> : InteroperabilityGateway <<control>> : UI <<boundary>> : StarngPoint <<control>> : InteraconEnacter <<control>> TargetDevice <<boundary>> : Orchestator <<control>> DoInteracon InitInteraconEnacter processRequest() executeAcon() setValue() aconResponse inredis() finalInterface ref Interface Generaon alt [isUCHTarget] [isWS] invokeWS() ack getInterface() Interface <<gaStep>> {hostDemand=(13.7,unit=ms, statQ=mean,source=meas)} <<gaCommStep>> {hostDemand=(0.1,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(283.7,unit=ms, statQ=mean,source=meas)} <<gaCommStep>> {hostDemand=(0.01,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(1.6,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=($tuch,unit=ms, statQ=mean,source=meas)} <<gaAcqStep>> {acqRes=UCH,resUnits=1} <<gaAcqStep>> {relRes=UCH,resUnits=1} <<gaStep>> {hostDemand=($tws,unit=ms, statQ=mean,source=meas)} <<gaAcqStep>> {acqRes=WS,resUnits=1} <<gaAcqStep>> {relRes=WS,resUnits=1} <<gaCommStep>> {msgSize=((value=$s1,unit=Mb,statQ=min), (value=$s2,unit=Mb,statQ=max)) <<gaStep>> {hostDemand=(13.73,unit=ms, statQ=mean,source=meas)} <<gaCommStep>> {hostDemand=(0.01,unit=ms, statQ=mean,source=meas)} <<gaCommStep>> {hostDemand=(0.01,unit=ms, statQ=mean,source=meas)} <<gaAcqStep>> {resRes=interopGateway, resUnits=1} <<gaAcqStep>> {acqRes=interopGateway, resUnits=1} <<gaAcqStep>> {resRes=AMS, resUnits=1} <<gaAcqStep>> {acqRes=AMS, resUnits=1} <<gaStep>> {prob=0.1} <<gaStep>> {prob=0.9} Figure 5.8: UML Sequence Diagram representing a user’s device interaction Interoperability Gateway, which is a class that decouples the Interaction Enacter from the underneath technology used to interact with the device. The executeAction() method may result in: •setValue() method invocation, in case that the device is exposed as a UCH target. The user interaction is translated into the change of one or more values of the UCH Target. •invokeWS() method invocation, in case that the device is exposed as a Web service (or when there is no device and we are dealing with a Web service invocation) The result is stored in the context of the IG, for later use in case of need. Once the interaction has been carried out, a new interface is generated (invoking the Orchestrator method getInterface()). This new interface is generated to make sure that it reflects the changes and latest state after the interaction with the device. 122 5. Industrial Case Study: An Interoperable Architecture 5.2.4 Back to Top Scenario sd Back To Top <<boundary>> : UI <<control>> : Star!ngPoint <<control>> : Interac!onEnacter <<control>> : Servlet <<control>> : interfaceGenerator <<control>> : AMS backToTop initInterac!onEnacter() requestProcess() setAbsoluteLoca!on() inredis() absoluteLoca!on Perimeter Calcula!on Interface Genera!on getInterface() interface ack finalInterface ref ref <<gaCommStep>> {hostDemand=(0.01,unit=ms, statQ=mean,source=meas)} <<gaCommStep>> {hostDemand=(65.7,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(23.5,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(84.3,unit=ms, statQ=mean,source=meas)} <<gaStep>> {hostDemand=(16.1,unit=ms, statQ=mean,source=meas)} <<gaCommStep>> {msgSize=((value=$1,unit=B,statQ=min), (value=$2,unit=B,statQ=max))} Figure 5.9: UML Sequence Diagram representing the back-to-top process. This process, illustrated in the SD of Figure 5.9, means going back to the device initial interface. As in the case of the navigation, the Interaction Enacter is the module that handles the back to top process. It is so because this activity is considered a subclass of the Device Interaction activity, as from a user perspective, the kind of buttons that perform device interaction activities are the same as those that allow going back to the device top interface. In order to keep all the information in the KB up-to-date we begin updating the location of the device and we recalculate the information about the user’s INREDIS perimeter. The next step is to generate top interface of the device, which is made using the Interface Generation process that we have already described in Section 5.2.2. 5.2.5 Assistive Software Selection Mechanism Assistive technology is the hardware or software that is added or incorporated within a system than increases accessibility for an individual, as defined in ISO (2011). 5.2. An Interoperable Architecture 123 Assistive Software (AS) is understood as a piece of software used to increase our ability to manage some kind of information in a digital device. The Assistive Software Selection Mechanism (ASSM) makes the environment able to automatically select the most suitable AS for a given interaction with a specific electronic target device taking advantage of the user’s context (user, controller device and target device) and considering the possible discrepancies between the user and the environment, namely in the case of functional diversity. The ASSM uses different knowledge based on ontologies to achieve this goal, so this process consists of five main activities, one of them split into six, see the UML Activity Diagram in Figure 5.10. The complete AS selection mechanism (ASSM) is described by G´omez-Mart´ınez et al. (2013b). The following is a summarized description of each activity. Detecting Discrepancies The first activity detects any accessibility issues that might prevent the user from being able to use a controller. In order to detect discrepancies we use a set of specific rules stored in the KB that compare the characteristics of the interaction that the user is able to perform with those that the controller is able to emit/receive. The complete catalogue of rules is specified by Gonz´alez-Cabero (2010). Checking Feasibility Each discrepancy found in the previous step, is analyzed to determine whether mediation by the AS can enable the interaction. The following activities are intended to ascertain which AS is most appropriate. Matching by History Log When the user has already employed the system to interact with the same target using the same context, it is possible to retrieve the most suitable AS without further reasoning, just by querying the KB and retrieving the matching set from the AS History. Matching by Score This activity triggers the reasoning process where four subsets of concepts are simultaneously queried in the KB using parallel activities. This activity is divided into the next activities: •Retrieve Standard Fulfillment. This activity performs an evaluation where the best scoring AS will be those that follow worldwide accessibility standards established by recognized accessibility entities. •Retrieve Privacy. This activity checks that the AS complies with the data protection measures issued by security bodies. It is important to note that, according to many laws in different countries, when an AS complies with a data protection act level, it also complies some data protection measures. This is taken into account here via rules to assert those facts in the KB. This is the case for e.g., Federal Data Protection and Information Commission of Switzerland or Ley Org´anica de Protecci´on de Datos in Spain. 124 5. Industrial Case Study: An Interoperable Architecture Detecng discrepancies Checking feasibility List of AS AS Matching by Historic Log Sorng Weighted Matching Retrieve Standard Fullfillment Retrieve Privacy Retrieve Ballot Retrieve Deploy Method Retrieve Setup Ulies Matching by Score Error [>1] [=1]error: [=0] [not found] [found] <<gaStep>> {prob=$p3} <<gaStep>> {prob=$p1} <<gaStep>> {hostDemand=($t4,unit=ms, statQ=mean,source=est)} <<gaStep>> {hostDemand=($t5,unit=ms, statQ=mean,source=est)} <<gaStep>> {prob=$p4} <<gaStep>> {prob=$p5} <<gaStep>> {hostDemand=($t6,unit=ms, statQ=mean,source=est)} <<gaStep>> {hostDemand=($t7,unit=ms, statQ=mean,source=est)} <<gaStep>> {hostDemand=($t8,unit=ms, statQ=mean,source=est)} <<gaStep>> {hostDemand=($t1,unit=ms, statQ=mean,source=est)} <<gaStep>> {hostDemand=($t2,unit=ms, statQ=mean,source=est)} <<gaStep>> {hostDemand=($t9,unit=ms, statQ=mean,source=est)} <<gaStep>> {hostDemand=($t10,unit=ms, statQ=mean,source=est)} <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaAcqStep>> {acqRes=KB,resUnits=1} <<gaAcqStep>> {relRes=KB,resUnits=1} <<gaStep>> {prob=$p2} <<gaStep>> {hostDemand=($t3,unit=ms, statQ=mean,source=est)} <<gaScenario>> {respT=(expr=$RT,unit=’s’,statQ=mean,source=req)} <<gaWorkloadEvent>> {pa"ern=(closed(populaon = $NUser))} Figure 5.10: UML Activity Diagram of the AS selection process 5.3. Applying the Assessment Methodology 125 •Retrieve Ballot. This activity increases the score for those AS with the best user reviews. These reviews are drawn from all the system’s users but they are not linked to any individual user, to maintain privacy about users’ functional diversity. •Retrieve Deploy Method. The scoring is the simplest, just to foster the use of AS deployed as SaaS (Software as a Service). •Retrieve Setup Utilities. This activity needs the output of Retrieve Deploy Method, so it is not executed in parallel with the others. All of the concepts are scored in this activity to take into account the ease of access and use of the AS. •Weighted Matching. This is the final activity of matching by score. It focuses on adapting the matching to the user’s preferences and the Domain Experts’ assumptions. The user has been previously asked to state its level of importance by means of the user profile stored in the KB. With the weighting system, all the roles involved in the selection are taken into account (i.e., domain experts, the user, and all system users at once using the reviews). Sorting This is the final activity of the whole process. This activity orders the set of AS products/services of the weighted matching activity in descending order. The system is prepared to automatically provide the first AS in the list (i.e. the most suitable AS for the given context). However, when the user rejects the highestscoring AS, the full set is presented to the user formatted as a descending-order list. The weights used in the ASSM can evolve based on experience, while the overall of the proposal remains fixed. 5.3 Applying the Assessment Methodology In this section, we pursue performance results for assessing and eventually improving the INREDIS architecture. For achieving this objective, we have followed the methodology proposed in Chapter 4 based on SPE principles (Smith, 1990). In the following, we aim to apprise practitioners of the use of the methodology. We offer advise by indicating how we actually applied the methodology in the INREDIS project and which were our choices (e.g., which languages, performance models or tools we used). 5.3.1 Performance-Oriented Design The methodology begins by modeling the system architecture using UML diagrams. We also address the behaviour of those scenarios of the system critical for performance. Section 5.2 reported these two first tasks of this step for our software architecture describing the UML design of the system. In particular, the architectural description 126 5. Industrial Case Study: An Interoperable Architecture has a focus on the behavioural view, which is of primary importance for performance assessment. The overall architecture was presented in the UML Deployment Diagram in Figure 5.1. The IOD in Figure 5.2 defines a general system scenario made of four subscenarios, each one describing a part of the system behaviour. Following the methodology based on SPE principles, we now introduce the performance view of the system. The usual way in SPE for introducing a performance specification is by annotating the design diagrams. As mentioned in Chapter 4, we annotate the UML diagrams with MARTE profile, and use the VSL to define data-types characterized by several properties. MARTE annotations appear as gray notes in the UML diagrams we have presented. In the following, the most interesting annotations are commented. They capture properties, measures and requirements of interest for carrying out performance analysis. Section 4.2 details the performance annotations considered in our methodology. In the following, we summarize some of them in the INREDIS architecture: •The response time has been specified in the IOD in Figure 5.2, in this case using GaScenario annotation. In this case, response time is a measure to be calculated during analysis as indicated by source=calc. The result will be gathered in variable $RT . The unit of measurement are seconds and the statistical measure is a mean. •workload has been specified in the IOD in Figure 5.2 using GaWorkloadEvent annotation. This is a closed workload, then specifying the number of concurrent users in the system through variable $NUsers in VSL. •Host demands represents the system duration of the activities. In our architecture, they have been measured in the testing phase by the software engineers. Figure 5.3 offers some examples. •An example of routing rates is depicted in Figure 5.4 by means of the prob annotation in the GaStep attached to the alternative fragments. •System resources can be expressed in MARTE as lifelines in the UML Sequence Diagrams. Annotations acqRes and relRes attached to GaCommStep specify their acquisition and release. Figure 5.4 depicts several examples, see one of them attached to the KB lifeline. For specifying the number of system available resources, annotation resMult in the deployment (Figure 5.1) is used. Variables (for example $pKB or $pAMS) will allow to perform sensitive analysis parameterizing the system with different number of resources. 5.3.2 Performance Model Following the methodology, we need to obtain a performance model for each critical scenario that we have previously annotated. As formalism, we use Generalized Stochastic Petri Nets (GSPN) proposed by Ajmone Marsan et al. (1995). See Section 2.4 for an introduction of Petri nets.