Thanks:  0
Likes:  0
Dislikes:  0

# Thread: Statement Coverage calculation though flow diagram

1. ## Statement Coverage calculation though flow diagram

Can anybody explain the approach for solving the following istqb foundation level question:
If you are flying with an economy ticket, there is a possibility that you may get upgraded to business class, especially if you hold a gold card in the airline's frequent flier program. If you don't hold a gold card, there is a possibility that you will get 'bumped' off the flight if it is full and you check in late. This is shown in Figure 4.5. Note that each box (i.e. statement) has been numbered.
Three tests have been run:
Test 2: Non-gold card holder who stays in economy Test 3: A person who is bumped from the flight What is the statement coverage of these three tests?
a. 60%
b. 70%
c. 80%
d. 90%

In my opinion, it should be 60% (as there are 5 paths, and test cases given in the question cover 3 so the 3/5*100=60%)but the answer is c.
It would be great if somebody can explain the approach to solve the question..........

2. ## Re: Statement Coverage calculation though flow diagram

PFA the flow diagram

3. ## Re: Statement Coverage calculation though flow diagram

[ QUOTE ]
In my opinion, it should be 60% (as there are 5 paths, and test cases given in the question cover 3 so the 3/5*100=60%)

[/ QUOTE ]
It appears that the question is asking for the "statement coverage", but you answered about the "path coverage".

Do you know the difference between statement and path coverage?

4. ## Re: Statement Coverage calculation though flow diagram

As far as i know , the statement coverage means considering how many statements get executed through the test cases.
In the flow diagram, there are 5 statements and in the given test cases only 3 get executed so the statement coverage turns out to be 60%.
Please correct me if i m wrong...........

5. ## Re: Statement Coverage calculation though flow diagram

Hey!!!!!!!!! You are right... i found the path coverage..
Got the difference now....

here total statements are 10 and statments executed are 8 thats why 80%...

6. ## Re: Statement Coverage calculation though flow diagram

Terrific!

It was tricky, since the question used a flow chart and not actual code statements. The key, I think was this part of the question:
"Note that each box (i.e. statement) has been numbered."

That implies that each of the 10 numbered boxes in the control flow diagram is supposed to equate to a single statement. Probably not what you would see in real life, but who says these exam questions have any connection to real life?

With all multiple choice exam questions you need to remember to look very hard at the specific words they use.

7. Sorry to revive an old thread but I cant nut this one out, from my udnerstanding I can only get 70%, here is how.
Test 1 executes boxes 2,4
Test2 executes boxes 6,7
Test 3 executes boxes 6,8,10

What am I missing?

8. Not a very good question in my opinion. Because there isn't a converging set of branches, the branch coverage, statement coverage, and data flow coverage will always be the same.

9. Originally Posted by df88
Sorry to revive an old thread but I cant nut this one out, from my udnerstanding I can only get 70%, here is how.
Test 1 executes boxes 2,4
Test2 executes boxes 6,7
Test 3 executes boxes 6,8,10

What am I missing?
Bumppp can anyone help?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.