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的区别,这题不会做。希望老师上课可以再讲讲。

  • 相关阅读:
    提升开发效率的十个工具
    JQuery常用函数及功能小结
    jquery-validation 学习总结
    JavaScript:避免代码的重复执行
    18 个最好的CSS框架用于提高开发效率
    如何书写高质量的jQuery代码
    13个 ASP.NET MVC 的扩展
    CSS_LESS 语法/函数详解
    21个值得收藏的Javascript技巧
    JQuery常用功能的性能优化
  • 原文地址:https://www.cnblogs.com/GSONG/p/5260122.html
Copyright © 2011-2022 走看看