Q. How many test cases are necessary to cover all the possible sequences of statements (paths) for the following program fragment? Assume that the two conditions are independent of each other:
if (Condition 1)
then statement 1
else statement 2
fi
if (Condition 2)
then statement 3
fi
A. 2 Test Cases
B. 3 Test Cases
C. 4 Test Cases
D. Not achievable
Answer:-A
Q: Given the following:
Switch PC on
Start "outlook"
IF outlook appears THEN
Send an email
Close outlook
A. 1 test for statement coverage, 1 for branch coverage
B. 1 test for statement coverage, 2 for branch coverage
C. 1 test for statement coverage. 3 for branch coverage
D. 2 tests for statement coverage, 2 for branch coverage
E. 2 tests for statement coverage, 3 for branch coverage
Answer:-B
Q. IF A > B THEN
C = A – B
ELSE
C = A + B
ENDIF
Read D
IF C = D Then
Print "Error"
ENDIF
A. 1 test for statement coverage, 3 for branch coverage
B. 2 tests for statement coverage, 2 for branch coverage
C. 2 tests for statement coverage. 3 for branch coverage
D. 3 tests for statement coverage, 3 for branch coverage
E. 3 tests for statement coverage, 2 for branch coverage
Answer:-B
Q: 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
A. SC = 1 and DC = 1
B. SC = 1 and DC = 2
C. SC = 1 and DC = 3
D. SC = 2 and DC = 2
E. SC = 2 and DC = 3
Answer:-E
Q: Given the following code, which 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, 3 for branch coverage
E. 2 tests for statement coverage, 2 for branch coverage
Answer:-B
Q:Disc = 0
Order-qty = 0
Read Order-qty
If Order-qty >=20 then
Disc = 0.05
If Order-qty >=100 then
Disc =0.1
End if
End if
A. Statement coverage is 4
B. Statement coverage is 1
C. Statement coverage is 3
D. Statement Coverage is 2
Answer:-B
Q. What is the smallest number of test cases required to Provide 100% branch coverage?
If(x>y) x=x+1;
else y=y+1;
while(x>y)
{
y=x*y; x=x+1;
}
A. 1
B. 2
C. 3
D. 4
Answer:-B
Q: If the pseudo code below were a programming language ,how many tests are required to achieve 100% statement coverage?
1. If x=3 then
2. Display_messageX;
3. If y=2 then
4. Display_messageY;
5. Else
6. Display_messageZ;
7. Else
8. Display_messageZ;
A. 1
B. 2
C. 3
D. 4
Answer:-C
Q:Using the same code example as question 17,how many tests are required to achieve 100% branch/decision coverage?
A. 1
B. 2
C. 3
D. 4
Answer:-C
Q: This part of a program is given:
WHILE (condition A) Do B
END WHILE
How many decisions should be tested in this code in order to achieve 100% decision coverage?
A. 2
B. Indefinite
C. 1
D. 4
Answer:-A
Q.: Analyze the following highly simplified procedure:
Ask: "What type of ticket do you require, single or return?"
IF the customer wants ‘return’
Ask: "What rate, Standard or Cheap-day?"
IF the customer replies ‘Cheap-day’
Say: "That will be £11:20"
ELSE
Say: "That will be £19:50"
ENDIF
ELSE
Say: "That will be £9:75"
ENDIF
Now decide the minimum number of tests that are needed to ensure that all the questions have been asked, all combinations have occurred and all replies given.
A. 3
B. 4
C. 5
D. 6
Answer:-A
Q: For the following piece of code, how many test cases are needed to get 100% statement coverage?
Procedure X
Read (Color) // Input color from user
IF (Color == “Red”) THEN
Call Roses(Color)
ELSEIF (Color == “Blue”) THEN
Call Violets(Color)
ELSE
PRINT “User is no Shakespeare”
SaveToDatabase(Color)
End Procedure X
A. 5
B. 3
C. 1
D. 2
Answer:-B
Hi can anyone explain how these answers are right for better understanding.
ReplyDeletethanks
on which question you need help?
DeleteQ: If the pseudo code below were a programming language ,how many tests are required to achieve 100% statement coverage?
Delete1. If x=3 then
2. Display_messageX;
3. If y=2 then
4. Display_messageY;
5. Else
6. Display_messageZ;
7. Else
8. Display_messageZ;
A. 1
B. 2
C. 3
D. 4
plz explain it ...
Answer:-C
This comment has been removed by the author.
ReplyDeleteCan anyone please explain for 1st question ans is A
ReplyDeleteI think the ans is C
Q. How many test cases are necessary to cover all the possible sequences of statements (paths) for the following program fragment? Assume that the two conditions are independent of each other:
if (Condition 1)
then statement 1
else statement 2
fi
if (Condition 2)
then statement 3
fi
A. 2 Test Cases
B. 3 Test Cases
C. 4 Test Cases
D. Not achievable
Answer:-A
Yes, that's right. The answer should be C i.e. 4 test cases:
DeleteTC1: condition1=T, condition2=T
TC2: condition1=F, condition2=T
TC3: condition1=T, condition2=F
TC4: condition1=F, condition2=F
Assume the program like this –
DeleteIf the age is greater than 60 years
Then provide 25% senior citizen discount (Statement 1)
Else no discount (Statement 2)
If the age is less than 5 years
Then provide special seat (Statement 3)
These are two independent code snippets. How many test cases do you require to cover the above statements? If you carefully choose to minimize the number of test cases, then 2 test cases would be enough. However, if it were an actual test scenario we will have more tests.
What are those 2 test cases?
1. Input age more than 60 (say 65 years). Covers statement 1.
2. Input age less than 5 (say 4 years). Covers statement 2 and statement 3.
Learn to draw flow diagrams, then solving will be easy! Happy learning! :)
ReplyDeleteplease tell me how to calculate statement and decision coverage. provide any files which will help.
Deletecould you please explain
ReplyDeleteQ: This part of a program is given:
WHILE (condition A) Do B
END WHILE
How many decisions should be tested in this code in order to achieve 100% decision coverage?
thank you
I also have same doubt..plz help
DeleteCorrect answer is 2 because there are two possible value "True"&"False" for Condition A:
Delete1) condition A == True
2) condition A == False
Hi,
ReplyDeleteWhen I was studying for ISTQB...
There was no site in which consist of only number of examples with branch and statement coverage...
so, I gathered all the examples and put them together. So, that anyone who is preparing for ISTQB...can get it!
Thanks
Vrushali...
could you pls send the gathered docs to mailid ; kcholetti@gmail.com
DeleteHi , Can you plz send the gathered docs to me as well (Poonam ) ; dulletpoonam@gamil.com
Deletesorry ,it is...dulletpoonam@gmail.com.
DeleteHi, can u please send me the questions ;
Deleteosbihat@hotmail.com
you did great job
ReplyDeleteHi Vrushali
ReplyDeleteI appreciate you and your blog for a very good initiative.
could you please help me in answering this question :
Given the following code, which is true:
IF A > B THEN
C = A ? B
ELSE
C = A B
ENDIF
Read D
IF C = D Then
Print ?Error?
ENDIF
1 test for statement coverage, 3 for branch coverage
2 tests for statement coverage, 2 for branch coverage
2 tests for statement coverage, 3 for branch coverage
3 tests for statement coverage, 3 for branch coverage
How do you define a testing policy?
ReplyDeleteoracle training in chennai
The following are the important steps used to oracle dba training in chennai define a testing policy in general. But it can change according to your organization. hadoop training in chennai Let's discuss in detail the steps of implementing a testing policy in an organization.
An electronic program guide service downloads TV listing data once setup data has been downloaded either with the digital tuner, or the analog tuner (if present), or an external receiver (if defined): The following tests have been executed for the control flow diagram above:
ReplyDeleteTest1: No setup data could be found, first with the digital tuner, then with the analog tuner, and finally with an external receiver.
Test2: Setup and TV listing data has been downloaded with the digital tuner.
Test3: Setup and TV listing data has been downloaded with the analog tuner.
What is the decision coverage of these three tests?
a. 100%
b. 51%
c. 70%
d. 0%
A
Deletepls ans on above que.
ReplyDeleteI guess the ans is 'a' but not sure
Please ans below ques
ReplyDeleteQ. 2 Which of the following is an objective of a pilot project for the introduction of a testing tool?
A. Evaluate testers’ competence to use the tool.
B. Complete the testing of a key project.
C. Assess whether the benefits will be achieved at reasonable cost.
D. Discover what the requirements for the tool are.
Q. 3 Which of the following is a TYPICAL objective of a pilot project for introducing a testing tool into an organization?
A. To assess whether the benefits will be achieved at a reasonable cost
B. To identify the initial requirements of the tool
C. To select the most suitable tool for the intended purpose
D. To document test design and test execution processes
Q. 4 Which of the following is NOT a goal of a Pilot Project for tool evaluation?
A. To evaluate how the tool fits with existing processes and practices.
B. To determine use, management, storage, and maintenance of the tool and test assets.
C. To assess whether the benefits will be achieved at reasonable cost.
D. To reduce the defect rate in the Pilot Project.
Pick up and read the newspaper
ReplyDeleteLook 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
E. SC = 2 and DC = 3
please give me explanation.
nice.
ReplyDelete.hadoop training in chennai
good.
ReplyDeletewebsphere training in chennai
• Thanku for shariong..
ReplyDeleteInformatica training, in the recent times has acquired a wide scope of popularity amongst the youngsters at the forefront of their career.
sas training in chennai
• Nice Blog It's such a useful information to all
ReplyDeleteqtp training in chennai
Thanks for sharing this informative articles.
ReplyDeleteBest oracle DBA Training In Chennai
This comment has been removed by the author.
ReplyDeleteCan anyone explain?
ReplyDeleteQ: If the pseudo code below were a programming language ,how many tests are required to achieve 100% statement coverage?
1. If x=3 then
2. Display_messageX;
3. If y=2 then
4. Display_messageY;
5. Else
6. Display_messageZ;
7. Else
8. Display_messageZ;
A. 1
B. 2
C. 3
D. 4
and test cacses required for banch coverage too for the same question?
3 tests are required for 100 % statement coverage.
Delete1)if x=3 ,display x
2)if y=3 ,display y
3)if x not equal to 2 or y not equal to 3, display z
Procedure X
ReplyDeleteRead (Color) // Input color from user
IF (Color == “Red”) THEN
Call Roses(Color)
ELSEIF (Color == “Blue”) THEN
Call Violets(Color)
ELSE
PRINT “User is no Shakespeare”
SaveToDatabase(Color)
End Procedure X
Answer is 2 test cases for 100% statement coverage, but how is it 3
1. If x=3 then
ReplyDelete2. Display_messageX;
3. If y=2 then
4. Display_messageY;
5. Else
6. Display_messageZ;
7. Else
8. Display_messageZ;
Can any one explain plzz...
Real Estate Agents in Chennai
ReplyDeleteReal Estate Advisors in India
Real Estate Private Equity in Chennai
Real Estate Research in Chennai
Real Estate Tax Advisor in Chennai
Legal advisor in Chennai
Wonderful post. I am learning so many things from your blog.keep posting.
ReplyDeleteAbinitio Online Training
Hadoop Online Training
Cognos Online Training
I enjoy what you guys are usually up too. This sort of clever work and coverage! Keep up the wonderful works guys I’ve added you guys to my blog roll.
ReplyDeleteBest digital marketing training Institute in chennai
I am really happy with your blog because your article is very unique and powerful for new reader.
ReplyDeleteClick here:
Selenium Training in Chennai | Selenium Training in Bangalore | Selenium Training in Pune | Selenium online Training
Keep following your way of writing, Thanks for sharing an excellent content with us.
ReplyDeleteSelenium Training in Chennai
Selenium Course in Chennai
iOS Training
iOS Course in Chennai
Digital Marketing Course in Chennai
Digital Marketing Training in Chennai
I’ve bookmarked your site, and I’m adding your RSS feeds to my Google account.
ReplyDeletenebosh igc courses in chennai
I am commenting to let you know what a terrific experience my daughter enjoyed reading through your web page. She noticed a wide variety of pieces, with the inclusion of what it is like to have an awesome helping style to have the rest without hassle grasp some grueling matters.
ReplyDeleteBest training in Blockchain in kk nagar chennai |Check Best Training @ Chennai in KK nagar, vadapalani in chennai |Blockchain institute in Chennai | Blockchain
Check Best Software Testing Training institute in KK nagar, Chennai | Software Courses| Real time Projects
Web designing training
DevOps Training
It’s always so sweet and also full of a lot of fun for me personally and my office colleagues to search your blog a minimum of thrice in a week to see the new guidance you have got.
ReplyDeleteDotnet Training in Chennai | Dotnet Training course in Chennai
Android Training in Chennai |Best Android Training course in Chennai
CCNA Training in Chennai | CCNA Training course in Chennai
MCSE Training in Chennai | MCSE Training course in Chennai
Embedded Systems Training in Chennai |Embedded Systems Training course in Chennai
Matlab Training in Chennai | Matlab Training course in Chennai
C C++ Training in Chennai | C C++ Training course in Chennai
linux Training in Chennai | NO.1 linux Training in Chennai
Unix Training in Chennai | NO.1 Unix Training in Chennai
Sql Training in Chennai | NO.1 Sql Training in Chennai
It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted.
ReplyDeleteData Science Training in ChennaiKK Nagar | Data Science Course in Chennai
Python Course in Chennai KK Nagar | Python Training Course Institutes in Chennai
RPA Training in Chennai KK Nagar | RPA Training in Chennai
I ‘d mention that most of us visitors are endowed to exist in a fabulous place with very many wonderful individuals with very helpful things.
ReplyDeleteBest PHP Training Institute in Chennai|PHP Course in chennai
Best .Net Training Institute in Chennai
Dotnet Training in Chennai
Dotnet Training in Chennai
Such a great information for blogger i am a professional blogger thanks…
ReplyDeleteStart your journey with Best SAP Course and get hands-on Experience with 100% Placement assistance from experts Trainers @Softgen Infotech Located in BTM Layout Bangalore. Expert Trainers with 8+ Years of experience, Free Demo Classes Conducted.
I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking automated software testing training the time to discuss this, I feel happy about it and I love learning more about this topic.
ReplyDelete
ReplyDeleteIt was wondering if I could use this write-up on my other website, I will link it back to your website though.Great Thanks
Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery
"Hi! Thank you for the share this information. This is very useful information for online blog review readers. Keep it up ..
ReplyDeleteDigital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery
"
Really Good tips and advises you have just shared. Thank you so much for taking the time to share such a piece of nice information. Looking forward for more views and ideas, Keep up the good work! Visit here for Product Engineering Services | Product Engineering Solutions
ReplyDeleteThanks for posting the best information and the blog is very helpful.I also want to share some information about Signova
ReplyDelete