Mock + Proxy in Automated Testing for an Advertising SDK

This article examines the challenges of testing a mobile advertising SDK—such as missing server environments, extensive protocol fields, and costly manual test case updates—and proposes a mock‑proxy strategy, a minimal‑case design approach, and full automation to improve coverage and efficiency.

360 Quality & Efficiency
360 Quality & Efficiency
360 Quality & Efficiency
Mock + Proxy in Automated Testing for an Advertising SDK

Project Background The advertising SDK provides a jar package for app developers to integrate a mobile ad platform, offering functions like ad requests, behavior tracking, error logging, and anti‑fraud.

Team Situation The project is split between a Shanghai backend team and a Beijing client team, leading to synchronization issues, unstable API documentation, frequent protocol changes, lack of a server test environment, and difficulty covering numerous protocol fields with traditional test case design.

Key Problems 1. Insufficient server test environment and realistic ad content. 2. Overly complex protocol fields causing test case omissions, especially for error handling. 3. Test case design heavily impacted by requirement changes, making updates costly. 4. Manual testing is inefficient and prone to missing cases.

Analysis & Approach The article focuses on solving problems 4‑7. For the missing server environment, a mock approach is adopted: the backend pre‑configures fixed online ad resources, allowing the client to be tested without real backend interaction. To address protocol complexity, a reliable test case design strategy is created to cover the maximum scenarios with the fewest cases.

Solution Details - Split test cases into normal‑return and exception handling groups. - For normal flows, create a checklist covering environment, network, download, UI checks, etc., reviewed by the team and product owners. - For exception flows, automatically generate test cases based on defined error codes (e.g., 21 error codes) to achieve near‑100% automation from case generation to execution. - Maintain real‑time updates of test cases as requirements evolve.

Q&A Highlights Q: How to test without a server environment? A: Use mock data with pre‑configured online ad resources. Q: How to handle many protocol fields? A: Adopt a minimal‑case coverage strategy. Q: How to reduce cost of test case changes? A: Separate normal and exception cases, use checklists, and automate exception case generation. Q: How to improve manual test efficiency? A: Automate error‑code coverage and aim for full automation of case execution.

Conclusion: The mock‑proxy method combined with a structured, automated test case design significantly improves testing efficiency and coverage for the advertising SDK.

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.

MobileSDKProxyAutomationtestingMock
360 Quality & Efficiency
Written by

360 Quality & Efficiency

360 Quality & Efficiency focuses on seamlessly integrating quality and efficiency in R&D, sharing 360’s internal best practices with industry peers to foster collaboration among Chinese enterprises and drive greater efficiency value.

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.