Question: Given the actual code: if x 1 Code 2: x < 0 Code 3: x < 1 Code 4: x >= 0 Generate test cases
- Given the actual code:
if x <= 1 :
print(x) else:
print(x+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.
- Code 1: x > 1
- Code 2: x < 0
- Code 3: x < 1
- Code 4: x >= 0
- 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
Get step-by-step solutions from verified subject matter experts
