Context-driven Progressive Enhancement of Mobile Web Applications: a Multicriteria Decision Making Approach

Heiko Desruelle and Frank Gielen

Department of Information Technology (INTEC) - IBCN, Ghent University - iMinds, Ghent, Belgium Email: [email protected]

Personal computing has become all about mobile and embedded devices. As a result, the adoption rate of smartphones is rapidly increasing and this trend has set a need for mobile applications to be available at anytime, anywhere, and on any device. Nevertheless the obvious advantages of such immersive mobile applications, software developers are increasingly facing the challenges related to device fragmentation. Current application development solutions are insufficiently prepared for handling the enormous variety of software platforms and hardware characteristics covering the mobile eco-system. As a result, maintaining a viable balance between development costs and market coverage has turned out to be a challenging issue when developing mobile applications. This article proposes a context-aware software platform for the development and delivery of self-adaptive mobile applications over the Web. An adaptive application composition approach is introduced, capable of autonomously bypassing context-related fragmentation issues. This goal is achieved by incorporating and validating the concept of fine- grained progressive application enhancements based on a multi-criteria decision making strategy.

Keywords: Mobile Web applications; Context-awareness; Progressive enhancement; Multicriteria decision making; Adaptive engineering

1. INTRODUCTION manufacturers, the mobile ecosystem is absolutely not all about iPhone devices, nor is it all about Android, Mobile computing has become a powerful mass medium Blackberry, or any other platform. Thousands of with a greater reach and faster growth than any other different mobile devices are currently available, each known media type [1]. The sales of mobile devices have with their specific characteristics and capabilities, recently started to outnumber the traditional laptop ranging from various operating systems, to different and desktop computers. Furthermore, the technology screen sizes, interaction modalities, available APIs, itself is rapidly maturing. Advanced features such as the etc. Consequently, the absence of a single mobile possibility to install and run third party applications are application platform makes it mainly the developer’s becoming a standard capability of devices throughout responsibility to resolve fragmentation handling within all consumer segments. Through the emergence of their application’s code [3]. installable mobile applications, users are given the This article focuses on adaptive mobile application freedom to customize and personalize their device as development via Web technology. Within this context, desired. Unlike desktop devices, mobile users carry the goal of this research is to create optimized their device practically at all times. As a result, mobile Web applications via a progressive enhancement there is a growing need for mobile applications to approach. To support the development of such become available anywhere, at any time, and on any adaptive mobile applications, a method is proposed for type of mobile device. However, various technological extending existing application frameworks with fine- challenges and limitations reside in the development grained mobile progressive enhancement capabilities. of such mobile applications [2]. This important Moreover, a novel adaptive application composition limitation is set by the heavily fragmented mobile algorithm is introduced, which is driven by each user’s landscape. Despite numerous bold claims from device individual context. The approach aims to cover a

The Computer Journal, Vol. ??, No. ??, ???? 2 H. Desruelle and F. Gielen wide range of contextual parameters, covering device capabilities and characteristics (device context), user preferences and profile details (user context), location and time details (environment context). As a result, this process aims to propose a robust and future proof method for the flexible composition of Web applications. The remainder of this article is structured as follows. Section 2 provides background and related work regarding context-awareness and software adaptability within the Web-based application engineering domain. FIGURE 1. Traditional progressive enhancement. A Section 3 discusses the concepts and algorithmic client-side process for incrementally and unobtrusively structure of the adaptive Web application composition enhancing a Web application based on a set of specific browser capabilities approach. Section 4 deals with the architectural aspects of extending application frameworks with such fine-grained progressive enhancement capabilities. Subsequently, Section 5 evaluates the proof-of-concept implementation of this architecture. Furthermore, points, turning the convergence of mobile applications the evaluation is elaborated based on a use case via Web technology not to be expected any time soon for implementing an adaptive mobile e-commerce [2]. Recent studies revealed the active use of 2,130 dif- application through the proposed approach. Finally, ferent mobile devices. This study concludes developers future work and the conclusion are presented in Section currently need to target over 18 devices to reach 50 % of 6. the active mobile market. To reach 60 %, 80 %, or even 90 % of the active mobile users, this number increases to 37, 156, and 330 devices, respectively [6]. In order 2. BACKGROUND AND RELATED WORK to reach a sustainable share of the mobile market, Web As introduced in Section 1, the goal of this research applications need to be made dynamically adaptable is to provide automated application adaptability for a to the contextual environment in which they are being broad range of mobile devices. This section describes executed. The adaptation and optimization of an ap- a number of supporting methods as well as alternative plication should thus be supported based on contextual approaches for coping with the numerous adaptability parameters such as hardware characteristics, software requirements in the development process of mobile Web limitations, the user’s profile and preferences, etc. All applications. of this is without the developer’s explicit intervention. Since the early days of Web-based software engineer- 2.1. The web as an application platform ing, developers have tried to cope with the distinct differences between Web browser capabilities. Grace- Developing an application for multiple mobile platforms ful degradation was one of the first widespread design often requires a skilled and multi-disciplined develop- strategies aiming to do so [7]. The approach focuses ment team [4]. This requirement considerably drives on providing optimal support for the most advanced up an application’s development costs and will evidently browsers. Less capable browsers are only considered narrow its target market as well. Against this backdrop, during the very last development stages. Such a design the use of the Web as a generic and cross-platform ap- strategy often results in a poor stripped-down version. plication solution is rapidly gaining momentum. Device The graceful degradation methodology expects users to independent Web technologies such as HTML (appli- just upgrade their browser when the degraded version cation structure), CSS (style) and JavaScript (behav- does not fit their needs. However, in the context of mo- ior) offer application developers an unprecedented mar- bile devices, upgrading the pre-installed browser is in ket reach compared to native application development most cases not an option. The default browsers are of- with Java, Objective-C, or C++. Moreover, the In- ten an inherent part of the mobile operating system, ternational Telecommunication Union (ITU) has esti- and alternatives are not always provided. mated the use of mobile Internet connectivity to sur- The progressive enhancement (PE) design approach, pass the access rates of traditional desktop-based In- on the other hand, reverses the graceful degradation ternet by the end of 2013 [5]. Nevertheless, even with methodology and aims at maximizing usability and the use of standardized Web solutions, efficiently man- accessibility over browsers with different capabilities aging mobile fragmentation remains an important re- [8]. Progressive enhancement tries to achieve this search topic. Current Web standards are still primarily goal by forcing developers to take less capable devices agnostic to the variety of available user interaction and into account from the very start of their development presentation modalities. Furthermore, existing mobile process. First, a basic markup document is created, Web browsers and runtimes contain many variability providing an optimal experience for devices with

The Computer Journal, Vol. ??, No. ??, ???? Context-driven Progressive Enhancement of Mobile Web Applications 3

FIGURE 2. Fine-grained mobile progressive enhancement. Dynamic server-side stack composition, driven by the specific characteristics and capabilities of a client’s mobile device

