Logic Coverage Exercise - Software Engineering | CEN 5035, Assignments of Software Engineering

Material Type: Assignment; Class: SOFTWARE ENGINEERING; Subject: COMPUTER SOFTWARE ENGINEERING; University: University of Florida; Term: Unknown 1989;

Typology: Assignments

Pre 2010

Uploaded on 09/17/2009

koofers-user-syi
koofers-user-syi 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Logic Coverage Exercise
(Note: this optional homework assignment will not be graded. Solutions will
be posted separately.)
Consider the pseudocode program and associated control flow graph below.
1. input( A,B)
if (A>0) OR ( B<0) then
2. A : = A+5
end_if
3. if ( A+B>0) AND ( A* B<0) then
4. B : = A+B
end_if
5. output( A,B)
1
2
3
4
5
a. Give path conditions in terms of the input values for A and B for program
paths <1,2,3,5> and <1,3,4,5>.
b. Consider a set of test cases with the following input values for A and B:
test case 1: A=1, B=3
test case 2: A=-1, B=-5
Which of the following logic coverage criteria would be satisfied by these
cases? (Circle all that apply)
statement branch condition compound condition path
c. Suppose the following two additional test cases are added to the set:
test case 3: A=3, B=-1
test case 4: A=0, B=0
Which of the following logic coverage criteria would be satisfied by all 4
cases? (Circle all that apply)
statement branch condition compound condition path

Partial preview of the text

Download Logic Coverage Exercise - Software Engineering | CEN 5035 and more Assignments Software Engineering in PDF only on Docsity!

Logic Coverage Exercise (Note: this optional homework assignment will not be graded. Solutions will be posted separately.) Consider the pseudocode program and associated control flow graph below.

  1. input(A,B) if (A>0) OR (B<0) then
  2. A : = A+ end_ if
  3. if (A+B>0) AND (A* B<0) then
  4. B : = A+B end_ if
  5. output(A,B) 1 2 3 4 5 a. Give path conditions in terms of the input values for A and B for program paths <1,2,3,5> and <1,3,4,5>. b. Consider a set of test cases with the following input values for A and B: test case 1: A=1, B= test case 2: A=-1, B=- Which of the following logic coverage criteria would be satisfied by these cases? (Circle all that apply) statement branch condition compound condition path c. Suppose the following two additional test cases are added to the set: test case 3: A=3, B=- test case 4: A=0, B= Which of the following logic coverage criteria would be satisfied by all 4 cases? (Circle all that apply) statement branch condition compound condition path