费诺编码的gui页面设计_基于深度学习的自动化Android应用测试方法(二)AndroidUI、自动生成测试、GUI分析...

1e348332d46b4162252539f87433aa32.png

原文:《A Deep Learning based Approach to Automated Android App Testing》

前文:

基于深度学习的自动化Android应用测试方法(一)Humanoid - 飘哥的文章 - 知乎

II.背景及相关工作

A.Android UI

对于移动应用程序,用户界面(UI)是人机之间之间发生交互的地方。应用开发者设计用户界面来帮助用户理解他们应用的特性,并且用户通过UI与应用程序进行交互。图形用户界面(GUI)是大多数移动应用程序最重要的UI类型,其中应用程序在屏幕上显示内容和可操作的小部件,用户使用单击、滑动和文本输入等操作与小部件交互。

移动应用程序中的GUI页面(或屏幕截图)通常使用树形结构布局。例如,在一个Android应用程序的屏幕快照中,所有的UI元素都是使用View和ViewGroup对象构建的,并组织为tree1。视图是在屏幕上绘制用户可以看到并与之交互的内容的叶节点。ViewGroup是包含其他节点的父节点,用于定义界面的布局。UI状态可以标识为当前UI树中的结构和内容的快照,UI树中的节点称为UI元素。

一个应用程序可以被看作是许多图形用户界面状态和它们之间的转换的组合。每个图形用户界面状态提供不同的功能或呈现不同的内容。应用程序用户通过与UI元素交互在UI状态之间导航。

B.自动生成GUI测试

自移动应用普及以来,自动化GUI测试生成已成为一个活跃的研究领域。大部分研究工作针对Android平台,部分原因是Android应用程序的流行,以及Android设备和操作系统发布的碎片化。

在Android中,测试工具与应用程序的交互方式与人类相同:向应用程序的GUI发送模拟手势。由于UI状态中可接受的手势是有限的,不同测试生成器之间的主要区别是它们在为这些操作确定优先级时使用的策略。主要有三种类型的策略:随机的、基于模型的和目标策略。

使用随机策略的典型例子是Monkey,它是Android中用于自动应用程序测试的官方工具。Monkey将随机类型的输入事件发送到屏幕上的随机位置,而不考虑它的GUI结构。DynoDroid也使用了随机策略,而DynoDroid发送的输入比Monkey更智能:根据GUI结构和应用程序中注册的事件侦听器过滤掉许多不可接受的事件。Sapienz利用遗传算法优化随机测试序列。Polariz提取并重用了由人类测试者获得的主题,以帮助生成随机测试序列。

其他一些测试工具构建并使用应用程序的GUI模型来生成测试输入。这些模型通常被描述为存储应用程序窗口状态间转换的有限状态机。这种GUI模型可以动态构建为【《Using gui ripping for automated testing of android applications》】、[《Automated model-based android gui testing using multi-level gui comparison criteria》]、[《Droidbot: a lightweight ui-guided test input generator for android》]、[《Puma: Programmable ui-automation for large-scale dynamic analysis of mobile apps》]、[《Droidmate: A robust and extensible test generator for android》]、[《Guided, stochastic model-based gui testing of android apps》]、[《Guiding app testing with mined interaction models》]、[《Guided gui testing of android apps with minimal restart and approximate learning,》]、[《An empirical study of android test generation tools in industrial cases》]或静态[《Static window transition graphs for android (t)》]。基于GUI模型,测试工具可以生成事件,这些事件可以快速导航应用程序导航到未探索的状态。基于模型的策略可以通过多种方式进行优化。例如,Stoat可以基于现有的探索迭代地细化测试策略,DroidMate可以通过挖掘其他应用程序来推断UI元素可接受的操作。

目标策略的设计是为了解决一些应用程序行为只能通过特定的测试输入来显示的问题。例如,一个恶意的应用程序可能只在接收到某个广播时发送SMS消息。这些测试工具[《Automated concolic testing of smartphone apps,》]、[《Targeted and depth-first exploration for systematic testing of android apps》]、[《Brahmastra: Driving apps to test the security of third-party components,》]通常使用复杂的技术,如数据流分析和符号执行,以找到可能导致目标状态的交互。但是,它们的有效性很容易受到应用程序代码的复杂性和将代码映射到UI元素的难度的影响。

