Operations 13 min read

Code Coverage Statistics Platform: Architecture, Implementation, and Usage in JD Mobile App

This article introduces JD's code coverage statistics platform, detailing its concepts, significance, implementation approaches for Android and iOS—including Jacoco and Xcode configurations—its SDKs, data collection, reporting mechanisms, and how it enhances testing quality and development efficiency.

JD Retail Technology
JD Retail Technology
JD Retail Technology
Code Coverage Statistics Platform: Architecture, Implementation, and Usage in JD Mobile App

JD's code coverage statistics platform, created by the main App's golden‑process R&D team, provides lightweight SDKs, analysis systems, visual management, automated reports, and data analytics to assist regression testing, quantify test data, and improve test quality.

Code Coverage Concept and Significance – Code coverage measures the proportion of source code executed by tests, serving as an indicator for unit‑test effectiveness, regression progress, and overall code quality. It helps guide test case creation, digitize testing processes, and identify blind spots.

Implementation方案

Android – Uses Jacoco, an open‑source Java coverage tool, with two instrumentation modes: on‑the‑fly (javaagent) and offline (instrumented class files). JD primarily adopts the offline mode, embedding probes during compilation and uploading instrumented files to the server for later analysis.

iOS – Evaluates market solutions and builds a custom workflow. Xcode build settings enable coverage file generation:

GCCGENERATETESTCOVERAGEFILES = YES</code><code>GCCINSTRUMENTPROGRAMFLOWARCS = YES

The JDWorkSpace Mac client retrieves instrumented files and creates static libraries. JDCodeCoverRateModule offers a visual UI for collecting operation files, supporting drag‑and‑drop, data compression, upload, and cleanup.

LCOV is used to generate iOS coverage reports, and incremental coverage is derived by collecting full coverage, computing code diffs, and filtering for changed sections.

Coverage Scanning Platform Overview

The platform consists of five components: coverage SDK, analysis engine, assistance system, visual management platform, and automated report push. The SDK provides one‑click integration with minimal intrusion, packaged as Gradle plugins for Android and Xcode settings for iOS.

The analysis engine handles access management, task parsing, workspace creation, branch handling, report generation, data storage, and messaging. Administrators configure modules, repositories, and version information, triggering workspace setup, code cloning, pre‑compilation, and instrumentation.

Task scheduling processes uploaded coverage files, stores them in the cloud, matches them to workspaces, and runs platform‑specific scripts to generate full and incremental reports. Data services store module, version, branch, and coverage information, offering dashboards for test progress, PV, and other metrics, with email and instant‑messaging notifications.

Coverage Assistance System

To help testers improve coverage, the system captures online data, caches, filters, mocks, and executes it. It integrates with JMQ for data collection, configures monitoring interfaces, and provides mock data insertion to trigger uncovered code paths, thereby raising coverage percentages.

Conclusion

The platform is already deployed in JD's main app modules (order, checkout, cart, etc.), supporting both full and incremental reports, intelligent data capture, and mock integration. Future phases will refine the UI, enhance automation, and further automate coverage improvement.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

code coverageiOSci/cdAndroidtestingquality assurance
JD Retail Technology
Written by

JD Retail Technology

Official platform of JD Retail Technology, delivering insightful R&D news and a deep look into the lives and work of technologists.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.