软件测试assignment6

  1. 分析 Chap.5.1 (Lec.17) 自动售货机软件例子生成的判定表图例的第6列和第
    23列,分别给出:
    • 输入条件的自然语义陈述
    • 输出结果的自然语义陈述
    • 用命题逻辑形式描述实现上述输入-输出过程所应用的判定规则,并写
      出获得输出结果的推理演算过程

软件测试assignment6

  1. 解答
    • 输入条件的自然语义陈述
      第六列的输入是11010,代表售货机可以找零,已经投入1元硬币,按下橙汁按钮。
      第23列的输入是01001,代表售货机没有零钱,已经投入1元硬币,按下啤酒按钮。

    • 输出结果的自然语言陈述
      第六列的输出是00110,代表的是找回五角硬币,送出橙汁饮料。
      第23列的输出是11000,代表的是售货机的零钱找完灯亮,退还一元硬币。

    • 用命题逻辑形式描述实现上述输入-输出过程所应用的判定规则,并写
      出获得输出结果的推理演算过程

      • 涉及到的判定规则
        • 第六列
          C4C5    T12C_{4} \lor C_{5} \implies T_{12}
          C2T12    T11C_{2} \land T_{12} \implies T_{11}
          C1T11    T13C_{1} \land T_{11} \implies T_{13}
          C3T13    T14C_{3} \lor T_{13} \implies T_{14}
          C4T14    E24C_{4} \land T_{14} \implies E_{24}
          T13    E23T_{13} \implies E_{23}
        • 第23列
          ¬C1    E21\lnot C_{1} \implies E_{21}
          C4C5    T12C_{4} \lor C_{5} \implies T_{12}
          C2T12    T11C_{2} \land T_{12} \implies T_{11}
          ¬C1T11    E22\lnot C_{1} \land T_{11} \implies E_{22}
      • 涉及的推理演算过程
        • 第六列
          1. (C4C5    T12)C4    T12(C_{4} \lor C_{5} \implies T_{12}) \land C_{4} \implies T_{12}
          2. (C2T12    T11)T12C2    T11(C_{2} \land T_{12} \implies T_{11}) \land T_{12} \land C_{2} \implies T_{11}
          3. (C1T11    T13)T11C1    T13(C_{1} \land T_{11} \implies T_{13}) \land T_{11} \land C_{1} \implies T_{13}
          4. (C3T13    T14)T13    T14(C_{3} \lor T_{13} \implies T_{14}) \land T_{13} \implies T_{14}
          5. (C4T14    E24)C4T14    E24(C_{4} \land T_{14} \implies E_{24}) \land C_{4} \land T_{14} \implies E_{24} 得到E24E_{24}的输出。
          6. (T13    E23)T13    E23(T_{13} \implies E_{23}) \land T_{13} \implies E_{23}得到E23E_{23}的输出。
        • 第23列
          1. (¬C1    E21)¬C1    E21(\lnot C_{1} \implies E_{21}) \land \lnot C_{1} \implies E_{21} 得到E21E_{21}的结果。
          2. (C4C5    T12)C4    T12(C_{4} \lor C_{5} \implies T_{12}) \land C_{4} \implies T_{12}
          3. (C2T12    T11)T12C2    T11(C_{2} \land T_{12} \implies T_{11}) \land T_{12} \land C_{2} \implies T_{11}
          4. (¬C1T11    E22)¬C1C11    E22(\lnot C_{1} \land T_{11} \implies E_{22}) \land \lnot C_{1} \land C_{11} \implies E_{22} 得到E22E_{22}的结果。