[Paper Review] Fine-grained Code Coverage Measurement in Automated Black-box Android Testing
This paper presents ACVTool, a novel open-source tool that enables fine-grained code coverage measurement in automated black-box Android testing by instrumenting Dalvik bytecode in smali format. It achieves 96.9% instrumentation success rate, minimal runtime overhead, and demonstrates through large-scale evaluation with Sapienz that instruction-level coverage significantly improves fault detection compared to coarser metrics.
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.
Motivation & Objective
- Address the lack of reliable, fine-grained code coverage tools for black-box Android testing due to the absence of source code in third-party apps.
- Overcome limitations of existing tools, such as low instrumentation success rates (e.g., 36% and 65%) and coarse-grained metrics (e.g., method-level only).
- Provide a self-contained, transparent, and efficient instrumentation solution compatible with any testing or dynamic analysis framework.
- Enable accurate, fine-grained coverage measurement at class, method, and instruction levels for improved testing effectiveness and fitness function guidance.
- Support broader adoption by the Android research and industrial community through open-source availability and compatibility with real-world applications.
Proposed method
- Instrument Android apps by modifying their smali representation—human-readable assembly-like code for Dalvik bytecode—without requiring source code.
- Insert probes at class, method, and instruction levels to track code execution during runtime, enabling fine-grained coverage collection.
- Use a custom instrumentation pipeline that handles low-level Dalvik bytecode peculiarities, such as register-based operations and complex control flow.
- Ensure minimal runtime overhead by optimizing probe insertion and avoiding performance bottlenecks in execution.
- Integrate with existing testing frameworks like Sapienz to report coverage and crash information in structured, analyzable formats.
- Support backward compatibility and robustness by handling edge cases in Dalvik bytecode, including multidex and complex method signatures.
Experimental results
Research questions
- RQ1Can a black-box code coverage tool achieve high instrumentation success rates on real-world Android applications without access to source code?
- RQ2How does instruction-level code coverage compare to coarser-grained metrics (e.g., method-level) in guiding automated testing and fault detection?
- RQ3What is the runtime performance overhead of fine-grained code coverage instrumentation in real Android applications?
- RQ4To what extent can fine-grained coverage improve the effectiveness of evolutionary and fuzzy testing frameworks as a fitness function?
- RQ5How does ACVTool’s instrumentation approach compare in reliability and scalability to existing tools like ELLA, InsDal, and CovDroid?
Key findings
- ACVTool successfully instrumented 96.9% of 1,278 real-world Android applications in the evaluation, significantly outperforming prior tools with success rates of 36% and 65%.
- The tool introduces negligible instrumentation time overhead and acceptable runtime overhead, making it practical for integration into automated testing pipelines.
- In a large-scale experiment with Sapienz, instruction-level code coverage enabled by ACVTool uncovered more faults than coarser-grained metrics, demonstrating the importance of granularity.
- ACVTool’s smali-based instrumentation approach is more reliable and accurate than alternatives relying on bytecode translation (e.g., to Java or Jimple), which fail on many apps.
- The tool’s open-source availability and compatibility with existing frameworks make it a viable replacement for outdated or inaccessible tools like ELLA and BBoxTester.
- The study confirms that fine-grained coverage is essential for effective fitness function design in black-box testing, especially in evolutionary and fuzzing-based testing strategies.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.