1.4The Three API Paradigms
This book covers testing strategies for three API paradigms:
REST APIs
REST (Representational State Transfer) is the most common API paradigm. REST APIs use HTTP methods (GET, POST, PUT, DELETE) to operate on resources identified by URLs. Responses are typically JSON. REST APIs are described by OpenAPI (Swagger) specifications.
Testing focus: Schema validation, status code coverage, boundary values, authentication, error handling.
GraphQL APIs
GraphQL allows clients to request exactly the data they need through a flexible query language. Instead of multiple REST endpoints, a single GraphQL endpoint accepts queries that specify the desired fields and relationships.
Testing focus: Query depth limits, N+1 query detection, complexity analysis, federation correctness, schema stitching.
gRPC APIs
gRPC uses Protocol Buffers for strongly-typed, high-performance RPC (Remote Procedure Call) communication. It is common in internal service-to-service communication where performance is critical.
Testing focus: Proto file validation, streaming behavior, deadline/timeout handling, backward compatibility.