Q32 of 38 · CI/CD & DevOps
How would you design a rollback strategy and what automated tests support it?
Short answer
Short answer: A rollback strategy defines how to revert to the last known-good state when a deployment goes bad. QA's role is to write post-deploy smoke tests that trigger rollback automatically and to validate that the rollback itself restores expected behaviour.
Detail
There are three common rollback mechanisms, each with different test implications.
Re-deploy previous artifact: the pipeline reruns the deploy job with the last stable image tag. QA needs post-deploy smoke to pass after the rollback to confirm full recovery — not just that the deployment step completed.
Blue-green traffic switch: traffic shifts back to the blue environment instantly. The test here is verifying the blue environment's smoke still passes (it should, if you ran smoke before the original cutover) and that in-flight sessions were not corrupted by the brief exposure to the new version.
Feature flag kill-switch: the new code path is disabled without a redeploy. The fastest rollback of the three. QA must test the flag-off code path as part of the feature's test plan — not as an afterthought when an incident occurs.
For all three: document the rollback runbook, test the rollback in staging on a quarterly cadence, and automate it in the pipeline — a manual rollback executed under incident pressure is slow and error-prone.