arXiv:1701.06767v2 [cs.SE] 2 Mar 2017 enn ol o uoae earn usfo cross-plat from bugs a applications. repairing we mobile automated the Then, for activity. study tools bug-fixing first defining the framewo on to development particularly app is focusing mobile goal cross-platform applica main mobile using of Our built maintenance and depth. development of in processes studied framework been those using not of built quality applications the mobile and life-cycle platforms the knowledge, our to However, mrpoe nteworld the in aincetdfrrnigo nri eie bitusing (built devices Android another and on technology) running Java for created cation betv- agae o O devices. iOS for language) a Objective-C develop to example, for building is, of apps manner of A platform. kind mobile this one than more targets plctos a oeta ilosap vial to available apps millions 2 Android of than stores. store application more app download. official in has the available Play, applications, are Google Windows platforms instance, tha and For those applications of Apple) on number large (from run A ). iOS (from Google), Mobile mark (from the Curren dominate platform. Android that mobile platforms particular three a are in there run to (Face- run built app network A that an apps. is social devices banking games, and mobile Twitter) as are book, such Smartphones applications years. software 5 next the .Context A. ea for apps) An native as an (i.e., such run, A toolkits solutions will SDK. platform-related app using specific the platform develop platforms chosen the to mob choose a then to Developing cover 2017. first in that involves world platforms app the mobile in Andro three smartphones growing. all are almost Mobile constantly Windows been and has iOS applications mobile and plctosadt euedvlpetadmitnnecos maintenance and mob called development cross-platform been are reduce They of have to development frameworks and the Several applications simplify platforms. to mobile proposed more or two o ad h ult mrvmn fcross-platform of improvement quality the Towards 1 A tde siaeta urnl n21,teeae2billion 2 are there 2017, in currently that estimate Studies Abstract https://www.statista.com/statistics/330695/number-o rs-ltommbl application mobile cross-platform rs-ltommbl application mobile cross-platform Drn attnyas h ubro smartphones of number the years, ten last —During rs-ltommbl p eeomn frameworks development app mobile cross-platform .I I. NTRODUCTION 1 n hsnme ilices 50% increase will number this and native nvri´ eVlnine td anu Cambr´esis, Hainaut du et Valenciennes Universit´e de aiembl application mobile native plcto ul (using built application nvLleNr eFac,F500Lle France, Lille, F-59000 France, de Nord Lille Univ oieapplications mobile sa p htrn on runs that app an is sa plcto that application an is aoaor AI M NS8201 CNRS UMR - LAMIH Laboratoire f-smartphone-users-worldwide/ [email protected] aisMrie,SlanLecomte Sylvain Martinez, Matias 91 aecensCdx9 Cedex Valenciennes 59313 native have s appli- cross- mat im droid form tions rks, tly, et: id, ch ile ile ts. d s t . n o-aie(.. TL code. skeleto HTML) Android the (e.g., for not-native Java and (e.g., native both by conformed opldt rdc aiecd o ait fplatforms. of variety a for code cross native be produce technology- to mobile to a intended compiled [11], each (DSL) Xmob between language proposed domain-specific difference al. neutral the et Goaer soften Le of platform. of goal Androi integration the (iOS, the application with allows any that in components framework cross-platform a proposed 23] [22, applications. a mobile cost maintaining the and reduce developing to is of of solutions time One those mobile of problematic. objectives developing mentioned main the for the overcome solutions to proposing applications on focused both development frameworks app mobile Cross-platform betwe B. differences policies. and permission limitations as such technical platforms, a th exist different platform, could be must could each it platform company each targeting and for a duration for impact processes e.g., development developers monetary development organization: specialized a project more find has the or It affects two apps. also native of cross-platform one their cost ha of of companies the Thus, development afford target. to to the platform each implies for application mentioned, we market. the as user on impact more More the reach platforms. increase potentially to mentioned thus, to three and, involves the releasing targeted on at platforms apps developers mobile and l their companies the a users, cover choose To of applications. to number mobile is their developers for platforms mobile target independent and panies, xctsteapcd nteseicdvc.Ti idof kind This device. specific and the interprets on which called are code app, applications native app code applications skeleton the The mobile a executes code. on build source embedded JavaScript to is and frameworks HTML5, a CSS3, using is Adobe from 2 urn hleg o uiesetrrss otaecom software enterprises, business for challenge current A rmteidsr ie hngp(...Aah Cordova) Apache (a.k.a. Phonegap side, industry the From al. et Perchat community, research academic the From have sectors industry and researches years, last During application cross-platform a creating nowadays, However, https://cordova.apache.org yrdmbl applications mobile Hybrid u hyare they due arge d), nd nd en ve n) e s 2 - - Another cross-platform frame- In 2009, the engineer team of Facebook has built the first works is Xamarin3. It makes it possible to do native Android, mobile application of Facebook using an hybrid approach: a iOS and Windows development in C#. Developers re-use their web-based application (i.e., HTML5 technologies) wrapped existing C# code, and share significant code across device plat- on native platforms code such as iOS and Android. By forms. For example, Evolve4 a conference event management those days, the Facebooks engineers highlighted that this app, was developed using and is around 15,000 lines development approach let them leverage much of the same of code: the iOS version contains 93% shared code i.e., C# code for iOS, Android, and the mobile web. Furthermore, (the remain 7% iOS specific code) and the Android version the approach also allowed them to iterate on experiences contains 90% shared code.5 Sharing code means to reduce both quickly by launching and testing new features without having develop and maintenance cost. Frameworks as Xamarin or to release new versions of the apps [4]. However, over time, the React-Native6 are know as Cross-compiled approaches: their Facebook engineers realized that users had more expectations receive as input an application written in a particular not-native in terms of speed and user experience [10]. For those reasons, programming language and transform it to a native code for a they decided to re-write from scratch the native Facebook particular mobile platform. app for iOS, and later the native app for Android platform. In this section we have listed some cross-platform mobile Unfortunately, the engineers rapidly realized that recompiling app development frameworks, but mobile developers can find on every code change was slow, and separate sets of skills were many more options according to their needs. needed to build for iOS and Android, having as consequence a slower product development and an increase of development C. Developing cross-platform mobile apps costs [4]. Cross-platform development frameworks are built for saving In 2015, the adoption of Reach Native framework brings development effort and money, and for making more agile the engineer team the possibility to overcome those lim- the development process by having a single team building the itations. React Native is a learn-once-run-everywhere app whole solution. Researches have conducted different studies development tool, started as a hackathon project in 2013. In a about cross-platform development frameworks such as com- nutshell, React-Native allows developers to write components parison between them [3, 5, 6, 9, 19] or with web based mobile in JavaScript language, which are converted to native compo- apps [1]. However, to our knowledge, no previous studies have nents for iOS and Android platforms. Nowadays, Facebook, investigated the problematic and challenges of maintain cross- Instagram and Airbnb are examples of cross-platform mobile 7 platform mobile apps built using those frameworks. apps developed using React-Native . This brief story shows that the development of cross- D. Our research objectives platform mobile apps is a challenge, even for one of the most valuable companies in the world. Our main goal is to study the quality of cross-platform mobile apps built using cross-compiled frameworks such as III. LONG-TERM RESEARCH OBJECTIVES Xamarin or React-Native. We envision studying how devel- In this section we propose three objectives for understanding opers build and maintain cross-platform mobile applications and improving quality of mobile applications. We focus on built using those frameworks, and how bugs are fixed during studying application developed using cross-platform mobile the application life-cycle. Moreover, we aim at defining a new development frameworks, particular on Xamarin and React- generation of automated repair approaches for repairing bugs Native, maintained by Microsoft and Facebook, respectively. on cross-platform applications. We choose those two frameworks due to they are open-source To our knowledge, this research would be the first at and well-documented (manuals, forums and white-papers). studying and understanding the development, maintenance and automated repair processes of cross-platforms mobile A. Studying development of cross-platform apps applications. We consider our research will have a strong First, we plan to compare the processes of developing cross- impact on the industry of , specially platforms using Cross-compiled development frameworks with for mobile development companies which base their business respect to the development of native apps using tools for model on the development of cross-platform apps. that propose (Xcode, Android Studio). For instance, we plan to study the learning curve of those frameworks. Then, we II. CASE STUDY: HISTORY OF FACEBOOKMOBILE plan to study how a framework manages the differences APPLICATION between platforms and how those differences impact on the In this section, we present a case study that summarizes the app development and on the app’s capabilities. Finally, we different strategies adopted by Facebook developers to build plan to study whether the use of those frameworks helps, as it the Facebook mobile apps. is expected, to have faster time-to-market, increase component reuse, decrease cost, etc. Those research goals focus on the 3https://www.xamarin.com development phase of applications. The next two manly focus 4https://github.com/xamarinhq/app-evolve on the maintenance phase. 5https://goo.gl/eqj1ml 6https://facebook.github.io/react-native 7https://facebook.github.io/react-native/showcase.html B. Studying the maintenance of cross-platform applications sub-components of the development platforms, for example, 8 The second goal is to study the maintenance of cross- Forms Labs project provides a set of new controls for Xa- platform applications. The main research question we plan to marin. Secondly, we found ‘toy’ projects done for testing the 9 10 develop is: “Are apps generated using those frameworks easier development platforms and other projects with examples . to maintain that those generated using traditional development Those projects have usually few lines of code and do not of native apps?”. In particular, we are interested in studying: represent real mobile apps. As consequence, for implementing a) what are the most frequent bugs that appear in those cross- the tool for mining cross-platform mobile projects, we need platforms apps, b) how bugs look like, c) how bugs are fixed. to a) define more precise and complex queries (using, for instance, the Github API11); b) define heuristics for filtering C. Repairing bugs on cross-platform apps not desired projects (plug-ins, examples, etc.). Third, we are interested in automated repair those bugs. Based on the knowledge from studying development and B. Studying bugs and fixes of mobile apps maintenance phases of cross-platforms apps, we will focus Our goal is to create a taxonomy of frequent bugs from on approaches that helps developers to overcome the problems mobile apps developed by our target developers frameworks. emerged from their apps. We envision presenting to developers For doing that, we plan to mining bug fixes and related suggestions and candidate patches to fix bugs at the level of information from: a) issues from report systems such as source code. In case of Xamarin, which most parts of the Bugzilla, Github issues, etc; b) bug fix commits from our code are developed in C#, we aim at defining an approach mobile apps corpus; c) questions and responses posed on that generates C# code repairs. forums such as StackOverflow. Once we identify bugs, we plan to create a bug benchmark to be used for evaluating automated IV. PROPOSED EXPERIMENTS program repair approaches. In this section we discuss how we plan to carried our the Our intuition is there are two kinds of bugs on mobile experiments for targeting each research goal mentioned in apps developed using cross-platform mobile app development Section III. frameworks. First, a mobile app could fail due to a bug in A. Creating a mobile apps corpus its code. For example, derefrencing a null pointer, an infinite loop, or a wrong method call12. Secondly, a mobile app We plan to study open-source apps mobile application to could fail due to a bug presents inside the cross-platform understand and characterize the development and maintenance mobile app development frameworksused to built the app. For of cross-platform mobile applications. We plan to create a example, the bug 45311 on Xamarin Android project13 is a corpus of mobile apps developed using the frameworks we common bug in Java: given a class field name javaUrl, and target (i.e., Xamarin and React-Native). For that, we plan to a formal argument from a method also called javaUrl, then explore and mine code repositories platforms such as Github the assignment javaUrl = javaUrl; does not affect the field. as we have previously done for understanding the bugfixing The fix consisted on adding the this keyword on the left-part activity of Java application [14, 16]. Hence, the main challenge of the buggy assignment14. is to identify projects built using cross-platform mobile app de- The complexity and constant evolution of mobile platforms velopment frameworks from other kind of projects, including such as Android or iOS, and the large diversity of mobile native mobile apps. devices in the wild involve that cross-platform mobile app For mining projects, we plan to build a tool for retrieving development frameworks must evolve at the same speed, candidates mobile applications. This tools will carry out two involving the potential creation of new bugs. In the case of steps: in the first one it queries the hub sites such as Github React-Native, which is open-source, Facebook has a develop- for retrieving projects from their meta-data (e.g., project name, ment team with around 20 developers [10] for evolving the description, language). For example, using the query: framework (which includes the addition of new mobile plat- https://github.com/search?q=xamarin+in%3Areadme%2Cdescription+language%3Ac%23&type=Repositoriesforms, new features, and bugfixing). Surprisingly, the external community also participate on the evolution of the framework: we retrieve from Github candidate Xamarin projects that: in February 2016, more than 50% of the commits came from a) are written in C# (language used to build Xamarin apps); external contributors (not employers of Facebook). b) contains the word ‘Xamarin’ in the project descriptions or The study of bugs will allow us to identify the most frequent in the README.md file. bugs present on mobile apps for each development platform In the second step, the tool will parse and analyze the source and to define a taxonomy of defect class. code of each retrieved project to confirm if it is a mobile app built using the development platform we target (in our 8https://github.com/XLabs/Xamarin-Forms-Labs example Xamarin). The former step is important for removing 9Example: https://github.com/TheRealAdamKemp/Xamarin.Forms-Tests 10 false positives. For example, the previous query returns more Example: https://github.com/conceptdev/xamarin-samples 11https://developer.github.com/v3/ than 8800 projects. After manually analyzing the results we 12Example: https://goo.gl/1WDnC7 concluded that there are two kind of projects we are not 13https://bugzilla.xamarin.com/show bug.cgi?id=45311 interested in analyzing. First, some projects are plug-ins and 14https://goo.gl/p0F9cq C. Automated repair bugs of mobile apps increase in energy consumption, even if the final application Recent years, researchers have proposed approaches for is a real native application. automatically repair bugs such as [8, 18, 24]. Test-based repair Hybrid mobile apps: Malavolta et al. [12] have focused on repair approaches [8] use test suite as correctness oracles, i.e., analyzing hybrid mobile apps (e.g., those that uses PhoneGap) they are used as proxies of the program specification. In a available on the app store Google Play and their meta-data nutshell, those approaches receive as input a buggy program (i.e., user ranking and reviews). One of their finding is that p and its test suite ts, which has, at least, one failing test case the average of end users ratings for both hybrid and native (due to the presence of the bug). The approaches produce, apps are similar (3.75 and 3.35 (out of 5), respectively). when it is possible, a modified version of p which passes all Mining repositories: Previous works such as [16, 20] tests from the suite ts. Each repair approach applies a set of have studied and classified bug fix from open-source project repair actions, which are source code changes done to create repositories. Our goal is to carry out similar experiments but a candidate repair. focusing on repositories of mobile apps. Our goal is to define a platform for repairing functional Automated software repair: During last ten years several bugs from mobile apps built with Xamarin. The platform will approaches have been proposed to repair C bugs such as [8] re-implement state-of-the-art repair techniques. For instance, or Java bugs such as [24]. The buggy programs that conform to re-implement the approach GenProg [8] (which the original evaluation benchmarks are typically libraries or command-line implementation targets C code) we need: 1) a tool for parsing (console) applications. source code of the buggy mobile app; 2) a tool for manipu- VI. THREATS TO VALIDITY lating and transforming the parsed code for synthesizing the candidate repair; 3) a correctness oracle (e.g., test suites) In this section we list possible threats to our research. One which decides if a candidate repair is correct or incorrect. thread is to not find ‘meaningful’ open-source mobile app We have already implemented GenProg for repairing Java projects for creating the evaluation corpus. We are interested in code [17]. There, we used the tool Spoon [21] for parsing and mobile apps a) with an large number of commits to study and manipulating source code, and JUnit framework15 for running characterize how developers build and maintain applications. the test suite from the program to repair. To implement a b) that use diverse components and functionalities from the version of GenProg for repairing buggy mobile apps built underlying platform. Another thread is the impossibility to find with Xamarin, we could use, for instance, Roslyn16, an open- meaningful and frequent bugs from issue tracking systems, source C# compilers with rich code analysis APIs. Then, bug reports, commits, wikis, etc. Finally, state-of-the-art repair for validating correctness of candidate repairs, as for all approaches need correctness oracles such as test suite for test-based repair approaches, the repair approach needs a validating candidate patches. A thread facing repairing mobile test-suite related to the buggy mobile application. Xamarin apps is to not find open-source project containing (good provides a testing framework called Xamarin.UITest17 that quality) test suite. This issue does actually affect the whole allows to write and execute tests in C# and NUnit automated repair discipline [15]. for validating the functionality of iOS and Android Apps. So, our implementation would need to execute those test cases for VII. CONCLUSION validating candidate repairs. The development and maintenance of cross-platform mobile apps have particular challenges, different from those related V. RELATED WORK to desktop or web apps. Cross-platform mobile app devel- Cross-platform mobile app development opment frameworks have emerged with the goal of simplify frameworks: In addition to open-source development frame- the development of cross-platform mobile apps, reduce the works such as PhoneGap, Xamarin and React-Native, aca- development, maintenance costs and the time-to-market of the demic researchers [11, 22, 23] proposed solutions with the goal apps. Our research focuses on understand the maintenance of simplify the development of cross-platforms applications. process of those apps with the goal of producing tools for There are several works that classify, compare and evaluate improving the quality of mobile applications. cross-platform mobile application development tools [3, 5, 6, Acknowledge: The ELSAT2020 project is co-financed by 9, 19] to build hybrid mobile and native apps. Our goal is the European Union with the European Regional Development to empirically study the life-cycle of mobile apps built using Fund, the French state and the Hauts de France Region some of those tools, such as Xamarin or React-Native. Council. Empirical studies of Cross-platforms mobile apps: Ciman et al. [2] analyzed the energy consumption of mobile REFERENCES development. Their results showed the adoption of cross- [1] Andre Charland and Brian Leroux. Mobile application platform frameworks as development tools always implies an development: web vs. native. Communications of the 15http://junit.org/junit4/ ACM, 54(5):49–53, 2011. 16https://github.com/dotnet/roslyn [2] Matteo Ciman and Ombretta Gaggi. An empirical analy- 17https://developer.xamarin.com/guides/testcloud/uitest/ sis of energy consumption of cross-platform frameworks for mobile development. Pervasive and Mobile Comput- IEEE Transactions on Software Engineering, PP(99):1– ing, pages –, 2016. 1, 2016. [3] Isabelle Dalmasso, Soumya Kanti Datta, Christian Bon- [14] M. Martinez, L. Duchien, and M. Monperrus. Automat- net, and Navid Nikaein. Survey, comparison and evalua- ically extracting instances of code change patterns with tion of cross platform mobile application development ast analysis. In 2013 IEEE International Conference on tools. In 2013 9th International Wireless Communi- Software Maintenance, pages 388–391, Sept 2013. cations and Mobile Computing Conference (IWCMC), [15] Matias Martinez, Thomas Durieux, Romain Sommerard, pages 323–328. IEEE, 2013. Jifeng Xuan, and Martin Monperrus. Automatic repair [4] Jonathan Dann. Under the hood: Rebuilding facebook of real bugs in java: A large-scale experiment on the for . https://www.facebook.com/notes/facebook- defects4j dataset. Empirical Software Engineering, pages engineering/under-the-hood-rebuilding-facebook-for- 1–29, 2016. ios/10151036091753920/, 2016. Online;. [16] Matias Martinez and Martin Monperrus. Mining soft- [5] Heiko Desruelle, John Lyle, Simon Isenberg, and Frank ware repair models for reasoning on the search space Gielen. On the challenges of building a web-based of automated program fixing. Empirical Softw. Engg., ubiquitous application platform. In Proceedings of the 20(1):176–205, February 2015. 2012 ACM Conference on Ubiquitous Computing, pages [17] Matias Martinez and Martin Monperrus. Astor: A pro- 733–736. ACM, 2012. gram repair library for java (demo). In Proceedings of [6] Rita Francese, Michele Risi, Genoveffa Tortora, and the 25th International Symposium on Software Testing Giuseppe Scanniello. Supporting the development of and Analysis, ISSTA 2016, pages 441–444, New York, multi-platform mobile applications. In 2013 15th IEEE NY, USA, 2016. ACM. International Symposium on Web Systems Evolution [18] Hoang Duong Thien Nguyen, Dawei Qi, Abhik Roy- (WSE), pages 87–90. IEEE, 2013. choudhury, and Satish Chandra. Semfix: Program repair [7] M. Gomez, M. Martinez, M. Monperrus, and R. Rouvoy. via semantic analysis. In Proceedings of the 2013 When app stores listen to the crowd to fight bugs in International Conference on Software Engineering, ICSE the wild. In 2015 IEEE/ACM 37th IEEE International ’13, pages 772–781, Piscataway, NJ, USA, 2013. IEEE Conference on Software Engineering, volume 2, pages Press. 567–570, May 2015. [19] Manuel Palmieri, Inderjeet Singh, and Antonio Cicchetti. [8] Claire Le Goues, ThanhVu Nguyen, Stephanie Forrest, Comparison of cross-platform mobile development tools. and Westley Weimer. Genprog: A generic method for In Intelligence in Next Generation Networks (ICIN), 2012 automatic software repair. IEEE Trans. Software Eng., 16th International Conference on, pages 179–186. IEEE, 38(1):54–72, 2012. 2012. [9] Henning Heitk¨otter, Sebastian Hanschke, and Tim A [20] Kai Pan, Sunghun Kim, and E. James Whitehead, Jr. Majchrzak. Evaluating cross-platform development ap- Toward an understanding of bug fix patterns. Empirical proaches for mobile applications. In International Con- Softw. Engg., 14(3):286–315, June 2009. ference on Web Information Systems and Technologies, [21] Renaud Pawlak, Martin Monperrus, Nicolas Petitprez, pages 120–138. Springer, 2012. Carlos Noguera, and Lionel Seinturier. Spoon: A library [10] Martin Konicek. React native: A year in review. for implementing analyses and transformations of java https://code.facebook.com/posts/597378980427792/react- source code. Software: Practice and Experience, page na, native-a-year-in-review/, 2016. Online;. 2015. [11] Olivier Le Goaer and Sacha Waltham. Yet another dsl [22] Joachim Perchat, Mikael Desertot, and Sylvain Lecomte. for cross-platforms mobile development. In Proceedings Component based framework to create mobile cross- of the First Workshop on the globalization of domain platform applications. Procedia Computer Science, specific languages, pages 28–33. ACM, 2013. 19:1004–1011, 2013. [12] Ivano Malavolta, Stefano Ruberto, Tommaso Soru, and [23] Joachim Perchat, Mikael Desertot, and Sylvain Lecomte. Valerio Terragni. Hybrid mobile apps in the google play Common framework: A hybrid approach to integrate store: An exploratory investigation. In Proceedings of cross-platform components in mobile application. Jour- the Second ACM International Conference on Mobile nal of Computer Science, 10(11):2165, 2014. Software Engineering and Systems, MOBILESoft ’15, [24] J. Xuan, M. Martinez, F. DeMarco, M. Cl´ement, S. L. pages 56–59, Piscataway, NJ, USA, 2015. IEEE Press. Marcote, T. Durieux, D. Le Berre, and M. Monperrus. [13] W. Martin, F. Sarro, Y. Jia, Y. Zhang, and M. Harman. Nopol: Automatic repair of conditional statement bugs A survey of app store analysis for software engineering. in java programs. IEEE Transactions on Software Engi- neering, 43(1):34–55, Jan 2017.