Reference no: EM133516695
Case Study:
Consider the following program:
Input A, B // A and B are real variables
A = A - B
C = A * 2
Output C // C is a real variable
Assume that there are only four feasible arithmetic operators, namely, + (addition), - (subtraction), *(multiplication) and / (division).
You are required to adopt the testing objective of detecting ANY possible incorrect use of
arithmetic operators in this program.
The above program contains two arithmetic operators, namely, "-" in the statement of "A = A
- B" and "*" in the statement of "C = A * 2". By "ANY possible incorrect use of arithmetic
operators", it means that "-" is incorrect, or "*" is incorrect, or both "-" and "*" are incorrect
Requirement - to improve understanding of the test activities as well as how to generate test cases with reference to the code of the program under test.
Question 1: Explain and show all details on how to design the test cases for the above testing objective.
Question 2: Suppose you use test case (A=8, B=2) to test the above program. Is this test case able to achieve the required testing objective? Provide your answer with justifications.
Question 3: Based on your design in Task 1, what is (or are) the concrete test case (or cases) that can achieve the above testing objective? Explain and justify your concrete test case (or cases).
Question 4: Given B=8, find all possible values of A so that the concrete test cases (A,B) cannot achieve the above testing objective? Explain and justify the correctness of your solution.
B. and develop a program to find them automatically, or prove the exhaustiveness of test cases