Question

1) 2) 3) integer A, B; input (A): while (A> 0) 5) A=2*A; 6) i (A < 20 or A> 30) 7) 8) 9) 10 lse B-A 2, 12) B-A 2 13) 14) output (A, B): 15) input (A): 16) end;

0 0
Add a comment Improve this question Transcribed image text
Answer #1


Decision coverage:

Given code is

integer A,B;
input(A);
while(A>0)
{
A=2*A;
if(A<20 or A>30)
{
b=A+2;
}
else{
B=A+2;
}
output(A,B);
input(A);
}
end;

Decision coverage = (number of decision outcomes executed )/total outcomes *100

Based on the flowchart The decision coverage is 71 %

Flowchart:

No c NO 5 G es It top

In order to get 100 % coverage the below are the testcases to include.

Testcase 1: A=22 and B =10
Testcase 2: A=15 and B=5

These two test cases are for both positive and negative cases which covers 100 % decision.

Add a comment
Know the answer?
Add Answer to:
1) 2) 3) integer A, B; input (A): while (A> 0) 5) A=2*A; 6) i (A...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT