A Model-driven Approach to Generate Mobile

0 downloads 0 Views 625KB Size Report
stereotypes to different mobile platforms specific API ... The model reader is the first component in the MAG tool. ..... http://www.adobe.com/products/air.html.
A Model-driven Approach to Generate Mobile Applications for Multiple Platforms Muhammad Usman Software Quality Engineering & Testing Laboratory National University of Computer and Emerging Sciences Islamabad, Pakistan [email protected]

Abstract—Mobile application development has emerged as one of the most focused areas in software industry due to exponential growth of mobile users and applications. The focus of the current mobile industry is on direct implementation, rather than analysis and design. Model-driven engineering practices are ignored, which results in low reusability and lack of portability along with other challenges. In addition, mobile applications also have to support multiple platforms, as an application written for one platform (e.g., Android) cannot run on another platform (e.g., Windows Phone). Each of the platforms in turn suffers from fragmentation. This results in multiple versions of an application that need to be simultaneously maintained. This is a huge burden on the development team, both in terms of cost and effort, due to various platforms that an application supports. This paper proposes a model-driven approach to generate mobile applications for multiple platforms. We carefully identify a subset of UML and propose a modeling methodology for this purpose. We use real use-cases for requirement gathering, class diagram for structural modeling, while state machine are used for behavioral modeling. We focus on modeling business logic layer for the mobile application. We also propose a UML profile for modeling mobile domain specific concepts. Our approach uses Action Language for Foundational Subset of UML (ALF) to specify actions in the state machines. Our approach allows the modeler to automatically generate business logic code for multiple platforms. The approach is supported by an automated tool MAG (Mobile Application Generator). We apply our model-driven approach on an industrial case study ‘Scramble’ app developed by ‘NextIn’ to demonstrate its viability. Keywords-mobile software engineering; UML; use-case diagram; class diagram; state machine; automated application generation; native application

I.

INTRODUCTION

Mobile application development has recently emerged as one of the most focused areas in software industry [1]. Exponential growth of mobile users, extensive use of mobile devices and the variation in mobile platforms has largely influenced the mobile application development [2]. Currently there are around 2.5 million mobile applications available for various platforms. The increase in mobile application development has attracted attention in software engineering [1, 3, 4], but the current software engineering practices do not scale well to the growing needs of mobile industry. A key problem faced by developers is the requirement of mobile applications to

Muhammad Zohaib Iqbal1,2, Muhammad Uzair Khan1 1

Software Quality Engineering & Testing Laboratory National University of Computer and Emerging Sciences Islamabad, Pakistan 2 SnT Centre, University of Luxembourg, Luxembourg {zohaib.iqbal, uzair.khan}@nu.edu.pk support multiple mobile platforms [4]. In the current industrial practice, a number of versions of applications are developed and maintained to support multiple platforms; for example Android application cannot run on Windows Phone. With the growing number of mobile users of all platforms, current practices are not sufficient. The developer has to perform redundant effort to develop the same mobile application for different platforms. Model-driven software engineering is a widely accepted methodology for developing software systems where models are considered as the key artifact [5]. Unified modeling language (UML) [6], is commonly used for developing software systems and has been successfully applied in different domains [7-9]. It consists of a standardized set of notations and semantic rules that provide ways to model both structural and behavioral properties of the system. UML models can prove more beneficial for mobile application modeling because it allows platform independent modeling and transformation to different mobile platforms. MDE is not new for mobile application development [10]. Although there are numerous domain specific languages (DSLs) available for mobile application development [11, 12] but no modeling language exists to model mobile application, so we use UML for this purpose. An important constraint in mobile applications is the short time to market and quick delivery because of high market competition between various vendors [3]. The large number of diagrams in UML is a problem for mobile application modeling. It is common to identify a subset of UML for modeling in particular domain [7, 8]. Therefore, we selected a minimal subset of UML for the purpose of modeling mobile applications. A key requirement of model-driven approach for mobile application development is that the modeling language allows modeling of mobile domain specific concepts (for example, bluetooth, WIFI, contact, message). UML and its standard extension mechanism (i.e., UML profiles) have been used widely for modeling domain specific applications [13]. The existing UML notations are not adequate to model mobile application. We use the standard UML extension mechanism to develop a profile for the modeling domain specific concepts related to mobile application development. For any model-driven approach to be practically applicable, providing a set of notations is not sufficient. A detailed guideline on how to apply the notations in practice is also essential [14]. Therefore we also provide guidelines on how to model mobile applications using UML and our profile.

