Translation from Visual to Layout-based Android Test Cases: a Proof of Concept
Riccardo Coppola, Luca Ardito, Marco Torchiano, Emil Alégroth · 2020
Context: 2ndgeneration (Layout-based) and 3rdgeneration (Visual) GUI testing are two approaches for testing mobile GUIs, both with individual benefits and drawbacks. Previous research has presented approaches to translate 2ndgeneration scripts to 3rdgeneration scripts but not the vice versa. Goal: The objective of this work is to provide Proof of Concept of the effectiveness of automatic translation between existing 3rdgeneration test scripts to 2ndgeneration test scripts. Method: A tool architecture is presented and implemented in a tool capable of translating most 3rdgeneration interactions with the GUI of an Android app into 2ndgeneration instructions and oracles for the Espresso testing tool.Results: We validate our approach on two test suites of our own creation, consisting of 30 test cases each. The measured success rate of the translation is 96.7% (58 working test cases out of 60 applications of the translator). Conclusion: The study provides support for the feasibility of a translation-based approach from 3rdto 2ndgeneration test cases. However, additional work is needed to make the approach applicable in real-world scenarios or larger open-source test suites.