keploy/keploy
KEYPLOY: AUTO-GENERATE TESTS FROM TRAFFIC
Tool for auto-generating API and integration tests from real traffic. Intercepts calls via eBPF at network level without code changes and creates deterministic mocks for databases, queues, and external APIs.
// KEY FEATURES
- Record tests and mocks via eBPF without SDK or code changes
- Infrastructure virtualization: databases, Kafka, RabbitMQ, external APIs
- Unified coverage: statement, branch, API schema, business use-cases
- AI-driven coverage expansion from OpenAPI schema and traffic recordings
// DEEP DIVE: HOW IT WORKS
Keploy intercepts network traffic at kernel level via eBPF, recording HTTP calls, database queries (Postgres, MySQL, MongoDB) and streaming events (Kafka, RabbitMQ). When launched with the `record` flag, the agent saves call sequences as test cases and mocks; with `test` it replays them deterministically without external dependencies. The tool requires no SDK, imports, or application code changes.
Unlike classic mock frameworks that only handle HTTP, Keploy virtualizes the entire infrastructure: databases, message queues, external APIs. It measures coverage across four metrics at once — statement/branch coverage for developers and API schema/business use-case coverage for QA. Built-in AI analysis of existing recordings and OpenAPI specs generates boundary values, wrong types, out-of-order sequences, and timeout scenarios to expand coverage.
Runs on Linux (eBPF required), macOS, and in containers; supports any language and framework thanks to network-level interception. Parsers for some proprietary protocols are closed-source and unavailable in the open version. Recording needs access to the running application; replay only needs the test and mock binary files.
// USE CASES
Best for: Backend developers and QA for fast API test coverage without manual writing
- Record real API calls in production and run tests locally without databases and queues
- Get unified coverage report for code and business use-cases in CI/CD pipeline
- Generate boundary test cases via AI based on OpenAPI schema and recordings
// QUICK START
keploy record -c "CMD_TO_RUN_APP"
keploy record -c "python main.py"
keploy test -c "CMD_TO_RUN_APP" --delay 10Commands are taken from the repository README — check the current version on GitHub before running.
New repositories every 30 minutes
REDDYX AI scans GitHub 24/7 and ships the best AI/ML/Web3 projects to Telegram.
Join on Telegram