Challenge

Project 2 - V&V SW Analysis II

poovarasankumar

chennnai offline batch01

  1. Let A, B,C, D be atomic conditions , write MCDC Pairs for

A && B || C

A || B && C

(A && B) || (C && D)

(A || B) && (C || D)

ANSWER:

A && B || C

Atomic conditions: 3(A,B,C) MCDC pairs:(0,1,1)(1,1,1)(1,0,1)(1,1,0)-4 pairs

A B C

A&&B||C

0 1 1 1
1 1 1 1
1 0 1 1
1 1 0 1

A || B && C

Atomic conditions: 3(A,B,C) MCDC pairs:(0,0,1)(1,0,1)(0,1,1)(1,1,0)

A B C

A||B&&C

0 0 1 0
1 0 1 1
0 1 1 1
1 1 0 0

(A && B) || (C && D)

Atomic conditions: 4(A,B,C,D) MCDC pairs:(0,1,0,1)(1,1,0,1)(1,0,0,1)(0,1,1,1)(0,1,1,0)

A B C D (A&&B)||(C&&D)
0 1 0 1 0
1 1 0 1 1
1 0 0 1 0
0 1 1 1 1
0 1 1 0 0

(A || B) && (C || D)

Atomic conditions: 4(A,B,C,D) MCDC pairs:(0,1,0,1)(1,1,0,1)(1,0,0,1)(0,1,1,1)(0,1,1,0)

A B C D (A||B)&&(C||D)
0 1 0 1 1
1 1 0 1 1
1 0 0 1 1
0 1 1 1 1
0 1 1 0 1
  1. Write Boundary classes and Equivalence classes for

*unsigned int a > 40 ; or (unsigned int a greater than 40);

ANSWER:

Boundary classes:41>a>65535(if loop)

a=40(else loop)

0>a>39(else loop)

range of varaible:0-65535

lower limit:0

upper limit:65535

a=41,40,39(equivalence class)

*signed int b > -10 ; or (signed int b greater than -10);

ANSWER:

Boundary classes:-11>b>32767(if loop)

b=-10(else loop)

0>b>-9(else loop)

b=-11,-10,-9(equivalance class)

lower limit:-32768

upper limit:32767

*unsigned int16 c >= 65534 ;or (unsigned int16 c greter than or equal to 65534);

ANSWER:

Boundary classes:65535>c>65535(if loop)

c=65535(if loop)

0>c>65535(else loop)

lower limit:0

upper limit:65535

c=65535,65534,65533(equivalance class)

*unsigned int32 d == 4294967294; or (unsigned int32 d equals to equal 4294967294);

ANSWER:

Boundary classes:d=4294967294(if loop)

0<d<4294967293(else loop)

lower limit:0

upper limit: 4294967295

d=4294967294,4294967295,4294967293(boundary class)

  1. Derive Test cases for following code using CFT and MCDC

if( A&& B) {

Statement 1; }

else if ( C ) {

Statement 2 ; }

else {

Statement 3 ; }

ANSWER:

MCDC :test cases

A&&B

A B A&&B

0 1 0

1 0 0

1 1 1

the above test cases to print statement 1(if condition is true)

statement 2(condition false)

statement 3 (condition false)

CFL:

test cases:(0,1)(1,0)(1,1)

A&&B(condition is true the statement 1 is print)

A&&B(condition is false statement 2 )

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.