the lowest common denominator (LCD) of available layers. As shown in Figure 2, an intelligent mechanism capabilities. Incrementally and unobtrusively, one or is needed, supporting the automated creation of more layers of structural, presentational, and behavioral progressive enhancement stacks based on the user’s enhancements are added to the core application. This specific contextual setting. step is executed as a function of the requesting browser’s specific capabilities. A conceptual overview of the 2.2. Adaptive web engineering progressive enhancement approach is shown in Figure 1, as it is used for stacking application layers on top of Web-based software systems are traditionally engi- a core content layer. neered along three orthogonal dimensions: the devel- opment phases, the system’s views, and its aspects [11]. Progressive enhancement can also be applied in a As illustrated in Figure 3, this approach is characterized mobile context to tackle fragmentation related issues. by its separation of concerns. The phase dimension sets E.g., specific layers can be created to accommodate out the different stages of the Web development pro- for various screen sizes. However, when turning this cess, ranging from analysis, to design, and implementa- theoretical mobile progressive enhancement approach tion. Each of these phases requires a number of specific into actual practice, a considerable number of challenges views to be defined, addressing the system’s content come into play. Progressive enhancement is a client- structures, the navigational structures between content side process, executed by the device’s browser. The nodes, and its presentation towards the user. Hence, use of CSS3 Media Queries and externally linked the views dimension. Finally, the aspects dimension CSS and JavaScript resources are the most common sets out the structural and behavioral aspects of each practice for selecting an appropriate set of enhancement of the above mentioned views. layers [9]. The number of detectable variability points The growing presence and importance of mobile via this approach is however very limited. As a applications emphasizes the need for fragmentation result, enhancements can only be selected based on management within the Web engineering methodology. the device’s screen characteristics and a coarse-grained As identified by Kappel et al., adaptability can be description of the browser’s supported styling and considered as an additional Web engineering dimension, scripting capabilities. crosscutting all existing Web modeling dimensions [10]. To provide optimized end-user usability, progressive Moreover, Schauerhuber et al. as well as Linaje et enhancement should also reckon with other contextual al. investigated various modeling methods and found a parameters, such as the different interaction methods number of approaches incorporating partial support for and hardware characteristics offered by mobile devices. adaptability requirements (i.e., UWE, WSDM, HERA, E.g., a touch-based device will most likely require WebML, etc.) [11] [12]. Nevertheless, the applicability some additional presentational enhancement layers, of these modeling methods for straightforward and providing a user interface with more space to accurately (semi-)automated handling of mobile fragmentation click buttons, links, etc. In order to set up such remains rather limited. This observation can be a viable mobile progressive enhancement solution, explained through the complex composition of the it has become increasingly important to support mobile design space. Various contextual aspects more fine-grained mechanisms for the applicability influence a modeling method’s expressiveness with evaluation and selection of progressive enhancement regard to adaptability [13]:

The Computer Journal, Vol. ??, No. ??, ???? 4 H. Desruelle and F. Gielen

• Context of Use: In most cases, an application’s adaptability requirements are defined in terms of the contextual situation in which it is being executed. As formally defined by ISO 9241-11, the context of use spans a detailed set of descriptions characterizing the application’s user, as well as the target device, and the objects in its physical environment [14]. • Degree of Adaptation: Adaptability requirements can be static or dynamic. Static adaptation only FIGURE 3. Adaptability as a crosscutting aspect on the considers pre-defined versions of an application, traditional modeling dimensions of Web engineering (Koch specified at design time. Dynamic adaptation, on et al. [15]) the other hand, enables applications to be adapted at runtime based on the parameters of their current contextual environment. • Adaptation Granularity: The granularity of its user agent string in the HTTP header. In an application’s adaptability requirements also order to facilitate the collection and aggregation of impacts the engineering complexity. This property these device profiles, the W3C Mobile Web Initiative indicates whether the defined adaptation process (MWI) standardized the Device Description Repository affects the entire application (macro level), or only specification (DDR). The specification provides an API a contained number of identifiable subcomponents and its associated vocabulary for structured access (micro level). to context providers services via user agent strings [21]. In essence, a DDR thus provides a standardized As a result, adaptability requirements are to be han- means for retrieving contextual information about a- dled throughout every stage of an application’s devel- priori knowledge on the characteristics of a particular opment life cycle. Especially from a mobile software target device or Web runtime. Various open source as development perspective, the multi-dimensional impact well as proprietary DDR implementations are currently of adaptability puts a heavy burden on the application actively being maintained. Most notably OpenDDR, engineering and development processes. WURFL, and DeviceAtlas. In a mobile setting, the end-user’s profile has gained 2.3. Mobile context of use modeling much importance. Aside from exposing information The availability of detailed and reliable metadata on user preferences and specific experience, this model regarding a user’s contextual setting provides an should also comprise knowledge regarding the user’s important driver for enabling a mobile application’s specific abilities and disabilities. E.g., enabling dynamic adaptability requirements. The entities accessibility requirements for providing support to represented by this contextual information might elderly people, and people with disabilities. From this influence the adaptability requirements regarding the perspective, Heckmann proposed the GUMO formalism application’s user interface, behavior, content, etc. In as a general user model ontology for representing initial context-aware research, context was considered generic user descriptions using the Web Ontology to be a component described by two parameters: Language semantics (OWL) [22]. The current challenge the end-user’s location and the set of objects in in this domain is to model the enormous amount his or her immediate vicinity [16]. The subsequent of parameters and relationships that characterize the introduction of extensible contextual categories has user context [23]. To overcome this issue, forces are drastically increased the flexibility of this definition being joined with other ontology-driven projects such [17]. Chen and Kotz hereto identified five contextual as Linked Data [24], and UbisWorld [25]. Finally, base categories: the device context, the user context, there are various approaches for aggregating the actual the environment context, the time context, and the user context knowledge. State of the art reasoners historical context [18]. are capable of automatically compose user profiles by The device context describes the characteristics examining a user’s behavior and data traffic contents of the target device that is being used to access (e.g., Google Now, Webinos platform, etc.) [26]. the application. The mobile ecosystem covers a Alternatively, a widely-used approach is to rather wide diversity of screen sizes, interaction methods, focus on aggregating user context knowledge via user software support, etc. In Web-based environments, preference profiles. In this case, all knowledge is the device capabilities are generally retrieved through explicitly provided by the user via preference settings. Resource Description Framework (RDF) device profiles, Such a light-weight mechanism obviously reduces the i.e., User Agent Profile (UAProf) and Composite context aggregation system’s complexity, but in turn Capability/Preference Profiles (CC/PP) [19] [20]. With increases the human-computer interface’s complexity. this approach, the user’s device is identified by matching The environment, time, and historical context