In this paper, we propose a model-driven approach for automated generation of mobile applications for various mobile platforms. We carefully identify a subset of UML that fits the need of mobile domain. The subset includes UML use-case diagram, class diagram, and the state machine diagram. We use real use-cases for requirements gathering, class diagram for structural modeling, and state machine for behavioral modeling of the mobile application. For mobile domain specific modeling, we propose a mobile UML profile. For executable code generation, we use ALF [15] as an action language, to write various actions in state machines. Our methodology allows the software designers to model the application in a platform independent way, where the focus is on the business logic of the application. To generate mobile application automatically, we develop a tool named Mobile Application Generator (MAG) that takes the developed UML models as input and generates application for the specified target mobile platforms. Our approach implements controller design pattern [16] on top of the generated code. The controller pattern allows the integration of the business logic with the user interface. Note that the proposed model-driven approach focuses on modeling and generation of business logic of mobile applications. The graphical user interface (GUI) needs to be developed separately for each mobile platform (e.g., by using a drag-drop utility). The existing GUI development tools are well-suited for this purpose as they already hide the underlying GUI code during development. In most of the cases, the GUI needs to be tailored according to the screen sizes and resolutions of the mobile devices. The rest of the paper is organized as follows: Section II highlights the practical aspects of mobile application development. Section III defines our proposed model-driven approach for mobile application development. Section IV provides information about application generation process. Section V describes the developed prototype tool. Section VI evaluates our methodology by automatically generating code for an industrial case study. Section VII compares the generated application with current industry trends. Section VIII presents the related work and Section IX finally concludes the paper. II.

PRACTICAL ASPECTS

In this section, we describe the current problems in mobile application development industry. We briefly introduce our industrial partner and the case study that we use to demonstrate our proposed model-driven approach. There are over one million Android applications currently registered in Google play [17]. This reflects a huge mobile market, but it also highlights the problem that mobile users using different operating systems cannot use these applications. To run Android application on different mobile platforms, a redundant effort is required to build the same application from scratch, resulting in loss of time and money [3]. This problem is not specific to Android operating system, but in general, an application written in one platform cannot be used on other platforms. Our industrial partner is a mobile application development organization in Pakistan, NextIn [18]. The

organization is developing a variety of mobile applications ranging from game applications to general-purpose utility applications. NextIn initially targeted Amazon’s Kindle fire devices through Amazon’s app market. They have since expanded to support other devices and platforms such as iOS and Apple app store, Google play for Android applications and Nook tablets. Some of their well-known applications are scramble, flow dots, and slideagram. The mobile application that we use to demonstrate our model-driven approach is scramble [19]. It is developed for Android and published in Amazon store by NextIn. Scramble is an English words’ learning game that helps to improve vocabulary. Figure 1 shows that the scramble board that consists of a 5x5 squares containing a set of 25 characters (one at each position). The words are scrambled, so a particular word can be found in an irregular pattern by moving in 8 different directions. The game contains a timer to allow word’s creation in a specific time. The game also shows hints for different words during the play.

Figure. 1. Scramble mobile application game screen.

NextIn intends to develop scramble application for other platforms including Microsoft Windows Phone. The current version of the application is implemented for Android and therefore the application is not available on Windows Phone. The company has to build the same application for Windows Phone from scratch which is a huge overhead in terms of effort, time and money. Consequently, the company is looking for ways to reduce the development and maintenance efforts. We propose a model-driven approach to solve this problem. We demonstrate our approach by designing a mobile application using a set of UML models and mobile UML profile. The developed models are used to generate mobile applications for different mobile platforms (including the required Microsoft Windows Phone platform). This shows the applicability of our model-driven approach to generate mobile applications automatically.

III.

MODEL-DRIVEN APPROACH

