TestMig: migrating GUI test cases from iOS to Android

Nowadays, Apple iOS and Android are two most popular platforms for mobile applications. To attract more users, many software companies and organizations are migrating their applications from one platform to the other, and besides source files, they also need to migrate their GUI tests. The migration of GUI tests is tedious and difficult to be automated, since two platforms have subtle differences and there are often few or even no migrated GUI tests for learning. To address the problem, in this paper, we propose a novel approach, TestMig, that migrates GUI tests from iOS to Android, without any migrated code samples. Specifically, TestMig first executes the GUI tests of the iOS version, and records their GUI event sequences. Guided by the iOS GUI events, TestMig explores the Android version of the application to generate the corresponding Android event sequences. We conducted an evaluation on five well known mobile applications: 2048, SimpleNote, Wire, Wikipedia, and WordPress. The results show that, on average, TestMig correctly converts 80.2% of recorded iOS UI events to Android UI events and have them successfully executed, and our migrated Android test cases achieve similar statement coverage compared with the original iOS test cases (59.7% vs 60.4%).

[1]  Hong Mei,et al.  An Empirical Study on API Usages , 2019, IEEE Transactions on Software Engineering.

[2]  Hongseok Yang,et al.  Automated concolic testing of smartphone apps , 2012, SIGSOFT FSE.

[3]  Sam Malek,et al.  EvoDroid: segmented evolutionary testing of Android apps , 2014, SIGSOFT FSE.

[4]  Wei Wu,et al.  AURA: a hybrid approach to identify framework evolution , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[5]  Alessandra Gorla,et al.  Automated Test Input Generation for Android: Are We There Yet? (E) , 2015, 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE).

[6]  Foyzul Hassan,et al.  HireBuild: An Automatic Approach to History-Driven Repair of Build Scripts , 2018, 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE).

[7]  Michael W. Godfrey,et al.  Using origin analysis to detect merging and splitting of source code entities , 2005, IEEE Transactions on Software Engineering.

[8]  Atanas Rountev,et al.  Static Reference Analysis for GUI Objects in Android Software , 2014, CGO '14.

[9]  Alessandro Orso,et al.  Automated test migration for mobile apps , 2018, ICSE.

[10]  Miryung Kim,et al.  An Empirical Study of API Stability and Adoption in the Android Ecosystem , 2013, 2013 IEEE International Conference on Software Maintenance.

[11]  Xiaoyin Wang,et al.  Experience report: how is dynamic symbolic execution different from manual testing? a study on KLEE , 2015, ISSTA.

[12]  Atif M. Memon,et al.  GUI ripping: reverse engineering of graphical user interfaces for testing , 2003, 10th Working Conference on Reverse Engineering, 2003. WCRE 2003. Proceedings..

[13]  Dawn Xiaodong Song,et al.  Contextual Policy Enforcement in Android Applications with Permission Event Graphs , 2013, NDSS.

[14]  Miryung Kim,et al.  A graph-based approach to API usage adaptation , 2010, OOPSLA.

[15]  Lu Zhang,et al.  A history-based matching approach to identification of framework evolution , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[16]  Jim Clarke Automated test generation from a behavioral model , 1998 .

[17]  Sunghun Kim,et al.  When functions change their names: automatic detection of origin relationships , 2005, 12th Working Conference on Reverse Engineering (WCRE'05).

[18]  Stefan Staiger,et al.  Reverse Engineering of Graphical User Interfaces Using Static Analyses , 2007, 14th Working Conference on Reverse Engineering (WCRE 2007).

[19]  Gabriele Bavota,et al.  API change and fault proneness: a threat to the success of Android apps , 2013, ESEC/FSE 2013.

[20]  Lee J. White,et al.  Generating test cases for GUI responsibilities using complete interaction sequences , 2000, Proceedings 11th International Symposium on Software Reliability Engineering. ISSRE 2000.

[21]  Yi Sun,et al.  Automated generation of test programs from closed specifications of classes and test cases , 2004, Proceedings. 26th International Conference on Software Engineering.

[22]  George C. Necula,et al.  Guided GUI testing of android apps with minimal restart and approximate learning , 2013, OOPSLA.

[23]  Xue Qin,et al.  GUILeak: Tracing Privacy Policy Claims on User Input Data for Android Applications , 2018, 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE).

[24]  Tao Xie,et al.  Exposing Behavioral Differences in Cross-Language API Mapping Relations , 2013, FASE.

[25]  Xiangyu Zhang,et al.  Automatic Text Input Generation for Mobile Testing , 2017, 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE).

[26]  Porfirio Tramontana,et al.  MobiGUITAR: Automated Model-Based Testing of Mobile Apps , 2015, IEEE Software.

[27]  James Bret Michael,et al.  Environment behavior models for scenario generation and testing automation , 2005, A-MOST.

[28]  Iulian Neamtiu,et al.  Targeted and depth-first exploration for systematic testing of android apps , 2013, OOPSLA.

[29]  Qing Wang,et al.  Mining API mapping for language migration , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[30]  Porfirio Tramontana,et al.  Using GUI ripping for automated testing of Android applications , 2012, 2012 Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering.

[31]  Ali Mesbah,et al.  Detecting inconsistencies in multi-platform mobile apps , 2015, 2015 IEEE 26th International Symposium on Software Reliability Engineering (ISSRE).

[32]  Akiko Aizawa,et al.  An information-theoretic perspective of tf-idf measures , 2003, Inf. Process. Manag..

[33]  Leonardo Mariani,et al.  Augusto: Exploiting Popular Functionalities for the Generation of Semantic GUI Tests with Oracles , 2018, 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE).

[34]  Ram Krishnan,et al.  Toward a Framework for Detecting Privacy Policy Violations in Android Application Code , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[35]  Arie van Deursen,et al.  Measuring software library stability through historical version analysis , 2012, 2012 28th IEEE International Conference on Software Maintenance (ICSM).

[36]  Alessandro Orso,et al.  Test migration for efficient large-scale assessment of mobile app coding assignments , 2018, ISSTA.

[37]  Anh Tuan Nguyen,et al.  Statistical learning approach for mining API usage mappings for code migration , 2014, ASE.

[38]  Andres Kull Automatic GUI Model Generation: State of the Art , 2012, 2012 IEEE 23rd International Symposium on Software Reliability Engineering Workshops.

[39]  Xiaoyin Wang,et al.  Experience paper: a study on behavioral backward incompatibilities of Java software libraries , 2017, ISSTA.

[40]  Andreas Zeller,et al.  Poster: Efficient GUI Test Generation by Learning from Tests of Other Apps , 2018, 2018 IEEE/ACM 40th International Conference on Software Engineering: Companion (ICSE-Companion).

[41]  Mehryar Mohri,et al.  Finite-State Transducers in Language and Speech Processing , 1997, CL.