The Computer Journal, Vol. ??, No. ??, ???? Context-driven Progressive Enhancement of Mobile Web Applications 5

FIGURE 4. The LSP score aggregation mechanism. Each candidate solution is individually matched to a set of pre-defined performance variables. The system is subsequently able to derive the candidate solution’s overall suitability score by feeding the resulting elementary degrees of similarity to a logic network of aggregation operators (derived from Dujmovic et al. [29])

are aspects that define where, how, and when the the evaluation, comparison, and selection of complex interactions between the user and an application are hardware and software systems. The method has taking place. The environment context is specified shown its use in various domains where multiple criteria by observing the numerous sensors available on the influence the decision making processes. LSP has many user’s device (e.g., geo-location, temperature, network applications, especially concerning situations with large service discovery, the level of background noise, etc.). and complex solution spaces. Furthermore, the notion of time and historical context To evaluate a candidate solution, LSP starts by is not to be neglected. As context is a dynamic assessing an available solution’s similarity with n chosen concept, support for temporal pattern recognition and performance variables. The set of performance variables management is needed. The W3C Ubiquitous Web is denoted as Domain is currently in the process of standardizing the Delivery Context Ontology specification (DCO) [27]. χ = {x1, x2, . . . , xn} . (1) The DCO provides a formal model of the characteristics Each performance variable defines a specific property, of the environment in which devices, applications, and which an ideal candidate solution is expected to posses. services are operating. As the algorithm deals with complex decision problems, most candidate solutions will not perfectly match the 3. ADAPTIVE MOBILE APPLICATION preset criteria. Nevertheless, such candidates should COMPOSITION ALGORITHM not be rejected from the very start, as their overall evaluation might still turn out to lead to an acceptable This section proposes an adaptive application compo- solution. LSP addresses this issue by taking into sition algorithm, enabling the above defined objective account how well a candidate matches the different to allow for the fine-grained progressive enhancement of performance variables. For each variable x in χ (with Web applications. Mobile applications should provide i i = 1, . . . , n), a corresponding degree of suitability users with an optimal experience based on the specific E ∈ [0, 1] is calculated. This score expresses the exact contextual capabilities of their device and environment. i similarity between a candidate solution and the specific In order to cope with the wide variety of mobile charac- performance variable x , ranging from 0 to 100 %. In teristics, a quantitative evaluation algorithm is intro- i order to attain these scores, LSP requires a predefined duced, derived from the Logic Scoring of Preference mapping function g for each of the n performance (LSP) method. This adaptive application composition xi variables in χ [29]. algorithm is designed to support fine-grained progres- sive enhancement and is capable of suggesting a stack g : Dom(x ) → [0, 1] , ∀x ∈ χ . (2) of layers that optimally fits the user’s mobile device. xi i i

