API Resiliency Testing
© 2025 All Rights Reserved
© 2025 All Rights Reserved
© 2025 All Rights Reserved
© 2025 All Rights Reserved
Resiliency Testing
© 2025 All Rights Reserved
Application Architecture
Test
Request
Response
Request
Response
1
2
3
4
5
Message
Topic
Product Service
App
Order Service
Analytics Service
© 2025 All Rights Reserved
API Resiliency Testing Live Demo
© 2025 All Rights Reserved
Why 351 Tests?
Fields | Data Type | Required | Nullable | Constraints | Values |
name | string | Yes | No | - | - |
type | string | Yes | No | Enum | book, food, gadget & others |
inventory | number | Yes | No | min & max | min = 1 & max = 9999 |
cost | number | No | Yes | min | min = 0.00 |
Positive Variations | Negative Variations | Variation Count |
string | int, bool, null | 4 |
4 enum values | int, bool, null | 7 |
1, 1<random value<9999, 9999 | 0, 10000, string, bool, null | 8 |
0, random value, null | -ve numbers, string, bool | 7 |
= 1,568
© 2025 All Rights Reserved
© 2025 All Rights Reserved
© 2025 All Rights Reserved
Classic Combinatorial Explosion
Before and After
© 2025 All Rights Reserved
Test Execution
Dynamic Test Factory
API
Request
Response
Request Generator
Response Validator
© 2025 All Rights Reserved
Before with Eager List & Try/Catch Blocks
Not enough memory
Dynamic Test Factory
Scenarios
Types / Patterns
Item
String
Date
Order
API
Request
Complete Test List
Response
Request Generator
Response Validator
Filtered
Test List
Exception?
Exception?
yes
no
© 2025 All Rights Reserved
After with Lazy List & Either Monad
Dynamic Test Factory
Scenarios
Types / Patterns
Item
String
Date
Order
API
Request
Response
Request Generator
Response Validator
Lazy List of Tests (Just In Time)
Stream -> Filter -> Map to Tests
Minimal memory usage
Either Monad
Failed Tests
error / left
© 2025 All Rights Reserved
Specmatic Code Walk-thru
© 2025 All Rights Reserved
© 2025 All Rights Reserved