When I design tests for a paginated, filterable, sortable REST endpoint I start with clear acceptance criteria and an OpenAPI contract. I prioritize the happy path (correct page, size, filters, and sort order) and critical edge cases: page 0 or negative, page beyond last, pageSize 0 or max, empty results, and combinations of multiple filters. I automate parameterized tests to cover permutations and add contract tests to catch schema drift. For security I include malformed input and injection attempts. For performance I run load and stress tests against realistic data volumes (I’ve tested with 10M rows) and set SLO targets like 95th percentile latency <300ms and error rate <1%. I also add canary runs and synthetic checks every 5 minutes in production to detect regressions early.
Get AI-powered feedback on your answer and improve your skills
Takes 5-10 minutes