BreakDown of API Testing CheatSheet Considering Modern APIs
API Testing Framework/
│
├─── Response Validation/
│ ├─── data/
│ │ ├─── **Structure Validation** (JSON, XML format verification)
│ │ ├─── **Schema Compliance** (API specification matching)
│ │ ├─── **Data Type Verification** (field type validation)
│ │ ├─── **Null/Empty Checks** (missing data handling)
│ │ └─── **Numeric Precision** (decimal and scale validation)
│ │
│ └─── status/
│ ├─── **Success Codes** (200, 201, 202 verification)
│ ├─── **Error Codes** (400, 401, 404, 500 testing)
│ ├─── **Edge Cases** (rate limiting, timeouts)
│ └─── **Consistency Checks** (cross-endpoint validation)
│
├─── Request Validation/
│ ├─── headers/
│ │ ├─── **Required Headers** (Authorization, Content-Type)
│ │ ├─── **Custom Headers** (X-Correlation-ID, security headers)
│ │ └─── **Header Formatting** (malformed header testing)
│ │
│ ├─── payload/
│ │ ├─── **Format Validation** (JSON, XML structure)
│ │ ├─── **Field Validation** (required vs optional)
│ │ ├─── **Boundary Testing** (size limits, overflows)
│ │ └─── **Input Sanitization** (injection attack prevention)
│ │
│ └─── details/
│ ├─── **HTTP Methods** (GET, POST, PUT, DELETE)
│ ├─── **Host Configuration** (URL validation, SSL)
│ ├─── **API Versioning** (version compatibility)
│ ├─── **Path Parameters** (endpoint formatting)
│ └─── **Endpoint Behavior** (business logic validation)
│
└─── Additional Considerations/
├─── **Authentication & Authorization** (token validation, RBAC)
├─── **Performance Testing** (response time, load testing)
├─── **Error Handling** (graceful failures, logging)
├─── **Security Testing** (vulnerability scanning)
└─── **Caching** (cache headers, invalidation)
1) Response Validation serves as your quality gateway, ensuring that what comes back from your API meets both technical and business requirements.
2) Request Validation acts as your input security checkpoint, making sure that what goes into your API is properly formatted, authorized, and safe.
➡ What are Response Data, Status Codes & Request Components?
➡ Response Data Testing: Systematic validation of the actual content returned by your API, ensuring structural integrity and business rule compliance.
➡ Status Code Testing: Verification that your API communicates its state correctly through HTTP status codes, helping clients understand what happened with their requests.
➡ Request Component Testing: Comprehensive examination of all parts of incoming requests to ensure they meet security, formatting, and business requirements.