---
title: "Software fault tolerance and recovery"
subject: "Instrumentation II"
chapter: 9
key: "semester_5/instrumentation_ii:sw-fault-tolerance-rollback"
source: https://www.bctengineer.com/q/semester_5/instrumentation_ii/sw-fault-tolerance-rollback
site: BCT Engineering
---

# Software fault tolerance and recovery

Instrumentation II · Chapter 9: Software For Instrumentation And Control Applications

- Asked in: 2069 Chaitra, 2+2 marks; 2075 Chaitra, 2 marks (asked 2 times)
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/instrumentation_ii/sw-fault-tolerance-rollback
- Whole chapter: https://www.bctengineer.com/md/semester_5/instrumentation_ii/chapter-9

## Question

What is fault tolerance in software? What do you mean by roll-back recovery and roll-forward recovery?

## Short answer

Fault tolerance enables correct operation despite faults. Roll-back recovery restores a checkpoint and re-executes, losing recent work. Roll-forward recovery moves to a corrected new state without going back, faster but more complex.

## Answer

#### Fault tolerance in software
**Software fault tolerance** is the ability of a program to continue operating correctly (or degrade gracefully) even when software faults (bugs) or hardware faults occur. Since software cannot be tested completely, techniques are used: error detection (checks, assertions, watchdogs), error recovery, **design diversity** (N-version programming, where independent versions vote), **recovery blocks** (try alternate routines if the acceptance test fails), exception handling and redundancy.

#### Roll-back recovery
The system periodically saves a consistent state called a **checkpoint**. When an error is detected, the system goes **back** to the last checkpoint (restores the saved state) and re-executes from there, hoping that the error was transient. 
- Used in databases (transaction roll-back), operating systems and the recovery-block technique.
- Simple and general, but needs extra time and memory and loses the work done since the checkpoint; not suitable for real-time actions that cannot be undone.

#### Roll-forward recovery
When an error occurs, the system does not go back but moves **forward** to a new, error-free state, by correcting the erroneous state or by skipping to a safe state (for example using the value of redundant modules, or reinitialising and continuing).
- Used in real-time and critical systems where time does not allow re-execution.
- Faster, but needs error diagnosis and the knowledge of the correct state, so it is more complex and application-specific.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is software fault tolerance?
   A. Removing every bug before release
   B. Continuing to operate correctly or degrade gracefully despite faults
   C. Stopping immediately on any fault
   D. Making software run faster
   Answer: B. It lets the system keep working even when faults occur. (Key point: Fault tolerance)

2. What does roll-back recovery do on error detection?
   A. Skips to a new error-free state
   B. Ignores the error
   C. Restores the last saved checkpoint and re-executes from there
   D. Restarts all of the hardware permanently
   Answer: C. Roll-back returns to a consistent checkpoint state. (Key point: Roll-back recovery)

3. Why is roll-forward used in real-time critical systems?
   A. It needs no diagnosis at all
   B. It saves checkpoints more often
   C. It can undo any real-world action
   D. No time for re-execution, so it moves to a safe error-free state
   Answer: D. It is faster but needs knowledge of the correct state. (Key point: Roll-forward recovery)

4. What is a drawback of roll-back recovery?
   A. Extra time and memory, and work since the checkpoint is lost
   B. It cannot be used in databases
   C. It needs application-specific diagnosis only
   D. It is faster than roll-forward always
   Answer: A. Roll-back loses work and cannot undo real-time actions. (Key point: Roll-back limitation)

## Related in Instrumentation II

- [Fault tolerance and redundancy for reliability](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Afault-tolerance-schemes) — Instrumentation II, chapter 7, asked 4×
- [Disaster recovery in software](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Asw-disaster-recovery) — Instrumentation II, chapter 9
- [Software maintenance and fixing common bugs](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Asw-maintenance-bugs) — Instrumentation II, chapter 9
- [Embedded real-time software; model for project](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Aembedded-rt-software-model) — Instrumentation II, chapter 9
- [Increasing reliability of embedded real-time software](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Aembedded-rt-reliability) — Instrumentation II, chapter 9

## Related in other subjects

- [Forward/backward recovery; checkpointing](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aforward-backward-coordinated-ckpt) — Distributed System, chapter 9
- [Short note: Forward and backward recovery](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aforward-backward-note) — Distributed System, chapter 9, asked 2×
- [Availability and fault tolerance in GFS](https://www.bctengineer.com/question.md?key=semester_8%2Fbig_data_technologies%3Agfs-availability-fault-tolerance) — Big Data Technologies, chapter 2
- [Replication, fault tolerance, scalability](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Areplication-scalability-ft) — Distributed System, chapter 7
