In a 30-day month (720 h) the HLAMS payment server failed 4 times; the repairs took 2, 1.5, 3 and 1.5 hours. In the same month 50,000 payment requests were made, of which 15 failed. Find MTTR, MTTF, MTBF, availability, ROCOF and POFOD.
Critical systems are those whose failure can cost lives, missions or large sums. They are specified through risk analysis and measurable dependability requirements, and built with fault avoidance, fault detection and fault tolerance — redundancy and diversity such as TMR, N-version programming and recovery blocks.
A critical system is one whose failure could lose a great deal of money, damage property or the environment, or endanger lives. Sommerville distinguishes three kinds:
| Type | Failure may cause… | Examples |
|---|---|---|
| Safety-critical | Injury, loss of life or serious environmental damage | Chemical-plant control, insulin pump, railway signalling, lift and fire-alarm controllers |
| Mission-critical | Failure of some goal-directed activity | Spacecraft navigation, an air-traffic flow system, military command systems |
| Business-critical | Very high costs for the business using the system | A bank's customer-accounting system, HLAMS EMI collection and loan ledgers |
The most important property of a critical system is dependability — the user's justified confidence that it will operate as expected and will not fail in normal use. It matters because systems that are unreliable, unsafe or insecure are often rejected by their users; because the cost of failure can be enormous compared with the cost of the system; and because untrustworthy systems can lose information that is costly to recover.
| Dependability property | Meaning | HLAMS / KSHB example |
|---|---|---|
| Availability | Ability to deliver services when requested | The payment service is up when applicants try to pay |
| Reliability | Ability to deliver services as specified, over time | EMIs are posted correctly every month |
| Safety | Ability to operate without catastrophic failure (harm to people or the environment) | The fire-alarm panel never fails silently |
| Security | Ability to protect itself against accidental or deliberate intrusion | No insider can alter a sanctioned amount unnoticed |
| Repairability, maintainability | How quickly failures can be diagnosed and repaired; how easily the system can be changed | Faulty modules found from logs and fixed quickly |
| Survivability | Ability to keep delivering essential services while under attack or after partial damage | Applications still accepted while the MIS server is down |
| Error tolerance | Ability to avoid and tolerate user input errors | Rejects a date of birth in the future instead of crashing |
Dependability is expensive: the cost rises steeply as higher levels are demanded, because more expensive techniques, more redundancy and far more verification are needed — Sommerville notes that validation can exceed half the development cost of a critical system. The properties also conflict: checks that improve reliability slow the system (performance); a 'fail-safe' shutdown improves safety but reduces availability; strong security controls hurt usability.
Sommerville describes a chain of four terms. A human error or mistake — a programmer misunderstands a requirement — introduces a system fault, a characteristic of the software that can lead to a system error (e.g. a variable that is never initialised). When the faulty code executes, it may create a system error: an erroneous system state that can lead to unexpected behaviour (the variable holds garbage). If that state reaches the outputs, a system failure occurs: an event at some point in time when the system does not deliver a service as its users expect.
Three complementary strategies improve dependability: fault avoidance (development techniques that minimise the chance of introducing faults), fault detection and removal (verification and validation that find faults before the system is used) and fault tolerance (run-time techniques that stop faults from causing failures). Failures themselves are classified as transient or permanent, recoverable or unrecoverable, and non-corrupting or corrupting (whether they damage the system's data).
Critical-system requirements are derived from an analysis of risk. The key terms: an accident (mishap) is an unplanned event, or chain of events, that kills or injures people or damages property or the environment; a hazard is a condition with the potential to cause or contribute to an accident; damage measures the loss from an accident; hazard severity assesses the worst damage a hazard could cause; hazard probability is the likelihood of the events that create the hazard; and risk combines hazard probability, severity and the probability that the hazard leads to an accident.
| Region | Meaning | Action |
|---|---|---|
| Unacceptable (intolerable) | The risk cannot be tolerated under any circumstances | Redesign so the hazard cannot arise, or abandon the design |
| ALARP — as low as reasonably practicable | Tolerated only if further reduction is impractical or grossly disproportionate in cost | Reduce as far as is cost-effective; justify the residual risk |
| Broadly acceptable | The risk is negligible | No further measures needed; keep monitoring |
| Hazard (KSHB fire-alarm panel) | Probability | Severity | Risk | Classification |
|---|---|---|---|---|
| Alarm fails to sound during a fire | Low | Catastrophic | High | Intolerable |
| Fire-exit doors fail to unlock | Low | Catastrophic | High | Intolerable |
| False alarm causes a rush on the stairs | Medium | Serious | Medium | ALARP |
| Panel shows the wrong zone | Low | Serious | Medium | ALARP |
| Battery-low warning not displayed | Medium | Minor (alarm still works on mains) | Low | Acceptable |
Fault-tree analysis (FTA), developed at Bell Laboratories in 1962 for the Minuteman missile programme, is a deductive, top-down technique for risk decomposition. The hazard is placed at the root; beneath it are the conditions that could cause it, linked by OR gates (any one input causes the output) and AND gates (all inputs are needed), down to basic events at the leaves. Its inductive, bottom-up counterpart is failure modes and effects analysis (FMEA), which starts from each component's possible failures and works out their effects.
[TOP] Alarm not raised during a fire
|
( OR )
+----------------------+----------------------+
| | |
Detection fails Controller software Single sounder
( AND ) fails on demand fails on demand
+----+----+ p = 0.0005 p = 0.002
| |
Detector A Detector B
p = 0.01 p = 0.01A minimal cut set is a smallest set of basic events that together cause the top event. Here they are {Detector A, Detector B}, {Controller} and {Sounder}. A cut set with only one event is a single point of failure — the controller and the single sounder. The analysis therefore tells the designer where redundancy pays: duplicating the sounder makes its contribution 0.002² = 0.000004 and cuts the top-event probability to about 0.0006, leaving the controller as the dominant cause to tackle next.
Safety specification identifies protection requirements that ensure system failures do not cause injury, death or environmental damage. Many are 'shall not' requirements — they define situations that must never occur — and each is derived from a hazard in the risk analysis. IEC 61508 (functional safety of electrical, electronic and programmable systems) separates functional safety requirements (what the safety functions must do) from safety integrity requirements, expressed as Safety Integrity Levels SIL 1–4 (SIL 4 the most demanding). Sector standards follow the same idea: DO-178C for airborne software (levels A–E) and ISO 26262 for road vehicles (ASIL A–D).
Firesmith's classification lists ten types of security requirement: identification, authentication, authorisation, immunity (against viruses and worms), integrity (data not corrupted), intrusion detection, non-repudiation, privacy, security auditing and system-maintenance security. Misuse cases — use cases written from an attacker's point of view — help to elicit them.
| Metric | Definition | Example | Use when |
|---|---|---|---|
| POFOD — probability of failure on demand | Likelihood that the system fails when a service request is made | POFOD = 0.001: 1 in 1,000 demands fails | Demands are infrequent but failure is serious — emergency shutdown, fire-alarm activation |
| ROCOF — rate of occurrence of failures | Frequency of unexpected behaviour per unit of operating time (failure intensity) | ROCOF = 2/100: two failures per 100 operational time units | Demands are regular — transaction processing such as HLAMS payments |
| MTTF — mean time to failure | Average time between observed system failures (Sommerville) | MTTF = 500 h: one failure every 500 hours on average | Long, uninterrupted sessions — CAD workstations, long editing jobs |
| AVAIL — availability | Probability the system is available for use at a given time; includes repair time | AVAIL = 0.998: available 998 of every 1,000 time units | Continuously running services — telephone switches, payment gateways |
| HLAMS payment-service failure class | Example | Requirement |
|---|---|---|
| Permanent, non-corrupting | No payment can be processed at all | ROCOF ≤ 1 occurrence per 1,000 days |
| Transient, non-corrupting | One payment fails and must be retried | POFOD ≤ 0.001 (1 in 1,000 transactions) |
| Transient, corrupting | A pattern of transactions corrupts loan balances | Unquantifiable — must never happen in the system's lifetime; prevented by design (transactions, integrity checks) |
Reliability is measured by statistical testing against an operational profile (the expected pattern of use), and its improvement during testing is predicted with reliability growth models such as Jelinski–Moranda (1972; parameters estimated by maximum-likelihood estimation) and Musa's execution-time model. For the most critical parts, requirements are written in a formal specification language — Z (Abrial, Oxford; ISO/IEC 13568), B (Abrial; used for the Paris Métro Line 14 driverless control software) or VDM (IBM Vienna) — so that they are unambiguous and can be analysed or proved:
Dependable processes reduce the faults introduced and find more of those that remain. Sommerville lists their characteristics: documentable (a defined process model sets out the activities and documents), standardised (comprehensive development and documentation standards), auditable (outsiders can check that the process is followed), diverse (redundant and diverse verification and validation activities) and robust (able to recover from the failure of individual process activities). Typical activities: requirements inspections, requirements management, model checking, design and code inspections, static analysis, test planning and management, and configuration management.
The list above is Sommerville's set of error-prone constructs that safe programming avoids or tightly restricts. His later editions summarise dependable programming in eight guidelines: limit the visibility of information; check all inputs for validity; provide a handler for all exceptions; minimise the use of error-prone constructs; provide restart capabilities; check array bounds; include timeouts when calling external components; and name all constants that represent real-world values.
class InvalidLoanDataException extends Exception {
InvalidLoanDataException(String msg) { super(msg); }
}
class EmiService {
static final int MAX_TENURE_MONTHS = 240; // named real-world constants
static final double MAX_RATE_PCT = 20.0;
long emi(long principal, double ratePct, int months) throws InvalidLoanDataException {
// never trust inputs, even from our own modules
if (principal <= 0)
throw new InvalidLoanDataException("principal must be positive");
if (months < 1 || months > MAX_TENURE_MONTHS)
throw new InvalidLoanDataException("tenure out of range: " + months);
if (ratePct < 0 || ratePct > MAX_RATE_PCT)
throw new InvalidLoanDataException("rate out of range: " + ratePct);
double r = ratePct / 1200;
double f = Math.pow(1 + r, months);
double value = (r == 0) ? (double) principal / months : principal * r * f / (f - 1);
long result = Math.round(value);
if (result < principal / months) // sanity check: EMI can never be below principal ÷ tenure
throw new IllegalStateException("EMI too small to repay the loan");
return result;
}
}Fault detection and removal relies on V&V: reviews and inspections of requirements, design and code; static analysis tools that find control and data anomalies without running the program; formal verification of critical algorithms; and testing — including statistical testing for reliability. Critical-systems validation is costly, but cheaper than the failures it prevents.
Hardware fault tolerance uses triple modular redundancy (TMR): three identical components receive the same input and their outputs go to a voter (output comparator). If one output differs, it is outvoted and the component is assumed faulty. TMR assumes faults come from component failures rather than design faults, and that simultaneous failures are unlikely. With module reliability R and a perfect voter, R_TMR = R³ + 3R²(1 − R) = 3R² − 2R³.
+-----------+
input --+->| Module A |--+
| +-----------+ | +---------+
+->| Module B |--+---->| Voter |----> output (majority of 3)
| +-----------+ | +---------+
+->| Module C |--+
+-----------+Both rely on design diversity — different teams, languages, algorithms and tools — on the assumption that independent teams make different mistakes. Experiments (Knight and Leveson, 1986) showed this is only partly true: teams misread the same ambiguous parts of a specification and find the same parts difficult, and an error in the specification is copied into every version. These common-mode failures limit the benefit, and diversity multiplies cost.
Finally, regulators of nuclear, railway, aviation and medical systems demand a safety case: a structured, documented argument, backed by evidence, that convinces them the system is acceptably safe for its intended use in its intended environment. It links claims to evidence through arguments (often drawn in Goal Structuring Notation) and includes the system description, safety requirements, hazard and risk analyses, design analyses, V&V results, review reports, team competence, QA and change-management records. A dependability case extends the idea to reliability and security.
Try the problem first, then reveal the working one step at a time.
In a 30-day month (720 h) the HLAMS payment server failed 4 times; the repairs took 2, 1.5, 3 and 1.5 hours. In the same month 50,000 payment requests were made, of which 15 failed. Find MTTR, MTTF, MTBF, availability, ROCOF and POFOD.
Each controller module of a lift-safety system has reliability R = 0.95 over a year. Find the reliability of a TMR arrangement with (a) a perfect voter and (b) a voter of reliability 0.999. Compare with a single module.
For the fault tree in this topic — top event 'alarm not raised during a fire' = OR(detection fails, controller fails 0.0005, sounder fails 0.002), with detection fails = AND(detector A 0.01, detector B 0.01) — compute the top-event probability, identify single points of failure, and recompute after adding a second independent sounder.
(a) Three independently written EMI modules return ₹8,997, ₹8,997 and ₹9,015 for the same loan. What does the voter output? (b) In a recovery block the primary EMI routine returns a schedule whose principal parts sum to ₹9,98,500 for a ₹10,00,000 loan. What happens?
The HLAMS payment gateway must be 99.95% available, 24 × 7. (a) What downtime does that allow per year? (b) If the mean time to repair is 30 minutes, what MTTF is required?
Classify each risk for a KSHB lift as intolerable, ALARP or broadly acceptable, and name a risk-reduction strategy: (a) lift moves with the doors open; (b) lift stops between floors with passengers inside (low probability, serious discomfort); (c) floor-indicator display shows the wrong floor occasionally.
A code review of an embedded controller finds: recursive tree traversal, malloc() inside the control loop, comparison 'if (flow == 0.3)' on a float, an array indexed by a sensor value without a bounds check, and an interrupt routine that updates a shared counter without protection. Which of Sommerville's safe-programming concerns does each raise?
Forward or backward recovery? (a) Rolling a database transaction back to its start; (b) using a checksum and a duplicate copy to rebuild a corrupted record; (c) restarting from the last saved checkpoint; (d) repairing a broken link in a doubly linked list using the reverse pointer.
Put Sommerville's security-specification stages in order and give an HLAMS example output for each.
10 questions. 70 % passes the topic quiz (+30 XP, +20 more for 100 %). Exam scoring: +1 correct, −⅓ wrong.
Modelled on real KPSC questions (reworded) with the same concept and answer; each links to its original paper.