Skip to main content
QUICK REVIEW

[论文解读] Scripted GUI Testing of Android Apps: A Study on Diffusion, Evolution and Fragility

Riccardo Coppola, Maurizio Morisio|arXiv (Cornell University)|Nov 9, 2017
Advanced Malware Detection Techniques参考文献 10被引用 3
一句话总结

本研究使用六种流行的测试框架,调查了开源Android应用中脚本化GUI测试的采用、演进及脆弱性。研究发现,仅有8%的Android项目使用GUI测试工具,且60%的测试代码修改由GUI脆弱性引起,凸显了维护负担重大,可能阻碍自动化GUI测试的广泛采用。

ABSTRACT

Background. Evidence suggests that mobile applications are not thoroughly tested as their desktop counterparts. In particular GUI testing is generally limited. Like web-based applications, mobile apps suffer from GUI test fragility, i.e. GUI test classes failing due to minor modifications in the GUI, without the application functionalities being altered. Aims. The objective of our study is to examine the diffusion of GUI testing on Android, and the amount of changes required to keep test classes up to date, and in particular the changes due to GUI test fragility. We define metrics to characterize the modifications and evolution of test classes and test methods, and proxies to estimate fragility-induced changes. Method. To perform our experiments, we selected six widely used open-source tools for scripted GUI testing of mobile applications previously described in the literature. We have mined the repositories on GitHub that used those tools, and computed our set of metrics. Results. We found that none of the considered GUI testing frameworks achieved a major diffusion among the open-source Android projects available on GitHub. For projects with GUI tests, we found that test suites have to be modified often, specifically 5\%-10\% of developers' modified LOCs belong to tests, and that a relevant portion (60\% on average) of such modifications are induced by fragility. Conclusions. Fragility of GUI test classes constitute a relevant concern, possibly being an obstacle for developers to adopt automated scripted GUI tests. This first evaluation and measure of fragility of Android scripted GUI testing can constitute a benchmark for developers, and the basis for the definition of a taxonomy of fragility causes, and actionable guidelines to mitigate the issue.

研究动机与目标

  • 评估脚本化GUI测试框架在开源Android项目中的扩散情况。
  • 衡量测试套件随时间推移的修改频率与原因。
  • 量化因GUI测试脆弱性导致的测试变更比例。
  • 为开发者提供基准参考,并为减轻自动化GUI测试脆弱性奠定基础。

提出的方法

  • 研究者使用六种流行的GUI测试工具(Espresso、UI Automator、Selendroid、Robotium、Robolectric和Appium)挖掘开源Android项目的GitHub仓库。
  • 在发布级别分析版本历史,追踪标记发布版本中测试类与方法的变更。
  • 通过代理方法估算脆弱性:任何测试方法的修改均被视为GUI脆弱性的指示。
  • 计算指标以表征测试套件的演化,包括测试代码中修改行数的百分比以及由脆弱性导致的变更比例。
  • 使用精确度评估(70%)验证代理方法在将测试变更与GUI修改关联时的可靠性。
  • 对至少有一个标记发布版本的1,000个项目的样本进行统计分析,以确保代表性。

实验结果

研究问题

  • RQ1开源Android项目中脚本化GUI测试框架的采用水平如何?
  • RQ2在Android项目演化过程中,测试套件的修改频率如何?
  • RQ3测试代码修改中有多少比例是由GUI测试脆弱性引起的?
  • RQ4将测试方法修改作为估算GUI脆弱性的代理,其可靠性如何?

主要发现

  • 在至少使用一个标记发布版本的开源Android项目中,仅有8%采用了本研究考察的六种GUI测试框架中的任意一种。
  • 平均每轮发布中,所有代码变更的7.5%发生在测试代码中,且每轮发布有3%的测试代码被修改。
  • 约60%的测试代码修改归因于GUI测试脆弱性,表明存在重大维护负担。
  • 测试方法修改作为代理,在70%的情况下正确识别了脆弱性,支持其用于脆弱性估算。
  • 在使用GUI测试的项目中,测试套件平均占项目总代码量的11%。
  • 平均每轮发布周期中,约五分之一的测试类需因GUI脆弱性而进行修改。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。