# Mockers - Overcoming Testing Challenges at Grab

[Grab](https://yomu.fyi/company/grab) · Mayank Gupta · Sep 18, 2018

**Type:** Problem & solution

## Summary

Grab operates over 250 microservices communicating over HTTP and gRPC, making shared staging environments costly, ambiguous in ownership, and fragile due to inconsistent data and uncoordinated deployments. To address these testing bottlenecks, Grab created Mockers, a Go SDK and CLI tool backed by a central monorepo of mock servers for local-box and CI testing. Mockers automatically generates HTTP and gRPC mock servers from Swagger specifications and protobuf files, returning configured network responses without internal business logic. By incorporating Grab's in-house chaos SDK middleware, Mockers also enables repeatable resiliency and contract testing locally without relying on code-level mocks. While Grab still mandates integration testing on distributed staging environments with live data, Mockers enables developers to detect complex defects and contract mismatches earlier.

## Context

Testing Grab's ecosystem of over 250 microservices on shared staging environments resulted in high debugging costs, ownership ambiguity, fragile test states, and difficulty testing negative or resilient failure modes.

## Approach / What changed

Grab built Mockers, a Go SDK and CLI tool managing a monorepo of mock servers generated directly from Swagger API specs and protobuf definitions to run network-level contract, functional, and chaos tests locally and in CI.

## Takeaways

- Mockers creates network-level mock servers from API Swagger specifications or protobuf files instead of requiring developers to inject code-level interface mocks.
- Integrated chaos SDK middleware in Mockers allows local simulation of latency, CPU spikes, memory leaks, and configurable failure percentages to test retries and fallback paths.
- Despite shifting functional and contract tests to local boxes, teams must still maintain staging integration tests to validate against live microservice dependencies, real data, and streaming infrastructure.

**Tags:** [CI/CD](https://yomu.fyi/topic/ci-cd), [Go](https://yomu.fyi/topic/go), [gRPC](https://yomu.fyi/topic/grpc), [Microservices](https://yomu.fyi/topic/microservices), [Testing](https://yomu.fyi/topic/testing)

[Read original post](https://engineering.grab.com/mockers)