现有测试生成器的一个主要缺点是,他们忽略了UI元素的视觉信息,这是人类用户或测试人员在探索应用程序时的重要参考。在Humanoid中,我们试图通过了解应用程序的GUI如何影响用户与其交互的方式来指导测试生成。

C.软件GUI分析

在包括Android在内的大多数主流平台上,GUI都是软件不可或缺的一部分。分析应用程序的GUI是许多研究人员和实践者非常感兴趣的。这一领域的研究主要有两条主线。一个是从软件工程的角度来理解应用程序的行为。另一种是从人机交互的角度来分析用户界面设计。

如前所述,许多自动化测试工具构建并使用GUI模型来指导测试输入的生成。与主要使用UI状态之间的转换来抽象应用程序行为的模型不同,还有一些方法侧重于分析每个UI状态中的信息。例如,Huang等人的[《Asdroid:Detecting stealthy behaviors in android applications by user interface and program behavior contradiction》]和Rubin等人的[《Covert com- munication in mobile applications》]提出通过将实际行为与UI进行比较来检测Android应用程序中的隐形行为。PERUIM[《Peruim: understanding mobile application privacy with permission-ui mapping》]提取了应用程序权限与其用户界面之间的映射,以帮助用户理解为什么要请求每个权限,Audacious[《Audacious: User-driven access control with unmodified operating systems》]提供了一种基于UI组件来控制权限访问的方法。Chen等人在《From ui design image to gui skeleton: a neural machine translator to bootstrap mobile gui implementation》中提出了一种基于机器学习的方法,从UI图像中提取UI骨架,以方便GUI开发。

在人机交互研究中,软件GUI主要用于大规模挖掘用户界面设计实践和交互行为模式。挖掘的知识可以进一步用于指导UI和UX(用户体验)设计。为了方便移动应用设计挖掘,Deka等人收集并发布了一个名为Rico[《Rico: A mobile app dataset for building data-driven design applications,》]的数据集,其中包含大量的UI界面和人机交互。

我们的工作介于软件工程和人机交互之间:我们提出了一种从Rico数据集中挖掘人机交互模式的深度学习方法,并利用这种学习模式指导自动匹配测试。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Machine Learning projects our ultimate desire to understand the essence of human intelligence onto the space of technology. As such, while it cannot be fully understood in the restricted field of computer science, it is not necessarily the search of clever emulations of human cognition. While digging into the secrets of neuroscience might stimulate refreshing ideas on computational processes behind intelligence, most of nowadays advances in machine learning rely on models mostly rooted in mathematics and on corresponding computer implementation. Notwithstanding brain science will likely continue the path towards the intriguing connections with artificial computational schemes, one might reasonably conjecture that the basis for the emergence of cognition should not necessarily be searched in the astonishing complexity of biological solutions, but mostly in higher level computational laws. Machine learning and information-based laws of cognition. The biological solutions for supporting different forms of cognition are in fact cryptically interwound with the parallel need of supporting other fundamental life functions, like metabolism, growth, body weight regulation, and stress response. However, most human-like intelligent processes might emerge regardless of this complex environment. One might reasonably suspect that those processes be the outcome of information-based laws of cognition, that hold regardless of biology. There is clear evidence of such an invariance in specific cognitive tasks, but the challenge of artificial intelligence is daily enriching the range of those tasks.While no one is surprised anymore to see the computer power in math and logic operations, the layman is not very well aware of the outcome of challenges on games, yet. They are in fact commonly regarded as a distinctive sign of intelligence, and it is striking to realize that games are already mostly dominated by computer programs! Sam Loyd’s 15 puzzle and the Rubik’s cube are nice examples of successes of computer programs in classic puzzles. Chess, and more recently, Go clearly indicate that machines undermines the long last reign of human intelligence. However, many cognitive skills in language, vision, and motor control, that likely rely strongly on learning, are still very hard to achieve.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值