Recovery Testing
What is Recovery Testing?
Recovery testing checks how well an application can recover from crashes, hardware failures, network outages, or other catastrophic problems.
Key Aspects Verified
- Whether the application can restart correctly after an unexpected failure.
- Whether data integrity is preserved and no data is lost or corrupted.
- How quickly the system can resume normal operations after recovery.
Why It Matters
Recovery testing is critical for systems that must maintain high availability, such as banking or e-commerce platforms, where failures must be handled gracefully without impacting users.
Failures Worth Simulating
Recovery testing deliberately introduces faults in a controlled test environment and watches how the system copes. Typical scenarios include:
| Failure | How testers simulate it | What to check |
|---|---|---|
| Application crash | Stop or kill the service process | Automatic restart, no lost sessions or orders |
| Server reboot | Restart the VM or container host | Services start in the right order and reconnect |
| Database outage | Stop the database or block its port | Clear error messages, retries, no partial writes |
| Network drop | Disconnect a cable or disable an interface | Queued requests resume; no duplicates |
| Disk full | Fill a test volume | Graceful failure and alerts instead of corrupt files |
| Restore from backup | Restore last night's backup to a fresh server | Data is complete and the app works on it |
RTO and RPO: The Targets You Test Against
Two business targets turn recovery from a vague idea into a measurable test:
- Recovery Time Objective (RTO): the longest acceptable time from failure until service is back.
- Recovery Point Objective (RPO): the largest acceptable amount of data loss, measured as time before the failure.
The business sets these values; testers measure whether the system meets them. A test that "recovered" but took far longer than the RTO is still a failed test.
Worked Example: Crash During Checkout
An e-commerce team wants to know what happens if the order service crashes while a payment is being processed. In the test environment they:
- Place ten orders through an automated script, pausing the tenth just after payment confirmation.
- Stop the order service abruptly at that moment.
- Record the time and watch the orchestrator or service manager restart it.
- Check that the tenth order ends up either completed or clearly marked for retry, never charged twice and never lost.
- Compare the database with the payment gateway sandbox records.
# Simulate the crash in a test environment
sudo systemctl kill --signal=SIGKILL order-service # unit uses Restart=on-failure
systemctl status order-service # confirm it came back
# Kubernetes alternative: kubectl delete pod order-service-7d9f-abcde
# Verify data integrity afterwards
SELECT order_id, status, payment_ref
FROM orders
WHERE created_at >= NOW() - INTERVAL 1 HOUR
ORDER BY created_at;
SELECT payment_ref, COUNT(*) AS times_used
FROM orders
GROUP BY payment_ref
HAVING COUNT(*) > 1; -- should return no rows
The second query catches duplicate charges, one of the most damaging recovery defects.
Planning Tips and Common Mistakes
- Get approval and isolate the environment. Fault injection belongs in test or staging environments with agreed time windows, not on live systems without a plan.
- Define pass criteria first: restart time, acceptable data loss and expected user messages.
- Check logs and alerts. Monitoring should notice the failure; silent outages are a defect in themselves.
- Test the restore, not just the backup. Many teams only discover broken backups when they need them.
- Repeat after major changes. New services, database upgrades or infrastructure moves can quietly break recovery steps.
Recovery testing overlaps with failover testing, which checks that a standby takes over, and with reliability testing, which looks at failure rates over time. Recovery testing focuses on the moment after something breaks.
Ready to master real-world software testing?
Learn manual and automation testing hands-on with mentor-led sessions.