Friday, August 29, 2014

Loop Testing

Loops are the basis of most algorithms implemented using software.Loop testing is a white box testing approach that concentrates on the validity of loop constructs.Four loops 
can be defined: simple loops, concatenate loops, nested loops, and unstructured loops.

1.Simple loops: The follow group of tests should be used on simple loops, where n is the maximum number of allowable passes through the loop: 

� Skip the loop entirely.

� Only one pass through the loop.

� Two passes through the loop.
� M passes through the loop where m<n.
� n-1, n, n+1 passes through the loop.


2.Nested loop: For the nested loop the number of possible tests increases as the level of nesting grows. This would result in an impractical number of tests. An approach that 
will help to limit the number of tests:

� Start at the innermost loop. Set all other loops 
to minimum values.
� Conduct simple loop tests for the innermost loop 
while holding the outer loop at their minimum iteration 
parameter value. 
� Work outward, performing tests for the next loop, 
but keeping all other outer loops at minimum values and 
other nested loops to typical values.
� Continue until all loops have been tested.


3.Concatenated loops: Concatenated loops can be tested using the techniques outlined for simple loops, if each of the loops is independent of the other. When the loops are not independent the approach applied to nested loops is recommended.

4.Unstructured loops: This class of loop should be 
redesigned to reflect the use of the structured programming 
constructs.

Wednesday, August 6, 2014

Definitions


Some of the following definitions can be direct questions in the ISTQB exams.

1. Error / Mistake :  

A human action that produces an incorrect result.

2.Defect / Bug / Fault: 

A flaw in a component or system that can cause the component or system to fail to perform its required function, e.g. an incorrect statement or data definition. A defect, if
encountered during execution, may cause a failure of the component or system.

 3.Failure : 

Any deviation of the component or system from its expected delivery, service or result. 

4.Black box test design technique: 
Procedure to derive and/or select test cases based on an analysis of the specification, either functional or non-functional, of a component or system without reference to its internal structure. 

5.Black box testing: 

Testing, either functional or non-functional, without reference to the internal structure of the component or system. 

6.White-box test design technique: 

Procedure to derive and/or select test cases based on an analysis of the internal structure of a component or system. 

7.White-box testing: 

Testing based on an analysis of the internal structure of the component or
system. 






8.Alpha Testing :
 
9.Beta Testing :


 

Monday, August 4, 2014

Boundary Value Analysis with Examples:

Boundary Value Analysis:

Boundary value analysis is a black box test design technique and it is used to find the errors at boundaries of input domain rather than finding those errors in the center of input.
 Each boundary has a valid boundary value and an invalid boundary value. Test cases are designed based on the both valid and invalid boundary values. Usually is chosen one test case from each boundary.

Boundary value analysis is a next part of Equivalence partitioning for designing test cases where test cases are selected at the edges of the equivalence classes.Boundary value analysis is often called as a part of stress and negative testing. 

 
Lets understand this better now by taking below example:
Test cases for input box accepting numbers between 1 and 1000 using Boundary value analysis:

1) Test cases with test data exactly as the input boundaries of input domain i.e. values 1 and 1000 in our case.

2) Test data with values just below the extreme edges of input domains i.e. values 0 and 999.

3) Test data with values just above the extreme edges of input domain i.e. values 2 and 1001.

Now lets understand it even more simple with the below example:


Question
A program validates a numeric field as follows: values less than 10 are rejected, values between 10 and 21 are accepted, values greater than or equal to 22 are rejected. Which of the following covers the MOST boundary values?

a. 9,10,11,22
b. 9,10,21,22
c. 10,11,21,22
d. 10,11,20,21

Solution
We have already come up with the classes as shown in question 5. The boundaries can be identified as 9, 10, 21, and 22. These four values are in option ‘b’. So answer is ‘B’

Equivalence partitioning with Examples:


Equivalence partitioning:


 Equivalence partitioning (also called Equivalence Class Partitioning) is a software testing
technique that divides the input data of a software unit into partitions of equivalent data from which test cases can be derived.

A shorter definition is that in this method the input domain data is divided into different equivalence data classes. This method is typically used to reduce the total number of test cases to a finite set of testable test cases, still covering maximum requirements.
Another much concrete definition is that equivalence partitioning is the process of taking all possible test cases and placing them into classes and, while testing, one test value is picked from each class.

Lets take the below question as example and try to understand how to analyse the questions related to  Equivalence partitioning:

Question:

If you are testing for an input box accepting numbers from 1 to 1000 then there is no use in writing thousand test cases for all 1000 valid input numbers plus other test cases for invalid data.

Analysis:

Using equivalence partitioning method above test cases can be divided into three sets of input data called as classes. Each test case is a representative of respective class.
So in above example we can divide our test cases into three equivalence classes of some valid and invalid inputs.
Test cases for input box accepting numbers between 1 and 1000 using Equivalence Partitioning:
1) One input data class with all valid inputs. Pick a single value from range 1 to 1000 as a valid test case. If you select other values between 1 and 1000 then result is going to be same. So one test case for valid input data should be sufficient.
2) Input data class with all values below lower limit. I.e. any value below 1, as a invalid input data test case.
3) Input data with any value greater than 1000 to represent third invalid input class.
So using equivalence partitioning you have categorized all possible test cases into three classes. Test cases with other values from any class should give you the same result.
We have selected one representative from every input class to design our test cases. Test case values are selected in such a way that largest number of attributes of equivalence class can be exercised.
Equivalence partitioning uses fewest test cases to cover maximum requirements.
I hope you understood how to analyse  Equivalence partitioning

Now lets solve the below simple example:

Question
In an Examination a candidate has to score minimum of 24 marks in order to clear the exam. The maximum that he can score is 40 marks.  Identify the Valid Equivalence values if the student clears the exam.
a)    22,23,26
b)    21,39,40
c)    29,30,31
d)    0,15,22
Solution
The classes will be as follows:
Class I: values < 24   => invalid class
Class II: 24 to 40       => valid class
Class III: values > 40 => invalid class
We have to indentify Valid Equivalence values. Valid Equivalence values will be there in Valid Equivalence class. All the values should be in Class II. So answer is ‘C’

Answer below questions for your better understanding:
Question 1: 

One of the fields on a form contains a text box which accepts numeric values in the range of 18 to 25. Identify the invalid Equivalence class.
a)    17
b)    19
c)    24
d)    21

Question 2:

In an Examination a candidate has to score minimum of 24 marks in order to clear the exam. The maximum that he can score is 40 marks.  Identify the Valid Equivalence values if the student clears the exam.
a)    22,23,26
b)    21,39,40
c)    29,30,31
d)    0,15,22