ebook img

Towards the quality improvement of cross-platform mobile applications PDF

0.1 MB·
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Towards the quality improvement of cross-platform mobile applications

Towards the quality improvement of cross-platform mobile applications Matias Martinez, Sylvain Lecomte Univ Lille Nord de France, F-59000 Lille, France, Universite´ de Valenciennes et du Hainaut Cambre´sis, Laboratoire LAMIH - UMR CNRS 8201 59313 Valenciennes Cedex 9 [email protected] 7 1 0 2 Abstract—During last ten years, the number of smartphones A currentchallenge for business enterprises,software com- and mobile applications has been constantly growing. Android, panies, and independent mobile developers is to choose the r iOS and Windows Mobileare three mobile platforms that cover a targetplatformsfortheirmobileapplications.Tocoveralarge M almostallsmartphonesintheworldin2017.Developingamobile number of users, companies and developers aim at releasing app involves first to choose the platforms the app will run, and then to develop specific solutions (i.e., native apps) for each their mobile apps on the three mentioned platforms. More 2 chosen platform usingplatform-related toolkitssuch as Android platforms targeted involves to potentially reach more users SDK. A cross-platform mobile application is an app that runson and, thus, to increase the impact on the market. ] E two or more mobile platforms. Several frameworks have been However, nowadays, creating a cross-platform application proposed to simplify the development of cross-platform mobile S as we mentioned, implies the development of one native applications and to reduce development and maintenance costs. s. Theyarecalledcross-platformmobileappdevelopmentframeworks. application for each platform to target. Thus, companieshave c However,toourknowledge,thelife-cycleandthequalityofcross- to afford the cost of two or more development processes [ platformsmobileapplicationsbuiltusingthoseframeworkshave of their cross-platform apps. It has a monetary impact and not been studied in depth. Our main goal is to first study the 2 also affects the project organization: e.g., a company must processesofdevelopmentandmaintenanceofmobileapplications v find specialized developers for targeting each platform, the built using cross-platform mobile app development frameworks, 7 focusing particularly on the bug-fixingactivity. Then, we aim at developmentdurationforeachplatformcouldbedifferentand 6 definingtools for automated repairing bugsfrom cross-platform it could exist technical limitations and differences between 7 6 mobile applications. platforms, such as permission policies. 0 . B. Cross-platform mobile app development 1 I. INTRODUCTION frameworks 0 A. Context 7 During last years, researches and industry sectors have 1 Studies estimate that currently in 2017, there are 2 billions both focused on proposing solutions for developing mobile : v smartphonesin the world1 andthis numberwill increase 50% applications to overcome the mentioned problematic. One of i the next 5 years. Smartphones are mobile devices that run themainobjectivesofthosesolutionsistoreducethecostand X software applications such as games, social network (Face- time of developing and maintaining mobile applications. r a book,Twitter) and bankingapps. A native mobile application From the academic research community, Perchat et al. isanappbuilttoruninaparticularmobileplatform.Currently, [22, 23] proposed a framework that allows the integration of therearethreeplatformsthatdominatethesmartphonemarket: cross-platformcomponentsin anyapplication(iOS, Android), Android (from Google), iOS (from Apple) and Windows with the goal of soften the difference between each mobile Mobile (fromMicrosoft). A large number of applicationsthat platform. Le Goaer et al. proposed Xmob [11], a technology- run on those platforms are available in application stores. neutral domain-specific language (DSL) intended to be cross- For instance, Google Play, the official app store of Android compiled to produce native code for a variety of platforms. applications, has more than 2 millions apps available to Fromthe industryside,Phonegap(a.k.a.ApacheCordova)2 download. from Adobe is a frameworks to build mobile applications A cross-platform mobile application is an application that using CSS3, HTML5, and JavaScript source code. The code targets more than one mobile platform. A manner of building is embedded on a skeleton native app, which interprets and this kind of apps is, for example, to develop a native appli- executes the app code on the specific device. This kind of cation created for running on Android devices (built using applicationsarecalledHybridmobileapplicationsduetheyare Java technology) and another native application built (using conformedbybothnative(e.g.,JavafortheAndroidskeleton) Objective-C language) for iOS devices. and not-native (e.g., HTML) code. 1https://www.statista.com/statistics/330695/number-of-smartphone-users-worldwid2het/tps://cordova.apache.org Another cross-platform mobile app development 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 iOSandWindowsdevelopmentinC#.Developersre-usetheir web-based application (i.e., HTML5 technologies) wrapped existingC#code,andsharesignificantcodeacrossdeviceplat- 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,wasdevelopedusingXamarinandis around15,000lines 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 contains90%sharedcode.5Sharingcodemeanstoreduceboth quickly by launching and testing new featureswithout having develop and maintenance cost. Frameworks as Xamarin or toreleasenewversionsoftheapps[4].However,overtime,the React-Native6 are know as Cross-compiled approaches: their Facebook engineersrealized that users had more expectations receiveasinputanapplicationwritteninaparticularnot-native intermsofspeedanduserexperience[10]. Forthosereasons, programminglanguageand transformit to a native codefor 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 developmentframeworks, but mobile developers can find oneverycodechangewasslow,andseparatesetsofskillswere many more options according to their needs. needed to build for iOS and Android, having as consequence aslowerproductdevelopmentandanincreaseofdevelopment C. Developing cross-platform mobile apps costs [4]. Cross-platformdevelopmentframeworksarebuiltforsaving 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 developmentprocess by havinga single team building the itations. React Native is a learn-once-run-everywhere app whole solution. Researches have conducted different studies developmenttool, started as a hackathonprojectin 2013.In a about cross-platform development frameworks such as com- nutshell, React-Native allows developersto write components parisonbetweenthem[3,5,6,9,19]orwithwebbasedmobile in JavaScript language,which are convertedto native compo- apps[1].However,toourknowledge,nopreviousstudieshave nents for iOS and Android platforms. Nowadays, Facebook, investigatedtheproblematicandchallengesofmaintaincross- Instagram and Airbnb are examples of cross-platform mobile platform mobile apps built using those frameworks. apps developed using React-Native7. This brief story shows that the development of cross- D. Our research objectives platformmobile 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-TERMRESEARCH OBJECTIVES Xamarin or React-Native. We envision studying how devel- Inthissectionweproposethreeobjectivesforunderstanding 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 theapplicationlife-cycle.Moreover,we aimatdefininganew 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 choosethose two frameworksdueto theyareopen-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 A. Studying development of cross-platform apps and automated repair processes of cross-platforms mobile applications. We consider our research will have a strong First,weplantocomparetheprocessesofdevelopingcross- impact on the industry of software development, specially platformsusingCross-compileddevelopmentframeworkswith for mobile developmentcompanies 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: HISTORYOF FACEBOOK MOBILE plan to study how a framework manages the differences APPLICATION between platforms and how those differences impact on the app development and on the app’s capabilities. Finally, we Inthissection,wepresenta casestudythatsummarizesthe plantostudywhethertheuse ofthose frameworkshelps, asit different strategies adopted by Facebook developers to build isexpected,tohavefastertime-to-market,increasecomponent the Facebook mobile apps. reuse, decrease cost, etc. Those research goals focus on the 3https://www.xamarin.com developmentphase of applications.The nexttwo manlyfocus 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, Forms Labs8 project provides a set of new controls for Xa- The second goal is to study the maintenance of cross- marin. Secondly, we found ‘toy’ projects done for testing the platform applications. The main research question we plan to developis:“Areappsgeneratedusingthoseframeworkseasier development platforms9 and other projects with examples10. Those projects have usually few lines of code and do not tomaintainthatthosegeneratedusingtraditionaldevelopment representrealmobileapps.Asconsequence,forimplementing of native apps?”. In particular, we are interested in studying: the tool for mining cross-platform mobile projects, we need a) whatare the mostfrequentbugsthat appearin those cross- to a) define more precise and complex queries (using, for platformsapps, b) how bugs look like, c) how bugs are fixed. 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. B. Studying bugs and fixes of mobile apps Based on the knowledge from studying development and maintenance phases of cross-platforms apps, we will focus Our goal is to create a taxonomy of frequent bugs from onapproachesthathelpsdeveloperstoovercometheproblems mobile apps developed by our target developers frameworks. emergedfromtheirapps.Weenvisionpresentingtodevelopers 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. forumssuchasStackOverflow.Onceweidentifybugs,weplan tocreateabugbenchmarktobeusedforevaluatingautomated 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 developedusing cross-platformmobile 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 understandandcharacterizethedevelopmentandmaintenance mobileappdevelopmentframeworksusedto builttheapp.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 theassignmentjavaUrl =javaUrl;doesnotaffectthefield. as we have previously done for understanding the bugfixing The fix consisted on adding the this keyword on the left-part activityofJavaapplication[14,16].Hence,themainchallenge of the buggy assignment14. istoidentifyprojectsbuiltusingcross-platformmobileappde- The complexityand constantevolutionof 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- forretrievingprojectsfromtheirmeta-data(e.g.,projectname, 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%2Cdescrfipotrimons,+nlaenwgufaegateu%re3sA,acn%d2b3u&gtfiyxpien=gR).eSpousrpitroirsiiensgly,the external communityalsoparticipateontheevolutionoftheframework: 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 Thestudyofbugswillallowustoidentifythemostfrequent in the README.md file. bugs present on mobile apps for each development platform Inthesecondstep,thetoolwillparseandanalyzethesource 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 exampleXamarin).Theformerstepisimportantforremoving 9Example:https://github.com/TheRealAdamKemp/Xamarin.Forms-Tests false positives. For example, the previous query returns more 10Example: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 is a real native application. Recent years, researchers have proposed approaches for Hybridmobileapps:Malavoltaetal.[12]havefocusedon automaticallyrepairbugssuchas[8,18,24].Test-basedrepair analyzinghybridmobileapps(e.g.,thosethatusesPhoneGap) repairapproaches[8]usetestsuiteascorrectnessoracles,i.e., available on the app store Google Play and their meta-data they are used as proxies of the program specification. In a (i.e., user ranking and reviews). One of their finding is that nutshell, those approaches receive as input a buggy program the average of end users ratings for both hybrid and native p andits test suite ts, whichhas, atleast, onefailing testcase apps are similar (3.75 and 3.35 (out of 5), respectively). (due to the presence of the bug). The approaches produce, Mining repositories: Previous works such as [16, 20] when it is possible, a modified version of p which passes all have studied and classified bug fix from open-source project tests from the suite ts. Each repair approach applies a set of repositories. Our goal is to carry out similar experiments but repair actions, which are source code changes done to create focusing on repositories of mobile apps. a candidate repair. Automated software repair: During last ten years several Our goal is to define a platform for repairing functional bugs from mobile apps built with Xamarin. The platform will approaches have been proposed to repair C bugs such as [8] or Java bugs such as [24]. The buggy programs that conform re-implement state-of-the-art repair techniques. For instance, evaluationbenchmarksaretypicallylibrariesorcommand-line tore-implementtheapproachGenProg[8](whichtheoriginal (console) applications. implementationtargetsC code)we need:1) a toolfor parsing source code of the buggy mobile app; 2) a tool for manipu- VI. THREATSTOVALIDITY 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 projectsforcreatingtheevaluationcorpus.Weareinterestedin code[17].There,weusedthetoolSpoon[21]forparsingand mobileappsa) with an largenumberof commitsto studyand manipulatingsource 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 underlyingplatform.Anotherthreadistheimpossibilitytofind 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, bugreports,commits,wikis,etc.Finally,state-of-the-artrepair 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 validatingcandidatepatches.A threadfacingrepairingmobile 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 allowsprogrammerstowriteandexecutetestsinC#andNUnit automated repair discipline [15]. for validating the functionalityof iOS and AndroidApps. So, ourimplementationwouldneedtoexecutethosetestcasesfor VII. CONCLUSION validating candidate repairs. Thedevelopmentandmaintenanceofcross-platformmobile apps have particular challenges, different from those related V. RELATEDWORK 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,maintenancecostsandthetime-to-marketofthe demicresearchers[11,22,23]proposedsolutionswiththegoal apps. Our research focuses on understand the maintenance of simplify the developmentof cross-platforms applications. process of those apps with the goal of producing tools for There are severalworksthat classify, compareand 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 theEuropeanUnionwiththeEuropeanRegionalDevelopment 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 ACM, 54(5):49–53,2011. 15http://junit.org/junit4/ 16https://github.com/dotnet/roslyn [2] MatteoCimanandOmbrettaGaggi. Anempiricalanaly- 17https://developer.xamarin.com/guides/testcloud/uitest/ sis of energyconsumptionof cross-platformframeworks 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,comparisonand 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, ThomasDurieux, 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 ios. https://www.facebook.com/notes/facebook- defects4jdataset. EmpiricalSoftwareEngineering,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 UbiquitousComputing, 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,andR.Rouvoy. via semantic analysis. In Proceedings of the 2013 When app stores listen to the crowd to fight bugs in InternationalConferenceonSoftwareEngineering,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] ManuelPalmieri,InderjeetSingh,andAntonioCicchetti. [8] Claire Le Goues, ThanhVu Nguyen, Stephanie Forrest, Comparisonofcross-platformmobiledevelopmenttools. and Westley Weimer. Genprog: A generic method for InIntelligenceinNextGenerationNetworks(ICIN),2012 automatic software repair. IEEE Trans. Software Eng., 16thInternationalConferenceon,pages179–186.IEEE, 38(1):54–72,2012. 2012. [9] Henning Heitko¨tter, 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 LionelSeinturier. 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- sourcecode.Software:PracticeandExperience,pagena, native-a-year-in-review/,2016. Online;. 2015. [11] Olivier Le Goaer and Sacha Waltham. Yet another dsl [22] JoachimPerchat,MikaelDesertot,andSylvainLecomte. for cross-platformsmobile 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] JoachimPerchat,MikaelDesertot,andSylvainLecomte. Valerio Terragni. Hybridmobile apps in the googleplay 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. Cle´ment, 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.

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.