GitHub - keploy/keploy: Open-source platform for creating safe, isolated production sandboxes for API, integration, and E2E testing.
Service

GitHub - keploy/keploy: Open-source platform for creating safe, isolated production sandboxes for API, integration, and E2E testing.

keploy
2026.03.30
·GitHub·by 배레온/부산/개발자
#AI#API testing#CI/CD#eBPF#testing tools

Key Points

  • 1Keploy is a developer-centric API and integration testing tool that automatically generates tests and data mocks by recording and replaying real user traffic and system interactions.
  • 2Leveraging eBPF to capture traffic at the network layer, it functions without code changes or SDKs, making it language-agnostic and capable of virtualizing complex infrastructure like databases and streaming services.
  • 3This tool provides comprehensive test coverage (including statement, branch, and API schema), uses AI to expand API test cases, integrates with CI/CD, and offers features such as time freezing and a mock registry for deterministic testing.

Keploy is a developer-centric API and integration testing tool that automates the generation of tests and data mocks from live user traffic. Its primary objective is to enable faster and more comprehensive testing by recording real API calls, database queries, and streaming events, then replaying them deterministically as tests.

The core methodology of Keploy is rooted in its use of eBPF (extended Berkeley Packet Filter) technology. By operating at the network layer, Keploy intercepts and captures all inbound and outbound network traffic of an application without requiring any code changes, SDK integrations, or modifications to the application's source code. This eBPF-driven interception renders Keploy entirely code-less and language-agnostic, supporting any programming language, framework, or runtime environment.

During the "record" phase, Keploy captures:

  • HTTP/HTTPS API calls, including request/response bodies, headers, and status codes.
  • Database interactions for systems like Postgres, MySQL, and MongoDB, capturing queries and their results.
  • Streaming and queue events from platforms such as Kafka and RabbitMQ.
  • Calls to external APIs.

This captured network traffic forms the basis for automatically generating comprehensive test cases and their corresponding data mocks. The data mocks serve as recorded responses for all external dependencies, encapsulating the state and behavior observed during the original recording.

In the "replay" or "test" phase, Keploy reinstates its eBPF hooks. When the application under test attempts to interact with its external dependencies (e.g., making a database query or an external API call), Keploy intercepts these calls and serves the pre-recorded mocked responses from the captured data. This mechanism ensures:

  • Complete Infrastructure Virtualization: Tests run without the need for actual external databases, message queues, or third-party services, leading to isolated and faster test execution.
  • Determinism: By replaying exact recorded interactions, Keploy eliminates test flakiness caused by external factors or time variations, further supported by a "time freezing" capability that fixes system time during test execution.

Keploy offers several key capabilities:

  • Complex Flow Recording and Replay: It can capture and reproduce intricate distributed API flows involving multiple services and dependencies.
  • Combined Test Coverage Metrics: It quantifies test coverage across various dimensions, including statement and branch coverage (relevant for developers) and API schema and business use-case coverage (relevant for QA).
  • AI-Powered Test Expansion: Leveraging existing recordings and OpenAPI/Swagger schemas, Keploy's AI component identifies potential test cases for boundary values, missing/extra fields, wrong data types, out-of-order sequences, retries, and timeouts, thereby expanding API schema, statement, and branch coverage.
  • CI/CD Integration: Tests can be seamlessly run within CI pipelines (e.g., GitHub Actions, Jenkins) or across Kubernetes clusters.
  • Multi-Purpose Mocks: The generated mocks can also be utilized as server stubs or for local development environments.
  • Unified Reporting: Provides consolidated reports for API, integration, unit, and end-to-end coverage.
  • Developer Console: A web-based interface for managing, viewing, and debugging recorded tests and mocks.
  • Mock Registry: A centralized system for managing, reusing, and versioning mocks across teams and environments.

The tool positions itself as a solution for achieving high test coverage (e.g., 90%) with minimal effort, by generating tests faster than traditional unit tests, directly from real user traffic, and significantly reducing the overhead of setting up and managing test environments.