Question

In: Computer Science

Given a module which implements the function Z= F(X, Y), defined as follows:          X +...

Given a module which implements the function Z= F(X, Y), defined as follows:

         X + Y when 10<=X<=20, and 12<=Y<=30

Z =    X - Y when 0<=X<10, and 0<=Y<12      

          0 under other conditions

          where X and Y are integer parameters for F.

1. Identify the equivalence classes in [X, Y].

2. List your test cases in [X, Y] based on your equivalence class analysis.

Solutions

Expert Solution

Answer 1:
Equivalence class is a subset which include all the elements equivalent to each other i.e. any element from that subset will give the same result. There are following equivalent classes in [X,Y]:
a. X<0;
  Y Z (X is any negative integer, Y belongs to any integer) result will be 0
Note, Z is the notation for integers
b. X [ 0, 10);
  Y [ 0, 12 ) (X is any integer greater than equal to 0 and less than 10, Y belongs to any integer greater than equal to 0 and less than 12) result will be (X-Y)
c. X [ 0, 10);
  Y Z except [ 0, 12 ) (X is any integer greater than equal to 0 and less than 10, Y belongs to any integer less than 0 or greater than equal to 12) result will be 0
d. X [ 10, 20];
  Y [ 12, 30 ] (X is any integer greater than equal to 10 and less than equal to 20, Y belongs to any integer greater than equal to 12 and less than equal to 30) result will be (X+Y)
e. X [ 10, 20];
Y Z except [ 12, 30 ] (X is any integer greater than equal to 10 and less than equal to 20, Y belongs to any integer less than 12 or greater than 30) result will be 0
f. X > 20;
Y Z (X is any integer greater than 20, Y belongs to any integer) result will be 0

Answer 2:
Test cases in [X, Y] will include one element from each class defined above. Therefore, there will be following 6 test cases: (there are multiple answers possible to this question)
1.  [X,Y] = [-2, 30] ...
2.  [X,Y] = [3, 9] ...
3.  [X,Y] = [3, 12] ...
4.  [X,Y] = [10, 12] ...
5.  [X,Y] = [12, 8] ...
6.  [X,Y] = [30, -6] OR  [30, 60] ....


Related Solutions

5) Let the function f : ℝ3 → ℝ3 be given by f(x, y, z) =...
5) Let the function f : ℝ3 → ℝ3 be given by f(x, y, z) = (2x + 2y, 2y + 2z, z + x). a) Prove that f is one to one and onto b) Find the inverse of f, i.e., f−1.
Given function f(x,y,z)=x^(2)+2*y^(2)+z^(2), subject to two constraints x+y+z=6 and x-2*y+z=0. find the extreme value of f(x,y,z)...
Given function f(x,y,z)=x^(2)+2*y^(2)+z^(2), subject to two constraints x+y+z=6 and x-2*y+z=0. find the extreme value of f(x,y,z) and determine whether it is maximum of minimum.
Consider the following function: f (x , y , z ) = x 2 + y...
Consider the following function: f (x , y , z ) = x 2 + y 2 + z 2 − x y − y z + x + z (a) This function has one critical point. Find it. (b) Compute the Hessian of f , and use it to determine whether the critical point is a local man, local min, or neither? (c) Is the critical point a global max, global min, or neither? Justify your answer.
Prove or disprove whether the function f: Z x Z -> Z x Z given by...
Prove or disprove whether the function f: Z x Z -> Z x Z given by f(x,y) = (2x+y, 3x-6y) is injective, surjective or both.
The joint density function for random variables X, Y, and Z is f(x, y, z)= Cxyz  if...
The joint density function for random variables X, Y, and Z is f(x, y, z)= Cxyz  if 0 ≤ x ≤ 1, 0 ≤ y ≤ 2, 0 ≤ z ≤ 2, and f(x, y, z) = 0 otherwise. (a) Find the value of the constant C. (b) Find P(X ≤ 1, Y ≤ 1, Z ≤ 1). (c) Find P(X + Y + Z ≤ 1).
Describe the level surfaces for the 3-variable function: f(x,y,z) = z/(x-y)
Describe the level surfaces for the 3-variable function: f(x,y,z) = z/(x-y)
The following logic function is given as a sum of minterms F(W,X,Y,Z) = ∑W,X,Y,Z(7,8,10,11,13) + D(5,...
The following logic function is given as a sum of minterms F(W,X,Y,Z) = ∑W,X,Y,Z(7,8,10,11,13) + D(5, 9, 15). (25 points) a) Draw the K-Map and find the minimal sum-of-products expression for this function. b) Draw the circuit implementing this expression c) Give all input pair or pairs where transition between them would create a timing hazard d) Draw the timing diagram showing the glitch corresponding to the pair or one of the pairs. Assume ALL gate delays are equal e)...
The curried version of let f (x,y,z) = (x,(y,z)) is let f (x,(y,z)) = (x,(y,z)) Just...
The curried version of let f (x,y,z) = (x,(y,z)) is let f (x,(y,z)) = (x,(y,z)) Just f (because f is already curried) let f x y z = (x,(y,z)) let f x y z = x (y z)
Find the maximum and minimum of the function f(x, y, z) = (x^2)(y^2)z in the region...
Find the maximum and minimum of the function f(x, y, z) = (x^2)(y^2)z in the region D = {(x, y, z)|x^2 + 2y^2 + 3z^2 ≤ 1}.
Compute the derivative of the given vector field F. Evaluate the line integral of F(x,y,z) = (y+z+yz , x+z+xz , x+y+xy )
Compute the derivative of the given vector field F. Evaluate the line integral of F(x,y,z) = (y+z+yz , x+z+xz , x+y+xy )over the path C consisting of line segments joining (1,1,1) to (1,1,2), (1, 1, 2) to (1, 3, 2), and (1, 3, 2) to (4, 3, 2) in 3 different ways, along the given path, along the line from (1,1,1) to (4,3,2), and finally by finding an anti-derivative, f, for F.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT