Docsity

Lecture Notes on Logic Coverage Exercise | CEN 5035, Study notes of Software Engineering

Partial preview of the text

Download Lecture Notes on Logic Coverage Exercise | CEN 5035 and more Study notes Software Engineering in PDF only on Docsity!

Logic Coverage Exercise

if (A>0) OR (B<0) then

A := A+

end_if

B := A+B

end_if

Logic Coverage Exercise (a)

if (A>0) OR (B<0) then

A := A+

end_if

B := A+B

end_if

Path condition for

Logic Coverage Exercise (a)

Path condition for

: [(A>0) V (B<0)]

if (A>0) OR (B<0) then

A := A+

end_if

B := A+B

end_if

Logic Coverage Exercise (a)

Path condition for

: [(A>0) V (B<0)]

if (A>0) OR (B<0) then

A := A+

end_if

B := A+B

end_if

Logic Coverage Exercise (a)

if (A>0) OR (B<0) then

A := A+

end_if

B := A+B

end_if

Path condition for

Logic Coverage Exercise (a)

Path condition for

if (A>0) OR (B<0) then

A := A+

end_if

B := A+B

end_if

Logic Coverage Exercise (a)

Path condition for

:^

(A≤0)

(B≥0)

if (A>0) OR (B<0) then

A := A+

end_if

B := A+B

end_if

Logic Coverage Exercise (a)

Path condition for

:^

(A≤0)

(B≥0)

(A+B>0)

(AB<0)

if (A>0) OR (B<0) then

A := A+

end_if

B := A+B

end_if

Logic Coverage Exercise (b)

if (A>0) OR (B<0) then

A := A+

end_if

B := A+B

end_if

test case 1: A=1, B=

statementbranchcondition comp. cond. path

Logic Coverage Exercise (b)

if (A>0) OR (B<0) then

A := A+

end_if

B := A+B

end_if

test case 1: A=1, B=

T^

F^

statementbranchcondition comp. cond. path

Logic Coverage Exercise (b)

if (A>0) OR (B<0) then

A := A+

end_if

B := A+B

end_if

test case 1: A=1, B=

T^

F

T^

F

statementbranchcondition comp. cond. path

Logic Coverage Exercise (b)

if (A>0) OR (B<0) then

A := A+

end_if

B := A+B

end_if

test case 1: A=1, B=

T^

F

T^

F

statementbranchcondition comp. cond. path

Logic Coverage Exercise (b)

test case 1: A=1, B=3 test case 2: A=-1, B=-

statementbranchcondition comp. cond. path

if (A>0) OR (B<0) then

A := A+

end_if

B := A+B

end_if

T,

F

F,

T

T^

F

Logic Coverage Exercise (b)

test case 1: A=1, B=3 test case 2: A=-1, B=-

statementbranchcondition comp. cond. path

if (A>0) OR (B<0) then

A := A+

end_if

B := A+B

end_if

T,

F

F,

T

T,

F

F,

T