In this section, we present our proposed model-driven approach for mobile application development. We first identify the set of notations required to model mobile applications. We extend the standard UML notations by proposing a UML profile for mobile domain specific concepts modeling. Our approach consists of three major phases: requirements modeling, structural modeling and behavioral modeling. Keeping the requirements of mobile application development in view (e.g., short development cycles); we carefully identify a minimal subset of UML notations for mobile application modeling, consisting of: (i) use-case diagram, (ii) class diagram, and (iii) state machine diagram. First we describe our proposed mobile UML profile used for mobile application modeling and then we present our proposed model-driven approach for mobile application. A. Mobile UML Profile Mobile domain specific concepts (such as, bluetooth, WIFI, contact, message) cannot be adequately expressed in the standard UML diagrams. We define a UML profile for modeling mobile domain specific concepts. We applied the profile definition methodology as suggested by Selic [20].

B. Mobile Application Requirements Modeling The first step in application development is to develop use-cases. Use-cases are widely accepted as a useful way of gathering requirements. Due to the nature of mobile applications, we suggest to use real use-cases [8] (i.e., usecases with technological details). The real use-cases define the requirements of the mobile application with the help of application screens (i.e., user interfaces) and the UML usecase diagram. Application screens are helpful for gathering requirements in mobile application development. By using application screens, we can define various business scenarios. These screens can be used for further elaborating the requirements. We use the standard UML use-case diagram. The use cases can be written using any format, such as the one proposed by Larman [8]. Figure 3 shows an excerpt of the UML use-case diagram for the scramble mobile application. It shows three use-cases. Mobile application runs in highly interrupt-oriented environment where a call or message or any other notification can interrupt the running application at any time instance. In our approach, by default all the usecases are interruptible, i.e., whenever there is an interrupt, the application pauses. To specify uninterruptible scenarios, we provide a stereotype NonInterruptible in mobile UML profile. It is used to mark uninterruptible use-cases in UML use-case diagram as shown in Figure 3.

Figure. 2. An excerpt of mobile UML profile. Figure. 3. UML use-case diagram for scramble game.

We first identify mobile domain specific concepts, their relationships and constraints. Then we map the identified concepts to the UML meta-concepts on the basis of their semantics. In the end, we identify the attributes for the concepts. Figure 2 shows the excerpt of the profile diagram of proposed mobile UML profile. The various concepts of the profile are presented in Table I as stereotypes. TABLE I. Stereotype Persistence ContentManager NotificationHandler Bluetooth

MOBILE UML PROFILE STEREOTYPES DESCRIPTION. Definition Allows to store / retrieve data Integrates different content types support in the application Allow to handle and show phone notification via light, sound or vibration Include bluetooth functionalities in the application

C. Mobile Application Structural Modeling After requirements modeling, the next step is the structural modeling of the mobile application. For this purpose, we use UML class diagram to capture structural details. The mobile application class diagram defines the business concepts, mobile domain specific concepts, their characteristics, and their relationships with one another. The identification of the classes, their properties, their relationships, and mobile specific concepts for the application is helped by application screens, the UML usecase diagram, and the extension section in expanded use-case format [8]. For example, scramble application contains a board to play the game, and a player who plays the game, so Board and Player are modeled as classes in class diagram. Figure 4 shows an excerpt of UML class diagram for scramble mobile application. The designer annotates the

mobile domain specific concepts using stereotypes defined in mobile UML profile, in the class diagram. Persistence stereotype is used to model DBHandler class. During application generation, Persistence stereotype transforms to the mobile platform specific API class.

to model the application in an independent way. The application generator will automatically generate the target application according to the selected platforms.

Figure. 4. UML class diagram for scramble game.