As defined in Equation (2), the function gxi maps 3.1. LSP quantitative evaluation method the degree of similarity between performance variable xi and the set of values in its corresponding function The Logic Scoring of Preference method is a domain Dom(xi). Hence, quantitative decision method, proposed by Dujmovic

[28]. It is designed to assist decision makers in Ei = gxi (ci), ci ∈ Dom(xi) , (3)

The Computer Journal, Vol. ??, No. ??, ???? 6 H. Desruelle and F. Gielen

TABLE 1. Boolean logic mapping function, leading to value concentration. Interaction capability Match Touch 0 % Stylus 100 % Joystick 0 % Click wheel 0 %

TABLE 2. Fuzzy logic mapping function for optimized value spreading Interaction capability Match Touch 75 % Stylus 100 % Joystick 30 % Click wheel 10 %

FIGURE 5. Continuous mapping function with value by applying the candidate solution’s value ci for spreading for matching target devices’ screen heights performance variable xi as a parameter to function gxi . Both Table 1 and Table 2 below illustrate a discrete valued mapping function implementations for the same performance variable in a mobile context. Figure 5, importance of individual suitability degrees within the on the other hand, illustrates a continuous mapping equation. The calculated aggregation network results function for calculating variable similarities. in an objective overall suitability score After obtaining the elementary degrees of satisfac- tion, all individual matching scores are to be combined E = L (E ,...,E ) , (6) into one objective overall suitability score. This aggre- 0 1 n gated score is used to determine the best-matching can- where the function L defines a logic aggregation didate. LSP supports the use of aggregation networks, network, combining one or more GCDs using a set expressing the mutual relationships between individual of individual suitability degrees as input parameters. scores and how to calculate the overall score (see Fig- After calculating E0 for each of the candidate solutions, ure 4). The standard aggregation operators in LSP are conclusions regarding the best-matching solution can based on the superposition of fundamental Generalized subsequently be drawn. The LSP approach selects the Conjunction Disjunction (GCD) [30]. These operators candidate with the highest overall suitability score E0 enable aggregations in terms of partial conjunction, full as the optimal choice for the presented problem. conjunction, partial disjunction, full disjunction, and neutrality in a single operator. Moreover, a GCD sup- 3.2. LSP selection in a mobile context ports the specification of aggregations in terms of 17 graded combinations of conjunction and disjunction. A The LSP method provides evaluators the ability to frequently used implementation for GCDs are Weighted flexibly, yet objectively, evaluate complex systems Power Means (WPM), supporting all 17 GCD conjunc- under various contextual circumstances. Such a tion/disjunction grades. multicriteria decision making (MCDM) approach can be exploited to implement the envisioned adaptive composition of progressively enhanceable mobile Web

WPM (E1,E2,...,Em; W1,W2,...,Wm; r) = applications. In this particular case, a stack 1 of enhancement layers is considered the candidate r r r r (W1E1 + W2E2 + ... + WmEm) . (4) solution. Each candidate must define the conditions in which it should be able to contribute to an The variables W in Equation (4) represent the i application’s optimization, and to what extent the relative weight for each elementary degree of suitability conditions are strictly required or rather considered E . These weights are mutually balanced by the i optional. The specified conditions will be matched to following requirement: the set of performance variables χ reflecting the client device’s supported capabilities and characteristics. The W + ... + W = 1 . (5) 1 m available stacks of progressive enhancement layers are The exponent r ∈ R, moreover, is determined in turn individually evaluated by matching their desired in function of the aggregation’s desired degree of conditions to the mobile user’s contextual setting (e.g., conjunction or disjunction. This flexible exponent the device’s available interaction methods, CSS and allows an evaluator to precisely interlink the mutual JavaScript support, etc.). As with the standard

The Computer Journal, Vol. ??, No. ??, ???? Context-driven Progressive Enhancement of Mobile Web Applications 7

