软件工程第五次作业

软件工程第五次作业

回答下列问题。

(1)什么是模块测试和集成测试?它们各有什么特点?
(2)假设有一个由1 000行FORTRAN语句构成的程序(经编译后大约有5 000条机器指令),估计在对它进行测试期间将发现多少个错误?为什么?

(3)设计下列伪码程序的语句覆盖和路径覆盖测试用例:

START
INPUT (A,B,C)
IFA>5
    THEN X= 10
    ELSE X= 1
END IF
IF B> 10
    THEN Y=20
    ELSE Y= 2
END IF
IF C> 15
    THEN Z= 30
    ELSE Z=3
END IF
PRINT (X,Y,Z)
STOP

解题

开始测试

  • 语句覆盖
    • [(A = 6, B = 11, c = 16), (x = 10, y = 20, z = 30)] Sabolegh
  • 判定覆盖
    • I [(A = 6, B = 11, c = 16), (x = 10, y = 20, z = 30)] Sabolegh
    • II [(A = 5, B = 10, c = 15), (x = 1, y = 2, z = 3)] Sabolegh
  • 条件覆盖
  • 判定,条件覆盖
  • 条件组合覆盖
    • I [(A = 6, B = 11, c = 16), (x = 10, y = 20, z = 30)] Sabolegh
    • II [(A = 5, B = 10, c = 15), (x = 1, y = 2, z = 3)] Sabolegh
  • 路径覆盖

软件工程第五次作业_第1张图片

  • A > 5, B > 10, C > 15

    • [(A = 6, B = 11, C = 16),(X = 10, Y = 20, Z = 30)] Sabolegh
  • A <= 5, B > 10, C > 15

    • [(A = 5, B = 11, C = 16),(X = 1, Y = 20, Z = 30)] Sabolegh
  • A > 5, B <= 10, C > 15

    • [(A = 6, B = 11, C = 16),(X = 10, Y = 2, Z = 30)] Sabolegh
  • A <= 5, B <= 10, C > 15

    • [(A = 5, B = 10, C = 16),(X = 1, Y = 2, Z = 30)] Sabolegh
  • A > 5, B > 10, C <= 15

    • [(A = 6, B = 11, C = 15),(X = 10, Y = 20, Z = 3)] Sabolegh
  • A > 5, B <= 10, C <= 15

    • [(A = 6, B = 10, C = 15),(X = 10, Y = 2, Z = 3)] Sabolegh
  • A <= 5, B > 10, C <= 15

    • [(A = 5, B = 11, C = 15),(X = 1, Y = 20, Z = 3)] Sabolegh

A <= 5, B <= 10, C <= 15
* [(A = 5, B = 11, C = 15),(X = 1, Y = 2, Z = 3)] Sabolegh

你可能感兴趣的:(软件工程,软件测试,软件工程第五次作业)