Quality Testing

Quality is delighting customers

how do we determine the statement coverage,decision coverage..

15) Consider the following:Pick up and read the newspaper Look at what is on television If there is a program that you are interested in watching then switch the the television on and watch the program Otherwise Continue reading the newspaper

 

If there is a crossword in the newspaper then try and complete the crossword

http://www.9th-direction.com Ohmkumar

a) SC = 1 and DC = 1

b) SC = 1 and DC = 2

) SC = 1 and DC = 3

d) SC = 2 and DC = 2

e) SC = 2 and DC = 3

Views: 7837

Reply to This

Replies to This Discussion

Answer is

e) SC = 2 and DC = 3

Statement coverage :In this case test case is executed so that every statement are covered atleast once.

Desicision Coverage:In this case test case is executed so that all decisions(T/F) are executed atleast once.

I hope you know nodes and edges.Please check

ajoysingha.info/.../Branch%20Statement%20Path%20Coverage.pdf -

It gives with example.

Now in this case we can put a flow shart

                                              A                     B                                C             D

                      Read newspaper-look at TV page-If program interested-(Yes)-on TV-Watch program

                                                                                        E                      F                        G

                                                                                 (No)-Continue reading-If puzzle found-(yes)-try and complete

                                                                                                                               H  

 

                                                                                                                          (No)-Continue reading.

Let us find the paths to cover all statements once

1.ABCD

2.ABEFGH

For decision coverage

1.ABCD

2.ABEFGH

3.ABEFH(Since in second If statement we take the path that says No).This is not necessary to cover in statement coverage.Because already that statement is covered by going through the previous path.

So answer is SC=2:DC=3.

I hope you can understand.If you draw this like flowchart then you will get a clear idea.

Anu.

Thank You friends

 

Excellently describe answer.. Anuradha

Thanks

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2020   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service