LSP approach, the overall degree of desirability E0 is expressed in terms of a GCD logic aggregation network. Incorporating the LSP method in a mobile context requires a defined mobile mapping function gxi for each performance variable xi. The mapping functions specify the similarity between the target device’s performance variables and the specific capabilities supported by the candidate solution (i.e., covered by Dom(xi), the function domain of xi). To illustrate the concept of mobile mapping FIGURE 6. A high level system overview. Integrating the functions, both Table 1 and Table 2 contain the fine-grained progressive enhancement approach to optimally implementation of a mobile mapping function that serve mobile devices within existing Web application compares the performance variable “stylus-based frameworks interaction” with a candidate solution’s expected interaction method. The function in Table 1 maps the performance variable’s domain values using Boolean logic. A Boolean approach implies that only a perfect as a generic substitution operation Φ match is scored. The function implementation in Table 2, on the other hand, uses fuzzy logic and makes Φ = ψ [l1/q1, l2/q2, . . . , lp/qp] . (7) much better use of the available scoring interval by The transformation Φ in Equation (7) covers p also grading the less-than-perfect matches. This second simultaneous substitutions. It consists of an expression approach is more consistent with the LSP philosophy, ψ which is matched for the patterns li that in turn as it enables LSP to postpone the final selection are substituted by their associated expression qi (with decision until all performance variables are evaluated i = 1, . . . , p). and balanced. The above mentioned examples highlight Within the context of applying mobile progressive the importance of carefully thought through mapping enhancement layers, ψ represents the lowest common functions. In this context, the W3C Mobile Web Best denominator (LCD) version of the mobile application. Practices Working Group (MWBP-WG), as well as the Each expression qi represent one of the selected W3C Web Accessibility Initiative (WAI) have provided progressive enhancement layers, whilst the associated a significant resources repository for the development of li defines that layer’s specific target pattern in the mobile LSP mapping functions [31]. The published set application. For most behavioral and presentational of recommendations in the mobile Web usability and enhancement layers, the pattern to be matched is accessibility areas are an excellent example of potential the Web application’s tag. Nonetheless, the sources from which usable mobile mapping functions proposed substitution approach also allows for more can be extracted. Figure 5, e.g., depicts a continuous complex structural enhancement layers to be supported mapping function, matching device’s screen resolution by matching and transforming specific structural with a candidate solution designed for a 960 pixels high aspects of the application. screen. Finally, the elementary scores Ei which resulted from matching the candidate progressive enhancement stacks 4. ARCHITECTURE AND DESIGN with the device’s specific capabilities are aggregated This section discusses the software architecture and into an overall suitability score E0. During this last data structures needed to integrate the presented stage of the selection algorithm, the overall score is adaptive application composition algorithm within an attained by applying the candidate’s predefined GCD application development environment. First, the logic aggregation network L. Once all combinations of algorithm proposed in Section 3 is mapped to an available candidate solutions have been evaluated, the extensible software architecture that selects an optimal optimal layer selection process is concluded by selecting stack of progressive enhancement layers based on the highest scoring progressive enhancement stack. the client’s contextual description and the available enhancement stacks in its repository. Next, the data 3.3. Progressive enhancement stack applica- structure for defining progressive enhancement stacks tion for this system is elaborated. Once the optimal stack of progressive enhancement 4.1. Web application framework extension layers has been identified, the final step of the adaptive composition algorithm is to apply the stack’s layers In general, developers dedicate substantial efforts in to the mobile application. The set of p progressive mastering a specific development environment and enhancement layers in the selected stack is applied using application framework. From this perspective, it a single transformation rule, which can be represented should thus be desirable to support existing frameworks

The Computer Journal, Vol. ??, No. ??, ???? 8 H. Desruelle and F. Gielen

FIGURE 7. Detailed system architecture. Enabling an application framework to request a stack of progressive enhancement layers that optimally suits the user’s device characteristics

FIGURE 8. Simplified representation of the context sub-models, spanning the mobile context of use

