Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 22

Software testing

White box testing


Black box testing
Alpha testing
Beta testing

Copy Write Mr.Ravi, KYUEM


What is White Box Testing
• Test cases are based on our knowledge
of how the object works internally – the
algorithms it uses.
• Allows exhaustive testing of all the
algorithm paths (i.e. each line of code
for each condition)
A software testing technique whereby explicit knowledge of the internal
workings of the item being tested are used to select the test data

Copy Write Mr.Ravi, KYUEM


What happens in
White box testing
public static int binarySearch( int key, int[] sequence ) {
int bottom = 0;
int top = sequence.length - 1;
int mid = 0;
int keyPosition = -1;

while( bottom <= top && keyPosition == -1 ) { A software testing technique


mid = ( top + bottom ) / 2;
if( sequence[ mid ] == key ) {
whereby explicit knowledge of the
keyPosition = mid; internal workings of the item being
} tested are used to select the test
else {
if( sequence[ mid ] < key ) {
data.
bottom = mid + 1;
}
else {
top = mid - 1;
}
}
}
return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {

1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0;
int keyPosition = -1;

while( bottom <= top && keyPosition == -1 ) {


mid = ( top + bottom ) / 2;
if( sequence[ mid ] == key ) {
keyPosition = mid;
}
else {
if( sequence[ mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
}
}
}
return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {

1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0;
2
int keyPosition = -1;

while( bottom2<= top && keyPosition == -1 ) {


mid = ( top + bottom ) / 2;
if( sequence[ mid ] == key ) {
keyPosition = mid;
}
else {
if( sequence[ mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
}
}
}
return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {

1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;

F
while( bottom2<= top && keyPosition == -1 ) {
mid = ( top + bottom ) / 2;
if( sequence[ mid ] == key ) {
keyPosition = mid;
}
else {
if( sequence[ mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
}
10
}
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {

1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F
while( bottom2<= top && keyPosition
3 == -1 ) { 3
mid = ( top + bottom ) / 2;
if( sequence[ mid ] == key ) {
keyPosition = mid;
}
else {
if( sequence[ mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
}
10
}
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {

1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2;
if( sequence[ mid ] == key ) {
keyPosition = mid;
}
else {
if( sequence[ mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
}
10
}
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {

1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
if( sequence[ 4
mid ] == key ) { 4
keyPosition = mid;
}
else {
if( sequence[ mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
}
10
}
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {

1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
5
keyPosition = mid;
T
}
else {
5
if( sequence[ mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
}
10
}
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {

1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
F
5 = F
keyPosition mid;
T
}
else {
6 5
if( sequence[6mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
}
10
}
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {

1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
F
5 = F
keyPosition mid;
T
}
else {
6 5
if( sequence[6mid ] < key ) {
bottom = mid + 1;
}
else {
top = mid - 1;
9
}
10
}
9
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {

1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
F
5 = F
keyPosition mid;
T
}
else {
6 5
T 6mid ] < key ) {
if( sequence[ T
bottom7= mid + 1;
7
}
else {
top = mid - 1;
9
}
10
}
9
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {

1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
F
5 = F
keyPosition mid;
T
}
else {
6 5
F
T 6mid ] < key ) {
if( sequence[ T
F 1;
bottom7= mid +
8 7
}
else {
8 - 1;
top = mid
9
}
10
}
9
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {

1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
F
5 = F
keyPosition mid;
T
}
else {
6 5
F
T 6mid ] < key ) {
if( sequence[ T
F 1;
bottom7= mid +
8 7
}
else {
8 - 1;
top = mid
9
}
10
}
9
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {

1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
F
5 = F
keyPosition mid;
T
}
else {
6 5
F
T 6mid ] < key ) {
if( sequence[ T
F 1;
bottom7= mid +
8 7
}
else {
8 - 1;
top = mid
9
}
10
}
9
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
Identifying the Different
Algorithm Paths
public static int binarySearch( int key, int[] sequence ) {

1 int bottom = 0; 1
int top = sequence.length - 1;
int mid = 0; F
2
int keyPosition = -1;
T
T
F F 3
while( bottom2<= top && keyPosition
F 3 == -1 ) {
mid = ( top + bottom ) / 2; T T
T 4
if( sequence[ mid ] == key ) { 4
F
5 = F
keyPosition mid;
T
}
else {
6 5
F
T 6mid ] < key ) {
if( sequence[ T
F 1;
bottom7= mid +
8 7
}
else {
8 - 1;
top = mid
9
}
10
}
9
}
10 return keyPosition;
}
Copy Write Mr.Ravi, KYUEM
This is What I Got after the tracing the
algorithm
START

hasWings
F T

Legs == 8 Legs == 6
T
F
T F
“Fly”
Legs > 10
“Spider”
Legs == 4 T
T “Grass
Hopper”
F
Legs < 200
F F

T
END
“Millipede”

Copy Write Mr.Ravi, KYUEM


What happens in
Black box testing
A software testing technique whereby the internal workings of the item
being tested are not known by the tester. For example, in a black box test
on a software design the tester only knows the inputs and what the
expected outcomes should be and not how the program arrives at those
outputs. The tester does not ever examine the programming code and
does not need any further knowledge of the program other than its
specifications

Copy Write Mr.Ravi, KYUEM


Input What happens in
Black box testing
Program xys;
Var x,y: integer;
Begin
writeln(‘enter a number’);
Read(x);
For I := 1 to 10 do
begin
y:= I*I;
x := x + y;
end;
Writeln(‘the output is’,x);
End.
}
Output

The tester don’t know anything about the


algorithm used In the program but can only
see the output based on his test data.
Copy Write Mr.Ravi, KYUEM
Advantages in
Black box testing
The advantages of this type of testing include:
•The test is unbiased because the designer and the tester are
independent of each other.
•The tester does not need knowledge of any specific programming
languages.

Copy Write Mr.Ravi, KYUEM


αlpha and βeta testing
Any software testing will involve alpha and beta testing. However, the
first stage, called alpha testing, is often performed only by users within
the organization developing the software. The second stage, called beta
testing , generally involves a limited number of external users.

Copy Write Mr.Ravi, KYUEM

You might also like