Skip to content

API Testing Standard

Purpose

The API Testing Standard defines how future API specifications must be verified.

Test Types

Test Type Purpose
Contract tests Verify request, response, errors, and version compatibility.
Security tests Verify authentication, authorization, MFA, and denial behavior.
Tenant tests Verify tenant isolation, OrganizationId checks, and server-side filtering.
Entitlement tests Verify Billing entitlements, usage limits, and plan restrictions.
Validation tests Verify field, shape, and business input validation.
Idempotency tests Verify replay, conflict, and missing key behavior.
Pagination tests Verify stable pages, page size limits, filters, and sorting.
Rate limit tests Verify throttling and safe error responses.
Modulith boundary tests Verify APIs do not bypass owning application services.

Minimum Acceptance Criteria

  • Unauthorized requests fail closed.
  • Cross-tenant access attempts are denied.
  • Entitlement-controlled requests fail when Billing denies access.
  • Validation errors use the standard error envelope.
  • Material commands emit audit context and correlation IDs.
  • Retryable commands enforce idempotency where required.
  • Collection APIs have deterministic pagination behavior.
  • API contracts do not expose aggregates or internal persistence models.

Test Flow

flowchart LR
    Spec[API Spec]
    Contract[Contract Tests]
    Security[Security Tests]
    Tenant[Tenant Tests]
    Modulith[Boundary Tests]
    Release[Release Candidate]

    Spec --> Contract
    Spec --> Security
    Spec --> Tenant
    Spec --> Modulith
    Contract --> Release
    Security --> Release
    Tenant --> Release
    Modulith --> Release

Non-Goals

This document does not define test frameworks, fixtures, CI pipelines, coverage thresholds, or generated test tooling.