Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CS3347 Software Engineering Principles & Practice

Software Testing

Semester B 2021/22


1 .    Software verification & validation process .

a .   What is Software Verification?

b .   What is Software Validation?

 

3 .    What are thefour types of testing in the Software Testing process?

 

4 .   White box testing .

Consider the following code segment,

a .   draw the flow graph

b .   compute the cyclomatic complexity of the graph

c .    identify all independent paths based on the basis path testing

d .   derive the test cases from each of the independent paths; show clearly the input and expected output

 

L1

L2

L3

L4

L5

L6

L7

L8

L9

L10

L11

L12

L13

L14

unsigned int a, b, tmp, gcd;

cin >> a >> b;

if (a == 0)

gcd = b;

else {

tmp = b;

gcd = a;

while (tmp != 0)

if (gcd > tmp)

gcd = gcd tmp;

else

tmp = tmp gcd;

}

cout << " GCD = " << gcd << endl;

 

5 .    Black box testing .

A function string TrainFare(int age)takes in an age and returns the type of fare to be paid . The train fare to be paid depends on the age of the passenger . For passengers below 12 and at 65 or above, they pay "concessionaryfare" and children below 3 arefree . All others pay "regular" fare .    Use equivalence partitioning to

a .   define appropriate classes of test cases

b .   derive at least 1 test case for each class of a .; show the input and expected output;

c .    apply boundary value analysis to derive the test cases