Can u any 1 please explain the below question and answer?
Given the following code, which statement is true about the
minimum number of test cases required for full statement and
branch coverage?

Read p
Read q
IF p q > 100 THEN
Print "Large"
ENDIF
IF p > 50 THEN
Print "p Large"
ENDIF

a) 1 test for statement coverage, 3 for branch coverage
b) 1 test for statement coverage, 2 for branch coverage
c) 1 test for statement coverage, 1 for branch coverage
d) 2 tests for statement coverage, 2 for branch coverage

Answer Posted / suyash

The answer is B.
Statement Coverage (SC):
To calculate Statement Coverage, find out the shortest
number of paths following
which all the nodes will be covered. Here by traversing
through path 1A-2C-3D-E-4G-5H all
the nodes are covered. So by traveling through only one path
all the nodes 12345 are covered,
so the Statement coverage in this case is 1.
Branch Coverage (BC):
To calculate Branch Coverage, find out the minimum number of
paths which will
ensure covering of all the edges. In this case there is no
single path which will ensure coverage
of all the edges at one go. By following paths
1A-2C-3D-E-4G-5H, maximum numbers of
edges (A, C, D, E, G and H) are covered but edges B and F
are left. To covers these edges we can follow 1A-2B-E-4F. By
the combining the above two paths we can ensure of traveling
through all the paths. Hence Branch Coverage is 2. The aim
is to cover all possible true/false
decisions.

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define brain stromming?

634


test cases on bangles???

2539


What is the difference between system testing and integration testing?

636


What is quality center? How many built in tables does quality center have?

796


what is the diff. bw separate database testers and manual testers with sql knowledge guys... iam confusing so much ,,in cmpny database testers are not working on manual..? both positions are same are not? explian clesly with example? thank u

1714






What is data flow diagram?

662


What are joins and subjoins in the data bases what is data driven testing what is verification and validation What is Quality Assurance (QA) and Quality Control (QC) Is Verification is related to QA and Validation is related to QC ? which type of model you follow basically in your project what is a use case How to test a Bike how to test a Lift (Elevator). which configuration Management tool do you use which Bug tracking tool do you use explain Bug life cycle what is Regression testing what is ALPHA testing ans BETA testing What types of testings comes under Non functional testing what is TEST DIRECTOR what is CMM and CMM i whar are Expressions in Winrunner What is a Compile module Is it Necessary to open the tool first or the application first after getting a bug what will you do if you add a new object or a new module for the existing application then how will you test the application which Defect tracking tool do you use what is change management What is smoke Testing what is sanity testing A application is given to you but the requirements and functionalities are missing what will you do to start the testing which testing documents will be received by the client

1915


Am putting E-commerce project in my resume can any one please tell me about E-commerce application explaination..

2430


hi friends .......... from srs to signoff what r the tests the testing team will conduct either sequentially or parallel pls advice thanks in advance

1450


1.Enlist the types of testing performed for any window in sequence? 2.Use of edit_get_list function 3.Accuracy & Precision

1689


what r the 5 major defects that u found in ur shopping related project?

1415


What is formal testing?

670


How much the bug is affecting the functionality of the application?

634


write test case for linked in sign up page ?

1888


Can you explain the various elements of function points ftr, ilf, eif, ei, eo, eq, and gsc?

766