Record Real API Traffic, Auto-Generate Tests: Keploy Hits 19.8K Stars
Mock maintenance and environment setup stop being the bottleneck when recorded traffic replaces every external dependency; tests run offline in CI with no real database or queue. The work shifts from writing test cases to just running the app, which any team already does daily.
Keploy records real API traffic as the app runs, then turns those recordings into replayable tests and mocks. Capture happens at the kernel level with eBPF, so no SDK, no code changes, and no test cases to write. Every request, response, database query, and message queue event gets logged; on replay, the app talks to recorded snapshots instead of real infrastructure. That means tests run offline, on any machine, without a database, cache, or third-party service.
The tool covers more than HTTP: Postgres, MySQL, MongoDB, Redis queries, Kafka and RabbitMQ messages, gRPC and GraphQL calls all become recorded mocks. Keploy calls this infra virtualization. It handles the two coverage views separately: developers get statement and branch coverage from recorded traffic, testers get API structure and business scenario coverage. When the recordings aren't enough, `test-gen` uses an AI agent to synthesize edge cases from existing captures and OpenAPI docs.
Setup is a one-liner, and the basic flow is `record` then `test`. Volatile fields like timestamps and random IDs need `templatize` and `normalize`; sensitive data must be scrubbed with `sanitize` before committing. The author's bottom line: the tool is worth trying for teams with many services and tangled dependencies, but the underlying idea, traffic is the test case and dependencies can be replaced by recordings, works even without Keploy.
Writing API tests is not the hard part; reproducing the full dependency environment is, and Keploy removes that by recording real interactions and replaying mocks, so effort shifts from composing cases to just running the app.
The capture location, eBPF at the kernel, is what lets Keploy record database queries and queue messages that HTTP-level mocks miss.
The idea that real traffic is itself a test suite, and that dependencies can be substituted with recordings, is portable beyond Keploy; teams can adopt it as a testing philosophy without adopting the tool.