zoukankan      html  css  js  c++  java
  • 【软件测试】作业二:fault & error & failure

    REVIEW:

    Software Fault: A static defect in the software;(eg: virus)

    Software Failure: External, incorrect behavior with respect to the requirements or other description of the expected behavior;( eg: high body temperature)

    Software Error: An incorrect internal state that is the manifestation of some fault;(eg: some symptoms)

    Reachability: The location or locations in the program that contain the fault must be reached

    Infection: The state of the program must be incorrect

    Propagation: The infected state must cause some output or final state of the program to be incorrect
    Software Testing Techniques

    HOMEWORK:

    1.Identify the fault.

    (1) 'i > 0' should be 'i >= 0';

    (2) it returns to the first '0' but not the last '0', I have 2 ways to correct it:

    #1:

    int k = -1;
    for (int i= 0; i< x.length; i++)
    {
        if (x[i] == 0)
        {
            k = i;
        }
    } 
    return k;

    #2:

    for (int i= x.length - 1; i >= 0 ; i--)
    {
        if (x[i] == 0)
        {
            return i;
        }
    } return -1;    

    2.If possible, identify a test case that does not execute the fault. (Reachability)

    (1) Test case: x = null.

    (2) It always execute the fault.

    3.If possible, identify a test case that executes the fault, but does not result in an error state.

    (1) Test case: x = [1,2,3 ]; y = 3; Expected: 2; Actual: 2.

    (2) It's impossible.

    4.If possible identify a test case that results in an error, but not a failure.

    (1) Test case: x = [1,2,3 ]; y = 4; Expected: -1; Actual: -1.

    (2) Test case: x = [1,2,0 ]; Expected:2; Actual:2.

  • 相关阅读:
    python全栈开发_day48_bootstrap
    python全栈开发_day47_js,jQuery
    python全栈开发_day46_html文本标签
    抽象集合
    ViewState的用法
    sql(join中on与where区别)
    微软的技术文档链接地址
    微软的帮助文档,详细的介绍VS开发工具的使用
    [摘录]解决C# DateTime去掉时分秒几种方法
    验证(摘录)
  • 原文地址:https://www.cnblogs.com/3013218071zjr/p/5249791.html
Copyright © 2011-2022 走看看