Professional Documents
Culture Documents
ASSIGNMENT -1
in
SOFTWARE TESTING
TOPICS :-
Boundary value analysis
Equivalence class testing
Control flow testing
C.S.E 8 th sem
BOUNDARY VALUE ANALYSIS-
1. Minimum
2. Just above the minimum
3. A nominal value
4. Just below the maximum
5. Maximum
Boundary Value Analysis is the next part of Equivalence Partitioning for designing
test cases where test cases are selected at the edges of the equivalence classes.
imagine, there is a function that accepts a number between 18 to 30, where 18 is
the minimum and 30 is the maximum value of valid partition, the other values of
this partition are 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 and 29.
Example -1
The invalid partition consists of the numbers which are less than 18 such as 12,
14, 15, 16 and 17, and more than 30 such as 31, 32, 34, 36 and 40. Tester develops
test cases for both valid and invalid partitions to capture the behavior of the system
on different input conditions.
Example 2:
Total marks obtained are the average of marks obtained in the three subjects i.e.
Average = (mark1 + mark 2 + mark3) / 3
The program output may have one of the following words:
[Fail, Third Division, Second Division, First Division, First Division with
Distinction]
Design the boundary value test cases.
1 0 50 50 Fail
2. 1 50 50 Fail
3. 50 50 50 Second Division
4. 99 50 50 First Division
5. 100 50 50 First Division
6 50 0 50 Fail
7. 50 1 50 Fail
8. 50 99 50 First Division
10. 50 50 0 Fail
11. 50 50 1 Fail
Example -2
For example-1
. OTP Number = 6 digits
Example-2
Valid Input: 18 – 56
Invalid Input: less than or equal to 17 (<=17), greater than or equal to 57 (>=57)
Invalid Class 1: <=17 = Pick any one input test data less than or equal to 17
Invalid Class 2: >=57 = Pick any one input test data greater than or equal to 57
Control flow testing is a testing technique that comes under white box
testing. The aim of this technique is to determine the execution order of
statements or instructions of the program through a control structure. The
control structure of a program is used to develop a test case for the program.
In this technique, a particular part of a large program is selected by the tester
to set the testing path. It is mostly used in unit testing.
Test cases represented by the control graph of the program.
In other words Control-flow testing is a structural testing strategy that uses
the program’s control flow as a model.
The entire structure, design, and code of the software have to be studied for
this type of testing. Often the testing method is used by developers
themselves to test their own code and design as they are very familiar with
the code.
This method is implemented with the intention to test logic of the code so
that the required results or
functionalities can be achieved. Its main application is to relate the small
programs and segments of the larger programs.
Cyclomatic Complexity:
It detects almost half of the defects that are determined during the unit
testing.
It also determines almost one-third of the defects of the whole program.
It can be performed manually or automated as the control flow graph that is
used can be made by hand or by using software also.
It is difficult to find missing paths if program and the model are done by
same person.
Unlikely to find spurious features.
Example:-
public class VoteEligiblityAge{
public static void main(String []args){
int n=45;
if(n>=18)
{
System.out.println("You are eligible for voting");
} else
{
System.out.println("You are not eligible for voting");
}
}
}