Wednesday, June 3, 2015

[ISTQB Practice Questions] Chapter 4 - Test Design Techniques

1 For the code fragment given below, which answer correctly represents minimum tests required for statement and branch coverage respectively?

Discount rate=1;
Fare = 1000;
If ((person == 'senior citizen')
and ('travel month = January'))
Bonuspoints = 100+Bonuspoints
If (class=='first') discountRate = 5;
Fare = fare * discountRate;

(A)  Statement Coverage = 1, Branch Coverage = 2  

(B)  Statement Coverage = 2, Branch Coverage = 2   

(C)  Statement Coverage = 1, Branch Coverage = 3   

(D)   Statement Coverage = 2, Branch Coverage = 4   



2 One of the differences between the Modified Condition Decision Coverage and the Condition Coverage is:

(A)   The Condition Coverage ensures all paths through a module are executed whereas the Modified Condition Decision Coverage ensures each path in a decision can independently affect the outcome. 
 
(B)  The Modified Condition Decision Coverage ensures all alternative paths are executed whereas the Condition Coverage ensure all main paths are executed.   

(C)  The Condition Coverage ensures each condition takes all possible outcomes at lease once whereas the Modified Condition Decision Coverage requires both maximum and minimum values within each field.   

(D)  The Modified Condition Decision Coverage relies on the tester's skill and past experience whereas the Condition Coverage relies on the way in which the system moves from one condition to another.   



3 Which of the following statements describe why exploratory testing is a useful test design technique?

a. It can help derive test cases based on the internal structure of systems.
b. It is useful when there are limited specification documents available.
c. It is useful when there testing is constrained due to time pressures.
d. It is a cheaper alternative to more formal test design techniques.

(A)  b and c    (B)   a and c   
(C)  b and d    (D)  c and d  



4 Which of the following statements correctly describes the benefit of fault attacks?

(A)  They are more effective at finding faults than formal test design techniques
   
(B)  They are useful when there is limited experience in the test team   

(C)   They can evaluate the reliability of a test object by attempting to force specific failures 
        to occur   

(D)   They are less structured than other experience-based techniques  



5 The following code segment contains a potential 'divide by 0' error.

J=50
K=1
while (J>=10) and (N<=10) loop
M [K] = J/N
K = K + 1
N = N - 1
end loop
Which of the following is the most effective way of detecting this error?

(A)   Boundary testing    
(B)  Condition testing   
(C)   Compilation of the source code    
(D)  Source code inspection 



6 Considering the following pseudo-code, calculate the MINIMUM number of test cases for statement coverage, and the MINIMUM number of test cases for decision coverage respectively.

READ A
READ B
READ C
IF C>A THEN
IF C>B THEN
PRINT 'C must be smaller than at least one number'
ELSE
PRINT 'Proceed to next stage'
ENDIF
ELSE
PRINT 'B can be smaller than C'
ENDIF

(A)   3, 3.    
(B)  2, 3.   
(C)  2, 4.     
(D)  3, 2. 



7 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 


8 A piece of software has been given for testing. What tests from the following will you perform?
1) Test the areas most critical to business processes
2) Test the areas where faults will be maximum
3) Test the easiest functionalities

(A)  1&2 are true and 3 is false.    
(B)   1,2&3 are true.    
(C)  1 is true, 2&3 are false.    
(D)  1&2 are false, 3 is true



9 In a system designed to work out the tax to be paid: An employee has $4000 of salary tax free. The next $1500 is taxed at 10%. The next $28000 is taxed at 22%. Any further amount is taxed at 40% . To the nearest $ which of these is a valid Boundary Value Analysis test case?

(A)   $1500     
(B)   $32001    
(C)  $28000     
(D)  $33501


10 Equivalence partitioning is:

(A)  A black box testing technique used only by developers   
(B)   A black box testing technique than can only be used during system testing   
(C)  A black box testing technique appropriate to all levels of testing    
(D)  A white box testing technique appropriate for component testing 



11 Which of the following is true about White and Black Box Testing Technique:-

