Analyst Testing Question: Download Test Analyst PDF

0 program TRICKY
1 var1, var2, var3 : integer
2 begin
3 read ( var2 )
4 read ( var1 )
5 while var2 < 10 loop
6 var3 = var2 + var1
7 var2 = 4
8 var1 = var2 + 1
9 print ( var3 )
10 if var1 = 5 then
11 print ( var1 )
12 else
13 print ( var1+1 )
14 endif
15 var2 = var2 + 1
16 endloop
17 write ( "Wow - that was tricky!" )
18 write ( "But the answer is…" )
19 write ( var2+var1 )
20 end program TRICKY
Which of the following statements about the TRICKY program MOST correctly describes any control flow anomalies in it?
A. The TRICKY program contains unreachable code and an infinite loop
B. The TRICKY program contains no control flow anomalies
C. The TRICKY program contains unreachable code
D. The TRICKY program contains a loop with multiple entry points

Tweet Share WhatsApp

Answer:

A. The TRICKY program contains unreachable code and an infinite loop

Download Test Analyst PDF Read All 40 Test Analyst Questions
Previous QuestionNext Question
You are the test analyst working on the testing of software that will control the movement of a roof on a new national sports stadium that seats 100,000 spectators. A failure analysis has shown that if the software system fails then it may cause the roof to break up and fall on the spectators. The government has requested that the level of testing for this software exceeds that normally required by the relevant regulatory standards.
Which is the level of test coverage you would expect to be achieved in the testing of the control software for the stadium roof?
A. Multiple Condition coverage
B. Branch coverage + Modified Condition/Decision coverage
C. Branch coverage + Statement coverage
D. Modified Condition/Decision coverage
0 program Calculate Commission
1 total, number : integer
2 commission_hi, commission_lo : real
3 begin
4 read ( number )
5 while number ≠ -1 loop
6 total = total + number
7 read ( number )
8 endloop
9 if total > 1000 then
10 commission_hi = 100 + 0.2 * ( total - 1000 )
11 else
12 commission_lo = 0.15 * total
13 endif
14 write ( "This salesman's commission is:")
15 write ( commission_hi )
16 end program Calculate Commission
Which of the following correctly lists data flow anomalies that exist in the 'calculate commission' program?
A. total: line 6; commission_lo: line 12; commision_hi: line 15
B. commision_hi: line 10; commission_lo: line 12
C. number: line 5; number: line 6
D. total: line 6; commision_hi: line 10; commission_lo: line 12