Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi this is a question from a module I am taking called software engineering. 1.

ID: 3729122 • Letter: H

Question

Hi this is a question from a module I am taking called software engineering.
1. A program computes its output variable T according to the following formula: T = W*0.1 + X*0.2+ Y*0.3 + Z*0.4 W 2 50 and X 2 50 and Y 2 50 and Z 2 50 = W*0.4 + X*0.34 Y*0.2 + Z*0.1 The input variables of this program are W, X, Y and Z. All of them are non-negative values. Calculate the following: Otherwise i When we apply equivalence class testing technique to design a test suite to test the above-mentioned program a) the number of equivalence classes for W b) the number of equivalence classes for the program c) the number of invalid test cases (test cases with invalid input values) in the test suite i) When we apply boundary value testing technique to design a test suite to test the above-mentioned program, a) the number of boundary values for W b) the number of boundary values for the program e) the number of valid test cases (test cases with valid input values) in the test suite (40 marks)

Explanation / Answer

In Equivalence class testing, the input data is divided into equivalent data, from which test case can be derived.

It contains valid and invalid equivalence classes. For the above program

I) a. Number of equivalence for W variable is:

Valid equivalence class:

T1=> w: w>=50 ( value of W should be greater than 49)

T2=> w: 0<=w<50 ( value of W should in the range 0 to 49 inclusive)

Invalid equivalence class:

T3=> w:w<0 ( value of W is negative)

In total there are 3 equivalence classes for W variable

b) Equivalence classes for program:

As mentioned above for W 3 classes

Like that for X, Y and Z variable there are three classes for each variable.

For X:

T4=> x: x>=50 ( value of X should be greater than 49)

T5=> x: 0<=X<50 ( value of X should in the range 0 to 49 inclusive)

Invalid equivalence class:

T6=> x:x<0 ( value of X is negative)

In total there are 3 equivalence classes for X variable

For Y:

T7=> y:y>=50 ( value of Y should be greater than 49)

T8=> y: 0<=y<50 ( value of Y should in the range 0 to 49 inclusive)

Invalid equivalence class:

T9=> y:y<0 ( value of Y is negative)

In total there are 3 equivalence classes for Y variable

For Z:

T10=> z:z>=50 ( value of Z should be greater than 49)

T11=> z:0<=z<50 ( value of Z should in the range 0 to 49 inclusive)

Invalid equivalence class:

T12=> z:z<0 ( value of Z is negative)

In total there are 3 equivalence classes for Z variable

Therefore there are 12 equivalence classes for the program

c) As mentioned in the previous part one invalid equivalence class for each variable, there are 4 invalid equivalence classes in the program. Therefore 4 invalid cases should be there in the test suite.

ii) Boundary value testing includes testing on boundary values of the input variables in the program. It is similar to equivalence class partition but focuses on corner(boundary) values.

a) Number of boundary values for W:

Valid classes(w>=50, 0=<w<50)

T1=> w=0

T2=> w=49

T3=> w=50

Invalid class:

T4=> w< 0( consider w less than zero)

b) boundary values for the program:

Like that for variable X, Y, and Z there will be 4 test cases.

For X:

T1=> x =0

T2=> x =49

T3=> x =50

T4=> x<0( consider x less than zero)

For y:

T1=> y=0

T2=> y=49

T3=> y=50

Invalid class:

T4=> y< 0( consider y less than zero)

For Z:

T1=> z=0

T2=> z=49

T3=> z=50

Invalid class:

T4=> z< 0( consider z less than zero)

Thus there are 16 boundary values in the program.

c) For each input variable W,X,Y and Z there are 3 valid input boundary values for each variable as mentioned in the above part. Thus there are in total 3*4=12 test cases that are for the valid inputs in the program.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote