zoukankan      html  css  js  c++  java
  • 软件测试[2]falut error failure 的区别与理解

    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的定义:当一个系统不能执行所要求的功能时,即为Failure,可译为“失效”。(Termination of the ability of an element or an item to perform a function as required.)

    下面是我们第二次作业的实例分析

    Below are four faulty programs. Each includes a test case that results in failure. Answer the following questions (in the next slide) about each program.

    对于问题1

    (1)判断条件应该为i >=0;当数组的下标为0时,也要判断。

    (2)要找出最后一个0的下标,应该从后往前找,for循环可以这样改for(int i=x.length-1;i>=0;i--)

    问题2

    (1)不执行falut代码,x为空数组

    (2)x为空数组

    问题3

    (1)执行falut代码,但是不出现error x = [1,2,3] y=2;

    (2)x=[1,1,0] 

    问题4

    老是我分不清error和failure的区别,这题不会做。希望老师上课可以再讲讲。

  • 相关阅读:
    学习WEB基础知识(2)
    HTMLform表单的学习
    osg渲染到纹理的代码,把读入的节点当成纹理渲染到一个正方形上
    提取旋转矩阵
    osg选取
    osg,由eye,center,up生成的左乘,右手坐标系的矩阵
    相机沿着场景旋转
    贝塞尔曲线递归
    贝赛尔曲线,四点控制
    得到相交的三角面片的三个顶点坐标
  • 原文地址:https://www.cnblogs.com/GSONG/p/5260122.html
Copyright © 2011-2022 走看看