Skip to main content
QUICK REVIEW

[论文解读] Target Directed Event Sequence Generation for Android Applications

Jiwei Yan, Tianyong Wu|arXiv (Cornell University)|Jul 12, 2016
Software Testing and Debugging Techniques参考文献 23被引用 5
一句话总结

本文提出 LATTE,一种用于 Android GUI 测试的动态模型,通过捕获视图状态、返回栈行为以及代码级标签,实现针对特定区域的测试生成。通过使用状态相似性减少状态爆炸,并通过标签将事件与代码片段关联,LATTE 生成更短、高覆盖率的测试序列,有效针对特定代码区域,其效率优于随机探索,同时在覆盖率上达到最先进水平。

ABSTRACT

Testing is a commonly used approach to ensure the quality of software, of which model-based testing is a hot topic to test GUI programs such as Android applications (apps). Existing approaches mainly either dynamically construct a model that only contains the GUI information, or build a model in the view of code that may fail to describe the changes of GUI widgets during runtime. Besides, most of these models do not support back stack that is a particular mechanism of Android. Therefore, this paper proposes a model LATTE that is constructed dynamically with consideration of the view information in the widgets as well as the back stack, to describe the transition between GUI widgets. We also propose a label set to link the elements of the LATTE model to program snippets. The user can define a subset of the label set as a target for the testing requirements that need to cover some specific parts of the code. To avoid the state explosion problem during model construction, we introduce a definition "state similarity" to balance the model accuracy and analysis cost. Based on this model, a target directed test generation method is presented to generate event sequences to effectively cover the target. The experiments on several real-world apps indicate that the generated test cases based on LATTE can reach a high coverage, and with the model we can generate the event sequences to cover a given target with short event sequences.

研究动机与目标

  • 为解决现有模型在捕获运行时 GUI 变化以及 Android 特有机制(如返回栈)方面的局限性。
  • 通过标签集将 GUI 转换与特定代码片段关联,以支持定向测试生成。
  • 通过使用状态相似性度量,在保持准确性的前提下减少模型构建过程中的状态爆炸。
  • 为 Android 应用中的特定代码区域实现高效、高覆盖率的测试用例生成。
  • 提供一种动态的、与代码无关的模型构建方法,可直接在 APK 文件上运行,无需源代码。

提出的方法

  • 动态插桩 Android 应用,以收集运行时 GUI 状态、返回栈信息以及事件触发的代码片段。
  • 通过将每个状态表示为视图信息、视图状态和返回栈状态的元组来构建 LATTE 模型。
  • 定义标签集,将特定代码片段映射到 GUI 转换,从而支持目标导向的测试。
  • 应用状态相似性度量,合并语义上相似的状态,以减少模型大小和分析成本。
  • 通过遍历 LATTE 模型生成测试序列,以到达覆盖用户定义目标标签的路径。
  • 使用测试框架执行生成的事件序列,并验证覆盖率。

实验结果

研究问题

  • RQ1如何增强 Android 应用的 GUI 模型,以在运行时捕获动态视图变化和返回栈行为?
  • RQ2如何将 GUI 转换语义地链接到底层代码片段,以支持定向测试?
  • RQ3何种机制可有效减少动态模型构建过程中的状态爆炸,同时保持模型准确性?
  • RQ4基于模型的测试生成方法是否能以显著更短的测试序列实现与随机测试相当的代码覆盖率?
  • RQ5所提出的模型在多大程度上可支持在真实世界 Android 应用中对特定代码区域实现高效、定向的测试生成?

主要发现

  • LATTE 模型成功捕获了动态 GUI 状态和返回栈行为,相较于先前模型,能更准确地表示 Android 应用的执行过程。
  • 使用标签集可精确地针对特定代码区域,使开发人员能够将测试聚焦于关键或新修改的代码。
  • 状态相似性度量有效减少了模型大小和分析成本,而未牺牲覆盖率,从而缓解了状态爆炸问题。
  • 使用 LATTE 生成的测试用例在代码覆盖率上与最先进的工具(如 Monkey 和 Dynodroid)相当,但事件序列显著更短。
  • 该方法在真实世界 Android 应用中展现出实际有效性,表明定向测试生成既可行又高效。

更好的研究,从现在开始

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

无需绑定信用卡

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