rather than to introduce a completely new development The Progressive Enhancement Manager represents framework. Hence, support for fine-grained mobile the system’s interface to the outside world. It progressive enhancement is provided as a generic plug- delegates all incoming requests from the application in for existing Web application platforms. A high framework to return an optimized stack of progressive level overview of the approach is depicted in Figure enhancement layers. The manager starts by accessing 6. The proposed fine-grained progressive enhancement the Context Manager component, which returns extension interacts with Web application frameworks detailed information on the current target device’s through a Web interface. Calling this interface selects delivery context. This contextual description spans a progressive enhancement stack that is optimized all contextual knowledge within the system. The for the particular capabilities of the current end-user model builds upon the W3C’s Delivery Context and his device. As a result, application developers Ontology (DCO) specification [27] and the Context are no longer required to manually support the of Use (COU) model proposed by the NEXOF-RA wide range of contextual variability points, as mobile Project [32]. The context of use model comprises fragmentation issues are handled by the proposed three top-level sub-models: the user context, the framework extension. What follows is a brief device context, and the environment context (see elaboration on the main architectural components of Figure 8 for a simplified UML model representation). the system, which are shown below in Figure 7. The models are internally managed and updated by

The Computer Journal, Vol. ??, No. ??, ???? Context-driven Progressive Enhancement of Mobile Web Applications 9

FIGURE 9. Data structure specification of a mobile progressive enhancement stack using XML Schema Definition (XSD). Each layer defines two major components: (a) the suitability GCD aggregation network, and (b) the stack’s enhancement resources (HTML, JavaScript, CSS, etc.)

the system. In order for each of these proposed device context model comprises knowledge regarding models to support historical evaluation, pattern the corresponding device’s hardware characteristics, detection, and conflict resolution strategies, all stored supported software, etc. The environment context context properties are timestamped. The contextual model contains a description of a certain device’s information regarding the end-user is described by location, orientation, etc. the user context model. This model consists of an aggregation of user profile data, user preferences, After obtaining all necessary contextual informa- social context information, etc. Furthermore, the tion, the Progressive Enhancement Manager in turn device and its physical environment are described by addresses the Caching Service component to find out a separate instance of respectively the device context whether the result for this particular context has previ- model and the environment context model. The ously been calculated and cached. Due to performance considerations, the caching of results for popular devices

