25-Comp-B11 Advanced Software Design · May 2016
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer) · Last updated
Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.
The three terms describe successive stages in how a defect in the software can (but need not always) turn into a user-visible problem, and standard dependability terminology (IEEE/Sommerville) keeps them strictly distinct.
Fault. A static, latent property of the software itself — an incorrect step, process, or data definition (a wrong line of code, an off-by-one loop bound, a mis-typed constant). A fault exists in the artifact whether or not it is ever executed; it is sometimes called a "bug" or "defect."
Error. A dynamic, internal deviation from the correct state that occurs when a fault is actually EXECUTED (e.g., a variable holding an out-of-range value, an internal data structure left inconsistent). An error is a symptom that has appeared inside the running system, but has not necessarily reached anything a user can observe yet.
Failure. An externally OBSERVABLE deviation from the system's specified or expected service — the point at which an error has propagated all the way to the system's output or behaviour, where a user or an external system can actually see something wrong.
Relationship. A fault, when executed, MAY produce an error (not every fault is triggered by every input — a fault on a rarely-taken code path may sit dormant indefinitely); an error, if it propagates without being masked or corrected, MAY become a failure (defensive checks, redundancy, or simple luck — the erroneous value happening not to affect the final output — can prevent an error from ever reaching the output). Concretely: an off-by-one loop bound (fault) reads one element past the intended array range, producing a wrong internal total (error); if that wrong total is later displayed to the user or drives an incorrect downstream decision, a failure has occurred. If a later step in the same computation happens to discard or overwrite that specific wrong value before it reaches any output, the fault and the error both existed, yet no failure occurred.