Currently we are focusing on modeling the business logic layer of the mobile application. The user interface (GUI) code is generated automatically using GUI modeling tools (e.g., the one provided by Microsoft Visual Studio). Our approach requires a separation of business logic and GUI code. This is accomplished via the controller pattern [8, 16]. Figure 4 shows Frame and BLController. The Frame class represents the GUI components, whereas the BLController class represents the business logic controller. BLController class handles all the requests from the GUI. D. Mobile Application Behavioral Modeling After creation of class diagram the next step is behavioral modeling of the mobile application. For this purpose, we use UML state machine diagram to capture behavioral details. For the classes in the class diagram that have a behavior, state machines are developed. The class diagram classes whose properties change after a certain event or action in the application screens can be considered as classes with stateful behavior. Figure 5 shows the UML state machine diagram for Board class. The application screen associated with the Board class helps to identify states. For example, we identify a state New Word Created in response to the player action to create new word on the board application screen. Figure 5 contains four states for BoardSM. In mobile application state machine, we mostly have simple states and call events but in case of an interrupt, a signal event is generated by mobile operating system. To generate executable code from state machine, we select the standard action language for UML, ALF to specify various actions [15]. ALF is pretty much similar to Java language. It is easy to use and understand. It more or less presents all the behavior of the application. Figure 5 shows the actions in response to an event in each transition. In Figure 5, the content written after backslash (/) is action. In our proposed approach, the modeler does not need to consider the underlying paradigm of target application development language while modeling. The modeler needs

Figure. 5. UML state machine diagram for Board class.

IV.

MOBILE APPLICATION GENERATION

We use the developed models to generate the code for the business logic layer of the application. The code generation depends on the class and state machine diagrams. The process is divided into two parts, i.e., (i) structural code generation, and (ii) behavioral code generation. Both are explained in the following sub-sections. A. Structural Code Generation The developed UML class diagram is used to generate the code for structural features of the mobile application. We follow the well-known code generation principles for generating code from class diagram [21]. For example, for each modeled class in the class diagram, a class in the specific programming language based on the mobile platform is generated, such as, for Board class, Java Board class is generated for Android platform, C# Board class is generated for Windows Phone platform, while Object C Board class is generated for iOS platform. The attributes in the modeled class transforms into fields in the generated class. Getter and setter methods for all the fields are also generated automatically. The operations in the modeled class transform into methods in the generated class. The navigation property in the association relationship provides the information about the link creation in the generated class. We use mobile UML profile for modeling mobile domain specific concepts, so the modeled classes in the class diagram contain the stereotypes from the mobile UML profile. We propose mappings of mobile UML profile stereotypes to different mobile platforms specific API classes. For instance, Persistence stereotype correspond to the android.content.ContentProvider class in Android API and Microsoft.Phone.Storage.ExternalStorage class in Windows Phone API. During application generation, these mappings are used to generate code corresponding to the platform. The mappings of the mobile UML profile to the

Android and Windows Phone platforms are presented in Table II. Table II shows important stereotypes and their mappings. TABLE II. Stereotype Message

STEREOTYPES’ MAPPINGS

Android android.telephony. SmsManager android.app.Activity Manager android.app.Service

ApplicationActivity BackgroundService Persistence

android.content. ContentProvider android.net.wifi.Wifi Manager

WIFI

Windows Phone Windows.Devices.Sms. SmsDevice Microsoft.Phone.Controls.Phone ApplicationPage Microsoft.Phone.Shell. PhoneApplicationService Microsoft.Phone. Storage.ExternalStorage Windows.Devices.Wifi Direct.WifiDirectDevice

Generator). It takes the UML models developed using our proposed model-driven approach and generates the business logic layer of mobile applications for multiple platforms. Current implementation of MAG only supports Android and Windows Phone mobile platforms, but can easily be extended to support other platforms. Figure 7 shows the architecture of the tool. The developed tool consists of three main components: (i) Model Reader, (ii) Mappings Resolver, and (iii) Application Generator.

B. Behavioral Code Generation The developed UML state machine(s) is used for the generation of code for behavioral features of the mobile application. The classes for all the state machines are already created in the previous step with their properties, methods, and relationships. For transforming UML state machines to their equivalent code, we use the well-known state pattern [16]. For state pattern, every state is transformed to a class. Figure 6 shows the class hierarchy generated for the Board state machine (shown in Figure 5) using state pattern. Figure. 7. Mobile Application Generator (MAG) architecture.

Figure. 6. BoardSM class hierarchy generated code.

First of all we generate a base state class; for example for Board class we generate a BoardState class. There is one to one navigable relationship between Board and BoardState class, so both contains class property of each other. BoardState class contains all the methods in the Board class but they are empty and have no implementation. Each state in a state machine is transformed to a class inherited from the base state class. Initialized, NewWordCreated, Validating, and Paused classes are generated and inherited from BoardState class as shown in Figure 6. The events on the states are included as the methods in the specific classes. These methods are implemented in derived classes with their corresponding actions. The guard maps to if-else blocks in their respective method. All ALF actions are transformed according to the mobile platform specific language. V. we