The Computer Journal, Vol. ??, No. ??, ???? 10 H. Desruelle and F. Gielen is an important part of the system (see performance and 5. EVALUATION DETAILS scalability evaluation discussion in Section 5). In case of a cache-miss, the execution of the adaptive applica- This section evaluates the algorithm and system archi- tion composition algorithm triggered. This process is tecture introduced in Section 3 and Section 4 respec- managed by the Mobile LSP Engine component. tively. First, a proof-of-concept platform implementa- The Mobile LSP Engine is responsible for selecting tion is realized. The prototype implementation is subse- the actual progressive enhancement stack which is to be quently used to validate the adaptive application plat- returned to the application framework. This component form’s objectives regarding its usability, performance, is at the heart of the proposed system, as it objectively and scalability aspects. Two evaluation approaches are evaluates the applicability of candidate progressive applied to validate the usability of the proposed system. enhancement layers. The engine starts by fetching all For quick and consistent evaluation, a first iteration of progressive enhancement stacks currently deployed in usability tests is carried out using an objective auto- the system. Next, the mobile mapping functions are mated evaluation mechanism. This iteration is then retrieved, specifying the degree of similarity between followed by a round of subjective focus group evalua- desired context of use parameters and the client’s actual tions for a more detailed validation. Next, the influence situation. The Mobile LSP Engine calculates the of the approach on the application framework’s perfor- overall similarity score for each candidate progressive mance and scalability is evaluated through profiling and enhancement stack. Lastly, the engine selects the benchmarking. stack with the highest overall score and thus best matches the characteristics of the client. This final 5.1. Proof of concept implementation selection is passed back to the Progressive Enhancement Manager component. The manager will cache the For the system’s prototype, all architectural compo- mapping between the current delivery context and the nents have been implemented as part of an exten- resulting enhancement stack. In parallel, the selected sion to the WAFL open source project [33] [34]. The enhancement stack is delivered to the requesting proposed fine-grained progressive enhancement exten- 1 application framework. sion has been implemented for both the Drupal and Joomla! 2 Web application frameworks. The plat- form’s context manager was implemented based on the 4.2. Mobile progressive enhancement datas- WURFL device description repository 3 (see Section tructure 2.3). In addition, various mobile progressive enhance- ment layers were created, as a means to validate the The application composition algorithm relies on a system’s capability to adapt to the characteristics of server-side process for the selection of the most heterogeneous delivery environments. The created en- suitable progressive enhancement stack. The proposed hancements range from simple CSS styling layers for framework requires a structured description of the feature phones, to complex HTML5/CSS3/JavaScript available layers, as this data will be used to accurately layers providing a native look-and-feel for high-end perform a fine-grained applicability evaluation. To this smartphones, and even location-aware layers for GPS- purpose, an XML Schema Definition (XSD) has been enabled devices. specified, capturing the syntax of a mobile progressive Furthermore, to enable the thorough evaluation enhancement stack within the system. of some usability and performance aspects of the As shown in Figure 9, a stack description consists system, an adaptive m-commerce application has of two major components (specified by the first been built on top of the prototype framework code block, lines 4-11): a suitability aggregation implementations. The commerce application’s lowest network (code block A, lines 13-23) and the stack’s common denominator (LCD) version provides basic enhancement resources (code block B, lines 25-37). functionality and presentational capabilities. The The aggregation network block specifies a combination application LCD enables a consumer to browse through of one or more weighted power means and their a movie catalog, search for specific entries, and consult associated performance variables, which can be freely product details. Driven by the end-user’s context, this selected from the available parameters in the context experience can be enhanced by enabling the system to of use model. The aggregation network is needed automatically load additional PE layers: to enable the LSP stack selection algorithm. The enhancement resources specification block, on the other • Provide featurephone devices with predictive text hand, specifies metadata on the exact type and resource input when searching for movie items and enhance location of this stack’s presentational, behavioral, and it the application’s behavior via collapsible list structural enhancement elements. The enhancement views. resources are used by the system to correctly identify 1http://www.drupal.org and apply enhancement layers, once this particular 2http://www.joomla.org stack has been selected by the LSP selection process. 3http://wurfl.sourceforge.net/

The Computer Journal, Vol. ??, No. ??, ???? Context-driven Progressive Enhancement of Mobile Web Applications 11

TABLE 3. Focus group evaluation categorization Group Device Characteristics A Motorola RAZR - Lowest common denominator device - Basic HTML structure support - No CSS, JavaScript support B Nokia N96 - Mid-range feature phone - Basic HTML structure support - Elementary CSS, JavaScript support C Google Galaxy Nexus - High-end smartphone - HTML5, CSS3, JavaScript support - Android look-and-feel D Apple iPhone - High-end smartphone - HTML5, CSS3, JavaScript support - iOS look-and-feel

(a) (b)

FIGURE 10. Adaptive mCommerce Web application on two feature phones. (a) The Motorola RAZR, a low-end feature phone and (b) the Nokia N96, a mid-range feature phone

(a) (b)

FIGURE 11. Adaptive mCommerce Web application on two smartphones. (a) An Android smartphone, the Google Galaxy Nexus and (b) an iOS smartphone, the Apple iPhone

The Computer Journal, Vol. ??, No. ??, ???? 12 H. Desruelle and F. Gielen

• Provide Android and iPhone client devices with a TABLE 4. Mapping the mobile browser to mimicked native application look-and-feel. Mobile browser Match • Enhance geolocation-enabled devices with direc- Safari 100 % tions to nearby store locations. Chrome Mobile 75 % • Enhance HTML5 notification-enabled client’s with Webkit 70 % information on store promotion via the device’s Opera 65 % native notification center. IE Mobile 15 %

Listing 1. Movie catalog prototype: LCD application skeleton Listing 2. Movie catalog prototype: iOS enhancement entry from the system’s layer repository 1 1 2 2 3

Products

3 4 4 5