1、Software Faults, Errors & Failures
Software Fault :
A static defect in the software
Error是指实际值偏离你最初的期望,往往是由人为造成的。
Software Failure : External, incorrect behavior with respect to the requirements or other description of the expected behavior
fault通常是由于程序中不正确的步骤,过程或者数据定义,导致程序出现了非故意的、不可预料的行为。fault通常是由error导致的。
Software Error : An incorrect internal state that is the manifestation of some fault
fault通常是由于程序中不正确的步骤,过程或者数据定义,导致程序出现了非故意的、不可预料的行为。fault通常是由error导致的。
一些人为的error,使得程序中产生了不正确的步骤、过程和数据定义,从而使程序出现了一些不可预料的fualt,这些 fault最终又致使系统或者组件不能完成了最初要求的功能,也就是failure。
2、Homework 2
作业内容:
(1)the fault
1:i > 0, it should be i ≥ 0
2: it should search from end to start to get the index of the LAST 0.
for(i=0; i<length; i++) should be for(i=length-1; i≥0; i--)
(2)a test case that does not execute the fault
1:x = null
2:x = null
(3)a test case that executes the fault, but does not result in an error state.
1:x = [1,2,3 ]; y = 3
2:x = [0]
(4) a test case that results in an error, but not a failure
1:x=[1, 2, 3], y=4
2:x=[1, 2, 3]