MOBILE APPLICATION GENERATOR

To automate the mobile application generation process, have implemented MAG (Mobile Application

A. Model Reader The model reader is the first component in the MAG tool. The input to this component is UML models (.uml file extension) which consists of a class, state machine and UML profile diagrams. This component is further divided into three internal sub-components: (i) class diagram reader, (ii) state machine reader, and (iii) profile reader. We use the standard UML metamodel [22] to load the input models. Class diagram reader uses UML class diagram metamodel to load the instance of a class diagram. State machine reader uses UML state machine metamodel to load the instances of state machine. As our approach uses mobile UML profile for modeling, therefore the profile reader uses UML profile metamodel to load the instance of the profile. The output of this process is the UML metamodel instances of the input diagrams. B. Mappings Resolver The mappings resolver is the second component in the MAG tool. There are two inputs to this component: (i) UML metamodel instances of the class, state machine and profile diagrams, and (ii) desired mobile platforms. The second input provides information about the platforms for which the mobile applications should be generated. This component is further divided into two sub-components: (i) cross-models references resolver, and (ii) mobile platform mappings resolver. The cross-models references resolver takes the UML metamodel instances as an input. It links the classes with their specific state machines. It also links the stereotypes in the UML profile with their applied classes.

The mobile platform mappings resolveer resolves the mappings of different stereotypes to their relevant mobile platform specific classes as presented in Tabble II. C. Application Generator The application generator is the finaal component in MAG. It takes the linked UML metamodeel instances as an input which contains the complete informaation required to generate mobile applications for multiple platforms. This component further divided into four sub-components: (i) structural code generator, (ii) behavioral codde generator, (iii) code merger, and (iv) application configuratoor.

d the mobile approach. In this section, we demonstrate application generation for multiplee platforms by using our proposed approach and also comp parison with the original scramble application. We analyze a the original implementation of scramble for An ndroid. It consists of over 12,000 lines of code. This included d code for both the GUI and the business logic, which was taangled together.

Figure. 9. Board class Windows Phone P generated code.

Figure. 8. Board class Android generateed code.

Structural code generator generates thee structural code for all the classes as discussed in the Sectiion IV. For each mobile application platform, it performss the same step because every platform has different prograamming language and API. Behavioral code generator generaates the dynamic code for all the state machines as discusseed in Section IV. Dynamic code includes the structural coode as per state pattern implementation as well as the class methods’ implementation. Code merger links the methods’ implementation in their corresponding cclasses, such as, Figure 8 shows the implementation of createeWord method. It outputs the complete code file accordingg to the mobile application platforms. As we are considering Android and mponent generates Windows Phone platforms, so this sub-com two code files. One is for Android platform in Java programming language as Board class shoown in Figure 8. Second is for Windows Phone platform in C# programming language as Board class shown in Figuree 9. Application configurator includes necessary configuurations in the generated file structure according to the mobbile platform. VI.

EVALUATION

We applied our approach on the indusstrial case study described in Section II to demonstrate the appplicability of our

We evaluated the model-driven n approach according to two aspects. First, we evaluate whether our approach is able to generate semantically equivalen nt code for the existing application. Second, we generate the code for Windows Phone platform from the same models to evaluate the support of multiple platform applicaation generation. For the first part of the evaluatio on, we needed to separate the business logic of the original sccramble application from the GUI. The GUI code was partiially rewritten to invoke various methods of a controller claass (BLController) that is generated by MAG tool. Next, we generated the application g code included a code for Android from MAG. The generated controller class and various business b logic classes corresponding to the models sh hown earlier. The total generated lines of code by our tool are a approximately 2500. After integration, we executed the application and ran several test cases on it. Test cases are a based on the business scenarios that were used to build th he application by NextIn. The results of the test cases were equivalent to the actual application. This shows that the proposed model-driven d for mobile application approach can successfully be used generation. For the second part of the evaluation, we generated the code for Windows Phone by selecting appropriate options in the MAG tool. The GUI for Window ws Phone application was developed using Microsoft Visual Studio. The GUI code oller class (BLController) called the various methods of contro to achieve the required functionality. This allowed the integration of the generated code wiith the GUI. We executed similar test cases on the application and found that the results are equivalent to the Android appllication. This shows that

our proposed approach supports generation of mobile applications across multiple platforms. VII. GENERATED APPLICATION VS. CURRENT DEVELOPMENT Our proposed approach generates native mobile applications for the different mobile platforms. Native application is better in terms of performance as compared to other mobile application types (i.e., web and hybrid). Native application is developed using a platform specific API compiled to run on the platform rather than an interpreted language code, such as, Javascript [23]. The compiled code directly interacts with the operating system and mobile device hardware allowing quick and efficient utilization of the mobile device resources, such as, Bluetooth and Wifi. Currently the mobile application industry is highly focused on producing mobile web applications because a single web application can run on multiple mobile platforms. The major limitation of mobile web applications is that they cannot utilize the mobile platform specific libraries which results in low performance and inefficient utilization of mobile device resources [4]. In case of support for bluetooth or camera, web applications rely on third-party components which are provide low performance as compared to platform specific library. Our proposed approach facilitates the generation of native mobile applications for multiple platforms, hence achieving the main goal of the mobile industry, i.e., reducing the effort of development and maintenance of an application for multiple platforms. It not only improves the mobile device resource utilization efficiency but also provides the facility to generate mobile applications for multiple platforms from the same business logic model. As we generate executable business logic code with the controller class as a code interface, the developers has the flexibility to develop user interfaces specific to a platform [23]. Our model-driven approach facilitates to develop different kinds of mobile application using the proposed mobile UML profile. We focus on the business logic layer, so mobile platform specific constraints do not affect the modeling. VIII. RELATED WORK Kraemer use activity and state machine diagrams to develop Android application using Arctis SDK [24]. UML Android profile is used for this purpose. UML class and sequence diagrams are used by Parada and Brisolara to design and develop Android application [25]. Android platform specific concepts (such as, activity, service, and etc) are integrated through inheritance. Cimino and Marcelloni propose an MDA based approach using UIML language to design UI for mobile application [26]. MODIF framework is used to transform UIML models to mobile platform specific code. Botturi et al. propose an approach to develop user interface for mobile applications using UML profile [27]. Wang focus on using patterns for mobile application designing [28]. Ko et al. propose a UML metamodel based approach to develop Android applications [29]. MVC is used

to implement the communication between interface and hardware. Min et al. present a UML metamodel based approach to develop Windows Phone 7 applications [30]. UML profile is used to include the Windows Phone specific concepts. Kim et al. define a MDD approach to transform UML diagrams to code for mobile application [31]. ATL is used for model-to-model while Acceleo is used for model-to-code transformation. Sabraoui et al. generate GUI code for Android application using UML object diagram at metamodel level [32]. XMI is used to render the generated GUI on Android device. Son et al. propose a way to generate method body for six different kinds of interactions in UML sequence diagram [33]. The transformation rules are defined using Acceleo. As mobile application development industry is growing rapidly, so there are numerous tools available to develop mobile application for different platforms, such as, PhoneGap [34], Titanium [35], Adobe AIR [36], Sencha Touch [37], and etc. Nearly all these tools use webinteractive languages (i.e., Javascript [38], HTML5 [39], and etc) which results in a development of mobile web application. Although some of them allows support for the mobile platform native libraries in the application but the resultant application cannot meet the performance and efficiency of native application because native application is much better in look and feel than hybrid application. There are some user interface interactive libraries available for developing mobile games or application (such as, CoCos2D [40], USIXML [41], and etc) but again the resultant application cannot meet the expectations of a native application. To compare our proposed model-driven approach with the existing literature, we allow platform independent modeling hence facilitating application generation for multiple platforms. To accommodate mobile domain specific concepts, we define mobile UML profile rather platform specific profile. In comparison with available tools, we provide generation of native mobile applications using platform specific API rather than web interactive languages. IX.

CONCLUSION

In this paper, we have proposed a model-driven approach for automated generation of mobile applications for multiple platforms. We use a carefully identified subset of UML that fits our purpose of mobile application modeling. Real usecases are used for requirements modeling using application screens and UML use-case diagram. UML class diagram is used for structural modeling. UML state machine diagrams are used for behavioral modeling. This is supported by executable models using action language ALF. We also proposed mobile UML profile to include mobile domain specific concepts in mobile application modeling. We focus on the modeling of business logic layer for the mobile application and provide a controller in the generated code to bridge the user interface with it. For the generation of mobile application for multiple platforms automatically, we have developed a prototype tool called MAG. The modeling approach is applied on an industrial application ‘Scramble’

to demonstrate its applicability. The code for the case study is generated for two mobile platforms (i.e., Android and Windows Phone) using the same set of UML models. We also provide an evaluation of our generated code and integrated it with the existing application. This shows the viability of our approach. ACKNOWLEDGMENT We are thankful to our industrial partner, NextIn. The work presented here was supported by ICT R & D Fund, Pakistan (ICTRDF/MBTToolset/2013). Muhammad Zohaib Iqbal was partly supported by National Research Fund, Luxembourg (FNR/P10/03). REFERENCES [1] [2] [3]

[4] [5] [6] [7] [8] [9] [10]

[11]

[12] [13] [14]

[15] [16] [17]

J. Dehlinger and J. Dixon, "Mobile Application Software Engineering: Challenges and Research Directions," Proc. Workshop on Mobile Software Engineering, October, 2011. Global Mobile Statistics 2013 (2013, 13th - Dec). Available: http://mobithinking.com/mobile-marketing-tools/latest-mobile-stats M. E. Joorabchi, A. Mesbah, and P. Kruchten, "Real Challenges in Mobile App Development," Proc. 7th International Symposium on Empirical Software Engineering and Measurement (ESEM), Baltimore, Maryland, USA, October 2013. T. Wasserman, "Software Engineering Issues for Mobile Application Development," FoSER 2010, 2010. B. Selic, "The Pragmatics of Model-driven Development," Software, IEEE, vol. 20, pp. 19-25, 2003. Unified Modeling language (UML), v2.4.1 (2013, 30th - Nov). Available: http://www.omg.org/spec/UML/2.4.1/ H. Gomaa, "Model-based Software Design of Real-time Embedded Systems," International Journal of Software Engineering, vol. 1, pp. 19-41, 2008. C. Larman, Applying UML and Patterns: An Introduction to ObjectOriented Analysis and Design and Iterative Development, 3rd Edition, 3rd ed.: Prentice Hall, 2004. M. Z. Iqbal, A. Arcuri, and L. Briand, "Environment Modeling and Simulation for Automated Testing of Soft Real-time Embedded Software," Software & Systems Modeling, pp. 1-42, 2013. F. T. Balagtas-Fernandez and H. Hussmann, "Model-driven Development of Mobile Applications," Proc. Automated Software Engineering, 2008. ASE 2008. 23rd IEEE/ACM International Conference on, 2008, pp. 509-512. D. Kramer, T. Clark, and S. Oussena, "MobDSL: A Domain Specific Language for Multiple Mobile Platform Deployment," Proc. Networked Embedded Systems for Enterprise Applications (NESEA), 2010 IEEE International Conference on, 2010, pp. 1-7. A. Ribeiro and A. Silva, "XIS-Mobile: A DSL for Mobile Applications," Proc. of SAC 2014 Conference, ACM, 2014. Modeling and Analysis of Real-Time and Embedded Systems (MARTE) v1.1 (2013, 30th Nov). Available: http://www.omg.org/spec/MARTE/1.1/PDF/ M. Z. Iqbal, A. Arcuri, and L. Briand, "Empirical Investigation of Search Algorithms for Environment Model-based Testing of Realtime Embedded Software," Proc. of the 2012 International Symposium on Software Testing and Analysis, 2012, pp. 199-209. Action Language for Fundamental UML (ALF) v1.0.1 (2013, 22th Dec). Available: http://www.omg.org/spec/ALF/1.0.1/PDF/ E. Gamma, R. Helm, R. Johnson, and J. Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software: Pearson Education, 1994. Google Play Reaches 1 Million (2014, 23 - April). Available: http://www.phonearena.com/news/Androids-Google-Play-beats-AppStore-with-over-1-million-apps-now-officially-largest_id45680

[18] NextIn (2014, 23 - April). Available: http://www.nextin.co [19] Scramble (2014, 23 April). Available: http://www.amazon.com/Scramble-Kindle-Tablet-HDHDx/dp/B00GHKO98Q/ref=sr_1_3?s=mobileapps&ie=UTF8&qid=1397135064&sr=1-3 [20] B. Selic, "A Systematic Approach to Domain-specific Language Design using UML," Proc. Object and Component-Oriented RealTime Distributed Computing, 2007. ISORC'07. 10th IEEE International Symposium on, 2007, pp. 2-9. [21] M. Usman and A. Nadeem, "Automatic Generation of Java Code from UML Diagrams using UJECTOR," International Journal of Software Engineering and Its Applications, vol. 3, pp. 21-37, 2009. [22] UML Superstructure v2.4.1 (2014, Aug). Available: http://www.omg.org/spec/UML/2.4.1/Superstructure/PDF/ [23] A. Charland and B. Leroux, "Mobile Application Development: Web vs. Native," Commun. ACM, vol. 54, pp. 49-53, 2011. [24] F. Kraemer, "Engineering Android Applications based on UML Activities," in Model Driven Engineering Languages and Systems. vol. 6981, J. Whittle, T. Clark, and T. Kühne, Eds., ed: Springer Berlin Heidelberg, 2011, pp. 183-197. [25] A. G. Parada and L. B. d. Brisolara, "A Model Driven Approach for Android Applications Development," Proc. Computing System Engineering (SBESC), 2012 Brazilian Symposium on, 2012, pp. 192197. [26] M. G. Cimino and F. Marcelloni, "An Efficient Model-based Methodology for Developing Device-independent Mobile Applications," Journal of Systems Architecture, vol. 58, pp. 286-304, 2012. [27] G. Botturi, E. Ebeid, F. Fummi, and D. Quaglia, "Model-driven Design for the Development of Multi-platform Smartphone Applications," Proc. Specification & Design Languages (FDL), 2013 Forum on, 2013, pp. 1-8. [28] Z. Wang, "The Study of Smart Phone Development based on UML," Proc. Computer Science and Service System (CSSS), 2011 International Conference on, 2011, pp. 2791-2794. [29] M. Ko, Y.-J. Seo, B.-K. Min, S. Kuk, and H. S. Kim, "Extending UML Meta-model for Android Application," Proc. Computer and Information Science (ICIS), 2012 IEEE/ACIS 11th International Conference on, 2012, pp. 669-674. [30] B.-K. Min, M. Ko, Y. Seo, S. Kuk, and H. S. Kim, "A UML Metamodel for Smart Device Application Modeling based on Windows Phone 7 Platform," Proc. TENCON 2011-2011 IEEE Region 10 Conference, 2011, pp. 201-205. [31] W. Y. Kim, H. S. Son, J. S. Kim, and R. Y. C. Kim, "Adapting Model Transformation Approach for Android Smartphone Application," in Advanced Communication and Networking, ed: Springer, 2011, pp. 421-429. [32] A. Sabraoui, M. E. Koutbi, and I. Khriss, "GUI Code Generation for Android Applications using a MDA Approach," Proc. Complex Systems (ICCS), 2012 International Conference on, 2012, pp. 1-6. [33] H. S. Son, W. Y. Kim, and R. Y. C. Kim, "MOF based Code Generation Method for Android Platform," International Journal of Software Engineering and Its Applications, vol. 7, p. 12, 2013. [34] Phone Gap. Available: http://phonegap.com/ [35] Titanium. Available: http://www.appcelerator.com/titanium/ [36] Adobe AIR (2014, 2nd July). Available: http://www.adobe.com/products/air.html [37] Sencha Touch (2014, 2nd July). Available: http://www.sencha.com/products/touch/ [38] JavaScript v6. Available: http://www.w3schools.com/js/ [39] Hyper Text Markup Language (HTML), v5.0. Available: http://www.w3.org/TR/html5/ [40] CoCos2D (2014, 2nd July). Available: https://code.google.com/p/cocos2d-android-1/ [41] USIXML (USer Interface eXtensible Markup Language) (2014, 2nd July). Available: http://www.usixml.org/en/home.html?IDC=221