• 【软件测试】作业二: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.

  • 相关阅读:
    java解析xml实例——获取天气信息
    Wordpress可以用来做什么?
    Unity3D 快捷键
    Unity3D 快捷键
    OAuth和OpenID的区别
    OAuth和OpenID的区别
    PHP中require和include的区别
    PHP中require和include的区别
    iOS检测QQ是否安装
    iOS检测QQ是否安装
  • 原文地址:https://www.cnblogs.com/3013218071zjr/p/5249791.html
Copyright © 2020-2023  润新知