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

  • 相关阅读:
    Nginx 七层反向代理
    Nginx Rewrite域名及资源重定向!(重点)
    对FPM 模块进行参数优化!
    Nginx压力测试及通用优化
    LNMP架构及应用部署!(重点)
    安装PHP解析环境!
    Mysql安装并修改字符集 ----> 基于源码包安装
    Nginx安装部署!
    python入门
    Android学习进度三
  • 原文地址:https://www.cnblogs.com/3013218071zjr/p/5249791.html
Copyright © 2020-2023  润新知