Question: Given the actual code: if x 1 Code 2: x < 0 Code 3: x < 1 Code 4: x >= 0 Generate test cases

  1. Given the actual code:

if x <= 1 :

print(x) else:

print(x+1)

  1. Can the generated the test cases (T1: x =-1, T2: x =4) reveal the following faults? Show the expected and actual output for each test case. Indicate the test case that detects the fault.
    1. Code 1: x > 1
    2. Code 2: x < 0
    3. Code 3: x < 1
    4. Code 4: x >= 0
  2. Generate test cases based on the boundary values of the equivalence class: x < 1. You should have 3

test cases.

Can the test cases you came up with using boundary value analysis reveal the four faults in part a? Show the expected and actual output for each test case. Indicate the test case that detects the fault.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!