Adapter Contract Testing

0•

Implements standardized contract testing patterns to ensure simulators and real adapters maintain behavioral parity.

This skill provides Claude with specialized guidance for implementing and reviewing adapter contract tests, a crucial technique in ports-and-adapters (hexagonal) architectures. It enforces a strict pattern where a shared abstract test suite is run against both real implementations and simulators to prevent 'simulator drift' and ensure that fakes remain honest representations of production behavior. It includes specific rules for Python-based testing, such as using abstract base classes, managing test data through pre-seeding rather than skipping, and maintaining a clean separation between shared contracts and implementation-specific edge cases.

主な機能

01Identifies and prevents 'simulator drift' in integration testing
02Separates shared contract logic from simulator-specific internal tests
030 GitHub stars
04Provides guidelines for data pre-seeding to avoid test skipping
05Standardizes Python abstract base class (ABC) contract patterns
06Enforces behavioral parity between real adapters and simulators

ユースケース

01Standardizing integration testing patterns across a microservices project
02Ensuring a mock gateway behaves exactly like a real external API
03Reviewing code to ensure new adapters adhere to strict contract requirements