How should tests differ for PUT and PATCH update operations?
Answer
PUT normally represents replacement of a resource and is idempotent; PATCH applies a partial modification whose semantics depend on the patch format. Test omitted fields, repeated requests, conflicting updates, validation and resulting representation.
Strong answer includes
- replacement versus partial change
- idempotency
- omitted and conflicting fields
Practical example
A tester sends the same PUT request twice and confirms the resource ends up identical both times, proving idempotency; then sends a PATCH with only one field and verifies the other fields stayed untouched instead of being wiped out, which is a bug they've seen before in a naive PATCH implementation.