Fault故障:可能导致系统或功能失效的异常条件(Abnormal condition that can cause an element or an item tofail.)。
Error错误:计算、观察或测量值或条件,与真实、规定或理论上正确的值或条件之间的差异(Discrepancy between a computed, observed or measured value or condition and the true, specified, or theoretically correct value or condition.)
Error是能够导致系统出现Failure的系统内部状态。
Failure失效:系统不能执行所要求的功能(Termination of the ability of an element or an item to perform a function as required.)。
简单的来说:程序中存在逻辑错误等可能导致出现问题的异常条件我们就说存在fault,执行某段代码出现了与正常逻辑不同的地方就说出现了error,结果不正确就说出现了failure。
需要注意的是我们这里有两个概念:存在和执行。存在代表代码运行在某些条件下才会触发error,执行代表已经触发。
也就是说会出现以下几种情况:
1.不执行,抛出异常(如条件判断失败了,程序不执行),这时没有运行代码,也就不执行fault了。(有犯罪的想法,但仅限于想法,没有实施