Skip to main content
QUICK REVIEW

[论文解读] Fine-grained Code Coverage Measurement in Automated Black-box Android Testing

Aleksandr Pilgun, Olga Gadyatskaya|arXiv (Cornell University)|Dec 27, 2018
Software Testing and Debugging Techniques被引用 5
一句话总结

本文提出 ACVTool,一种新颖的开源工具,通过在 smali 格式的 Dalvik 字节码上进行插桩,实现了自动化黑盒 Android 测试中的细粒度代码覆盖率测量。该工具实现了 96.9% 的插桩成功率,运行时开销极小,并通过与 Sapienz 的大规模评估表明,指令级覆盖率相比粗粒度指标显著提升了故障检测能力。

ABSTRACT

Today, there are millions of third-party Android applications. Some of these applications are buggy or even malicious. To identify such applications, novel frameworks for automated black-box testing and dynamic analysis are being developed by the Android community, including Google. Code coverage is one of the most common metrics for evaluating effectiveness of these frameworks. Furthermore, code coverage is used as a fitness function for guiding evolutionary and fuzzy testing techniques. However, there are no reliable tools for measuring fine-grained code coverage in black-box Android app testing. We present the Android Code coVerage Tool, ACVTool for short, that instruments Android apps and measures the code coverage in the black-box setting at the class, method and instruction granularities. ACVTool has successfully instrumented 96.9% of apps in our experiments. It introduces a negligible instrumentation time overhead, and its runtime overhead is acceptable for automated testing tools. We show in a large-scale experiment with Sapienz, a state-of-art testing tool, that the fine-grained instruction-level code coverage provided by ACVTool helps to uncover a larger amount of faults than coarser-grained code coverage metrics.

研究动机与目标

  • 解决第三方应用缺乏源代码导致的黑盒 Android 测试中可靠、细粒度代码覆盖率工具的缺失问题。
  • 克服现有工具的局限性,例如较低的插桩成功率(如 36% 和 65%)以及粗粒度指标(如仅方法级别)。
  • 提供一个自包含、透明且高效的插桩解决方案,兼容任何测试或动态分析框架。
  • 实现类、方法和指令级别准确的细粒度覆盖率测量,以提升测试效果和适应性函数的指导能力。
  • 通过开源发布和与真实世界应用的兼容性,推动 Android 研究与工业界社区的广泛采用。

提出的方法

  • 通过修改其 smali 表示(Dalvik 字节码的人类可读类汇编代码)来插桩 Android 应用,而无需源代码。
  • 在类、方法和指令级别插入探测器,以在运行时跟踪代码执行,实现细粒度覆盖率收集。
  • 使用自定义的插桩流水线,处理 Dalvik 字节码的底层特性,如基于寄存器的操作和复杂的控制流。
  • 通过优化探测器插入方式,避免执行中的性能瓶颈,从而确保最小的运行时开销。
  • 与 Sapienz 等现有测试框架集成,以结构化、可分析的格式报告覆盖率和崩溃信息。
  • 通过处理 Dalvik 字节码中的边缘情况(如 multidex 和复杂方法签名),确保向后兼容性和鲁棒性。

实验结果

研究问题

  • RQ1在无法访问源代码的情况下,黑盒代码覆盖率工具是否能在真实世界 Android 应用中实现高插桩成功率?
  • RQ2与粗粒度指标(如方法级别)相比,指令级代码覆盖率在指导自动化测试和故障检测方面表现如何?
  • RQ3细粒度代码覆盖率插桩在真实 Android 应用中的运行时性能开销有多大?
  • RQ4细粒度覆盖率在多大程度上能提升进化测试和模糊测试框架作为适应性函数的有效性?
  • RQ5与 ELLA、InsDal 和 CovDroid 等现有工具相比,ACVTool 的插桩方法在可靠性与可扩展性方面表现如何?

主要发现

  • 在评估的 1,278 个真实世界 Android 应用中,ACVTool 实现了 96.9% 的成功插桩率,显著优于先前工具的 36% 和 65% 成功率。
  • 该工具的插桩时间开销可忽略不计,运行时开销可接受,使其可实际集成到自动化测试流水线中。
  • 在与 Sapienz 的大规模实验中,ACVTool 支持的指令级覆盖率比粗粒度指标发现了更多故障,证明了粒度精细的重要性。
  • ACVTool 基于 smali 的插桩方法比依赖字节码转换(如转为 Java 或 Jimple)的替代方案更可靠、更准确,后者在许多应用中会失败。
  • 该工具的开源发布和与现有框架的兼容性,使其成为过时或不可用工具(如 ELLA 和 BBoxTester)的可行替代方案。
  • 本研究证实,细粒度覆盖率对于黑盒测试中有效适应性函数设计至关重要,尤其是在进化测试和基于模糊测试的策略中。

更好的研究,从现在开始

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

无需绑定信用卡

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