How JD.com Scaled Mobile API Testing from Scripts to Continuous Platforms
This article chronicles JD.com's journey of evolving mobile backend API testing—from manual proxy checks to script‑based JMeter suites, then to integrated testing and performance platforms, and finally to a continuous DevOps pipeline that automates verification, monitoring, and delivery of high‑traffic services.
Preface
In the mobile‑Internet era, the proliferation of apps and rapid release cycles demand robust backend APIs to guarantee a seamless user experience. To accelerate product iteration while ensuring reliability, JD.com has progressively transformed its mobile API testing approach through three major phases: scripted, platform‑based, and continuous improvement.
Scripted Evolution
When I first joined JD.com, there was no dedicated team for backend API testing. Front‑end developers captured traffic with proxy tools such as Fiddler and manually inspected responses only when a UI issue surfaced. As business volume grew, the number of services expanded across mobile, web, PC, and SDK clients, making ad‑hoc inspection insufficient.
Why Manual Capture Became Inadequate
Increasing request frequency, performance expectations, and security requirements forced us to shift from reactive checks to proactive, automated testing. The core testing items identified were:
Functional validation of business logic, rules, and parameters.
Performance metrics such as response time, throughput, and concurrency.
Security checks for authentication bypass, encryption, and compliance.
Stability verification under sustained load.
Given the prevalence of HTTP and a small proprietary JSF protocol, we selected Apache JMeter because it supports multiple protocols, complex scripting, and performance testing.
Scripted Business‑Logic Testing
To meet daily testing needs we designed several script categories:
Base script template : standardized login, parameterization, and validation.
Functional scripts : inherit the base template and cover specific business features per version and module.
Regression scripts : compare production and test‑environment data to ensure new releases do not disrupt existing functionality.
Monitoring scripts : continuously probe critical interfaces in production to detect anomalies.
All JMeter scripts are version‑controlled in Git, organized by business module (search, product detail, cart, etc.). New feature scripts are created on feature branches, merged after verification, and later used for regression and monitoring.
Performance‑Testing Script Automation
Early pressure tests used isolated clusters and proxy servers to launch scripts on load generators. The manual workflow—preparing scripts, uploading to each generator, and collecting results—proved labor‑intensive. This experience motivated the move toward a platform that could manage scripts, data, and resources centrally.
Platform‑Based Development
API Testing Platform
After evaluating existing solutions, we built an integrated framework based on TestNG and OkHttp, extending it to handle JD's custom JSF protocol. The web‑based management platform communicates with the local framework via HTTP, collecting test records (requests, payloads, responses) for centralized analysis, grouping, and re‑execution.
The resulting "Big Bee" API Testing Platform provides modules for interface management, test‑case management, data management, and reporting, enabling traceable, repeatable, and automated API verification.
Performance Testing Platform
To address growing load‑testing demand, we designed a unified performance platform with three core components:
Management console : user‑facing UI for creating test plans, managing resources, and viewing results.
Relay service : synchronizes scripts and data to load generators.
Load generators (01…n) : generate traffic, collect logs, and produce evaluation metrics.
Test data is persisted to a database for traceable reporting. The "Elephant" Performance Testing Platform has supported multiple major sales events (618, Double‑11) and daily tuning, achieving peak QPS in the millions.
Traffic‑Replay Platform
To complement active testing, we built the "Sniper" traffic‑replay platform, which captures live production traffic, forwards it to a replay server, and optionally scales it up or down for functional or performance testing. Since launch, it has executed nearly 200 regular pressure tests, providing trend data for service evaluation.
Continuous Improvement
Integrating these platforms into our CI/CD pipeline (Jenkins) creates an end‑to‑end automated delivery chain: code is stored in Git/GitLab, built and scanned, unit‑tested, statically analyzed, then automatically exercised by the API testing platform and performance platform. Successful builds are packaged, optionally gray‑deployed, and monitored in production.
This continuous loop embodies DevOps principles—automation of testing, monitoring, and delivery—while preserving traceability and feedback for ongoing quality improvement.
Conclusion
Mobile API testing at JD.com has progressed from ad‑hoc script checks to fully automated, platform‑driven, and continuously integrated processes. The platformization effort has reduced manual effort, increased test coverage, and laid the foundation for sustained DevOps practices. Future work will deepen platform capabilities and open them to external partners.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
