MOOCTEST_基础课程_PIE模型

Software Fault: A static defect in the software(i.e.,defect) “缺陷”——Execution

Software Error: An incorrect internal state that is the manifestation of some faults.

        ”错误的中间状态“——Infection

Software Failure: External, incorrect behavior with respect to the requirements or other         description of the expected behavior."失效“——Propagation

PIE Model

  • Execution/Reachability:The location or locations in the program that contain the fault must be reached.
    •   A  test may not execute the location of the fault.(控制流调用较为复杂)
  • Infection 感染: The state of the program must be incorrect.
    •   A test executing the fault may not produce an error.(结果相同)
  • Propagation 传播: The infected state must propagate to cause some output of the program to be incorrect.
    •   An error may not be propagated to the output.(结果相同)

例如:

一个程序用for循环求数组和,并且求均值,但i错误的从1开始。——此时对应Fault

当程序运行后,程序将数组第一个数据跳过。——此时对应Error

程序运行结束,输出结果错误。——此时对应Failure

但是,这三种情况有时不会显而易见。

Fault. 当程序复杂时,如果程序没有运行到错误的地方则无法发现Fault。

Error. 按照上例,如数组0 4 5,求和、均值结果正确,并不会产生Error。

Failure. 按照上例,如数组4 3 5,求和发生Error,但均值没有错误,属于No Failure.

posted @ 2020-02-18 21:52  Comet_Fei  阅读(310)  评论(0编辑  收藏  举报