MOOCTEST_基础课程_PIE模型

本文深入探讨了软件缺陷的三个阶段:缺陷(Fault)、错误(Error)和失效(Failure),并详细解释了它们在软件生命周期中的具体表现。通过一个具体例子,阐述了这三者之间的联系与区别,以及在复杂程序中识别和定位缺陷的挑战。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值