As mobile application (app) functionalities grow increasingly complex and their iterations accelerate, ensuring high reliability presents significant challenges. While functionality-oriented GUI testing has attracted growing research attention, existing approaches largely overlook interactions across functionalities, making them ineffective at uncovering deep bugs hidden in inter-functional behaviors. To fill this gap, we first design a Functional Flow Graph (FFG), a behavioral model that explicitly captures an app's functional units and their inter-functional interactions. Based on the FFG, we further introduce an inter-functional-flow-oriented GUI testing approach with the dual goals of precise model construction and deep bug detection. This approach is realized through a long-short-term-view-guided testing process. By combining two complementary test-generation views, it can adaptively refine functional boundaries and systematically explore inter-functional flows under diverse triggering conditions. We implement our approach in a tool called FuncDroid, and evaluate it on two benchmarks: (1) a widely-used open-source benchmark with 50 reproducible crash bugs and (2) a diverse set of 52 popular commercial apps. Experimental results demonstrate that FuncDroid significantly outperforms state-of-the-art baselines in both coverage (+28%) and bug detection number (+107%). Moreover, FuncDroid successfully uncovers 18 previously unknown non-crash functional bugs in commercial apps, confirming its practical effectiveness.
翻译:随着移动应用功能日益复杂且迭代加速,确保高可靠性面临重大挑战。虽然面向功能的GUI测试已引起越来越多的研究关注,但现有方法大多忽视了跨功能间的交互,导致难以发现隐藏在跨功能行为中的深层缺陷。为填补这一空白,我们首先设计了功能流图(FFG),这是一种显式捕获应用功能单元及其跨功能交互的行为模型。基于FFG,我们进一步提出了一种面向跨功能流的GUI测试方法,该方法以实现精确模型构建和深层缺陷检测为双重目标。该测试方法通过长短期视图引导的测试流程实现,通过结合两种互补的测试生成视图,能够自适应地优化功能边界,并在多样化触发条件下系统性地探索跨功能流。我们将该方法实现为名为FuncDroid的工具,并在两个基准测试集上进行评估:(1)包含50个可复现崩溃缺陷的广泛使用的开源基准集;(2)涵盖52款流行商业应用的多样化集合。实验结果表明,FuncDroid在覆盖率(+28%)和缺陷检测数量(+107%)方面均显著优于现有先进基线方法。此外,FuncDroid成功在商业应用中发现了18个先前未知的非崩溃功能缺陷,证实了其实用有效性。