Test2VA: Reusing GUI Test Cases for Voice Assistant Features Development in Mobile Applications
Garrett Weaver, Xue Qin
TL;DR
Test2VA addresses the challenge of embedding voice assistant capabilities into existing mobile apps by reusing an app's GUI test scripts to automatically generate VA task methods. It introduces a mutation-based Dynamic Mutant Detector to identify mutable GUI events and a Task Method Generator to produce general, parameterized VA methods, backed by a Testing Script Parser that translates test scripts into a uniform representation. In an evaluation across eight real-world Android apps and 48 test cases, Test2VA achieves a mutable-event detection rate of $75.68\%$ and generates $33$ robust VA methods, with most executions passing manual validation. The approach reduces developer workload, enables maintainable VA code derived from GUI tests, and is released for open access, highlighting a path toward scalable VA development for millions of apps.
Abstract
Voice Assistant (VA) in smartphones has become very popular with millions of users nowadays. A key trend is the rise of custom VA embedding, which enables users to perform the customized tasks of their favorite app through voice control. However, with such a great demand, little effort has been made to support app developers in VA development. Moreover, many user-oriented VA control approaches even increase the programming burden on developers. To reduce the workload and improve code efficiency, in this paper, we propose a novel approach, Test2VA, that reuses the test code of an application to support its VA development. Specifically, Test2VA extracts the task completion pattern from the GUI test code and then generates an execution method to perform the same task in general. To identify the pattern, Test2VA uses a mutation-based exploration to detect the mutable GUI event in the test case and later parameterize it in the VA method. We conducted an evaluation on 48 test cases from eight real-world applications. The results show that Test2VA correctly detects 75.68% of the mutable events from 48 original test cases and then generates 33 methods and have them successfully executed and manually examined.