(A)  Equivalence partitioning, Decision Table and Control flow are White box Testing Techniques.   
(B)  Equivalence partitioning, Boundary Value Analysis , Data Flow are Black Box Testing Techniques.   
(C)  Equivalence partitioning , State Transition , Use Case Testing are black box Testing Techniques.   
(D)  Equivalence Partitioning, State Transition, Use Case Testing and Decision Table are White Box Testing Techniques. 


12 Which of the following types of defects is use case testing MOST LIKELY to uncover?

i) Defects in the process flows during real-world use of the system.
ii) Defects in the interface parameters in integration testing.
iii) Integration defects caused by the interaction and interference of different components.
iv) Defects in the system as it transitions between one state and another.

(A)  ii, iii.       (B)   i, iii.   

(C)   iii, iv.     (D)   i, ii 



13 We can achieve complete statement coverage but still miss bugs because:

(A)  The failure occurs only if you reach a statement taking the TRUE branch of an IF statement, and you got to the statement with a test that passed through the FALSE branch.    
(B)   The failure depends on the program's inability to handle specific data values, rather than on the program's flow of control.    
(C)  We are not required to test code that customers are unlikely to execute.   
(D)  All of the above  


14 Which of the following structure-based test design technique would be most likely to be applied to?

1 Boundaries between mortgage interest rate bands.
2 An invalid transition between two different area's statuses.
3 The business process flow for mortgage approval.
4 Control flow of the program to calculate repayments.

(A)  2, 3 and 4    (B)  2 and 4   

(C)  3 and 4        (D)  1, 2 and 3  


15 Requirement 24.3 A 'Postage Assistant' will calculate the amount of postage due for letters and small packages up to 1 kilogram in weight. The inputs are: the type of item (letter, book or other package) and the weight in grams. Which of the following conform to the required contents of a test case?

(A)  Test the three types of item to post and three different weights   

(B)  Test 1: letter, 10 grams, postage €0.25. Test 2: book, 500 grams, postage €1.00. Test 3: package, 999 gram, postage €2.53    

(C)   Test 1: letter, 10 grams to Belgium. Test 2: book 500 grams to USA. Test 3: package, 999 grams to South Africa    

(D)  Test 1: letter 10 grams, Belgium, postage €0.25. Test 2: package 999 grams to South Africa, postage €2.53  




16 Given the following fragment of code, how many tests are required for 100% decision coverage?

if width > length
then
biggest_dimension = width
if height > width
then
biggest_dimension = height
end_if
else
biggest_dimension = length
if height > length
then
biggest_dimension = height
end_if
end_if

(A)  3    
(B)  4   
(C)  2    
(D)  1



17 You have designed test cases to provide 100% statement and 100% decision coverage for the following fragment of code.

if width > length
then
biggest_dimension = width
else
biggest_dimension = length
end_if

The following has been added to the bottom of the code fragment above.

print 'Biggest dimension is ' & biggest_dimension
print 'Width: ' & width
print 'Length: ' & length

How many more test cases are required?

(A)  One more test case will be required for 100 % decision coverage.
  
(B)   Two more test cases will be required for 100 % statement coverage, one of which will be used to provide 100% decision coverage.    

(C)  None, existing test cases can be used.    

(D)  One more test case will be required for 100' statement coverage. 



18 Which test approaches or strategies are characterized by the descriptions below?

S. Process-compliant approaches
T. Heuristic approaches
U. Consultative approaches
V. Regression-averse approaches
1. Includes reuse of existing test material
2. Listens to suggestions from technology experts
3. Adheres to industry-specific standards
4. Runs test execution and evaluation concurrently

(A)   S4, T3, U2, V1    
(B)  S1, T2, U3, V4  
(C)  S2, T3, U1, V4     
(D)  S3, T4, U2, V1



Answers:

1. A

2. A

3. A

4. C

5. D

6. A

7. C

8. A

9. D

10. C

11. C

12. B

13. B

14. C

15. B

16. B

17. C

18. D

No comments:

Post a Comment