Abstract
The test suites of an Android app should take advantage of different types of tests including end-to-end tests, which validate user flows, and unit tests, which provide focused executions for debugging. App developers have two main options when creating unit tests: create unit tests that run on a device (either physical or emulated) or create unit tests that run on a development machine's Java Virtual Machine (JVM). Unit tests that run on a device are not really focused, as they use the full implementation of the Android framework. Moreover, they are fairly slow to execute, requiring the Android system as the runtime. Unit tests that run on the JVM, instead, are more focused and run more efficiently but require developers to suitably handle the coupling between the app under test and the Android framework. To help developers in creating focused unit tests that run on the JVM, we propose a novel technique called ARTISAN based on the idea of test carving. The technique (i) traces the app execution during end-to-end testing on Android devices, (ii) identifies focal methods to test, (iii) carves the necessary preconditions for testing those methods, (iv) creates suitable test doubles for the Android framework, and (v) synthesizes executable unit tests that can run on the JVM. We evaluated ARTISAN using 152 end-to-end tests from five apps and observed that ARTISAN can generate unit tests that cover a significant portion of the code exercised by the end-to-end tests (i.e., 45% of the starting statement coverage on average) and does so in a few minutes.
Original language | English (US) |
---|---|
Title of host publication | Proceedings - 2023 IEEE 16th International Conference on Software Testing, Verification and Validation Workshops, ICSTW 2023 |
Publisher | Institute of Electrical and Electronics Engineers Inc. |
Pages | 107-116 |
Number of pages | 10 |
ISBN (Electronic) | 9798350333350 |
DOIs | |
State | Published - 2023 |
Event | 16th IEEE International Conference on Software Testing, Verification and Validation Workshops, ICSTW 2023 - Dublin, Ireland Duration: Apr 16 2023 → Apr 20 2023 |
Publication series
Name | Proceedings - 2023 IEEE 16th International Conference on Software Testing, Verification and Validation Workshops, ICSTW 2023 |
---|
Conference
Conference | 16th IEEE International Conference on Software Testing, Verification and Validation Workshops, ICSTW 2023 |
---|---|
Country/Territory | Ireland |
City | Dublin |
Period | 4/16/23 → 4/20/23 |
Bibliographical note
Publisher Copyright:© 2023 IEEE.
Keywords
- Android
- GUI tests
- Mobile apps
- Test carving
- Unit tests