0% found this document useful (0 votes)
3 views47 pages

Software Testing Lab File

The document outlines a series of software testing experiments focused on determining the next date given a current date, utilizing both Black Box and White Box testing techniques. It includes various testing methods such as boundary value analysis, robust testing, and decision tables, along with detailed test cases and expected outputs. The experiments were conducted under the supervision of Dr. Preeti Arora at the Bhagwan Parshuram Institute of Technology.

Uploaded by

sovendara19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views47 pages

Software Testing Lab File

The document outlines a series of software testing experiments focused on determining the next date given a current date, utilizing both Black Box and White Box testing techniques. It includes various testing methods such as boundary value analysis, robust testing, and decision tables, along with detailed test cases and expected outputs. The experiments were conducted under the supervision of Dr. Preeti Arora at the Bhagwan Parshuram Institute of Technology.

Uploaded by

sovendara19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

SOFTWARE TESTING

&
Quality Assurance

BY Submitted To:
a Dr.Preeti Arora
03120802718
31-CSEA-18
CSEA

Department of Computer Science & Engineering


Bhagwan Parshuram Institute of Technology
PSP-4, Sec-17, Rohini, Delhi-89
INDEX

S.no Experiment Date Remark


1. To determine the Next date, given
the current date. Performing
different BLack Box Testing 21/10/21
techniques.
2. To Determine the Next date, given
the current date. Perform different 28/10/21
White Box Testing techniques.
3. To classify the type of triangle as
Scalene, isosceles, equilateral, or 11/11/21
not a triangle. Perform all Black
box testing techniques.
4. To classify the type of triangle as
Scalene, isosceles, equilateral, or 18/11/21
not a triangle. Perform all White
box testing techniques.
5. For Commission problem, perform
all Black box testing techniques. 25/11/21

6. For Commission problem, perform


all White box testing techniques. 2/12/21

7. Create a test plan document for


any application . 09/12/21

8. Study of any open-source testing


tools 09/12/21
Experiment-1

Aim: To determine the Next date, given the current date. Perform
following Black Box Testing techniques:
1. Boundary value Analysis
2. Robust testing
3. Worst case testing
4. Equivalence class testing
5. Decision table
6. Cause effect graph

Problem Domain: “Next Date” is a function consisting of three


variables: month, date and year. It returns the date of the next day as
output. It reads the current date as the input date. The conditions are
C1 : 1 =< month =< 12
C2 : 1 =< day =< 31
C3 : 1900 =< year =< 2025
If any condition out of the C1, C2 or C3 fails, then this function
produces an output “value of month not in the range 1…..12”. Since
many combinations of dates can exist, we can simply display one
message for this function: “Invalid input date”.

Black Box Testing

1. Boundary value Analysis


Given range,
1 =< month =< 12
1 =< day =< 31
1900 =< year =< 2025
These inputs: month, day, year
4*n+1 test cases — 4*3+1=13 test cases
S.no. Month(mm) Day(dd) Year(yyyy) Expected
Output

1 6 15 1900 16 june, 1900

2 6 15 1901 16 june, 1901

3 6 15 1962 16 june, 1962

4 6 15 2024 16 june,2024

5 6 15 2025 16 june, 2025

6 6 1 1962 2 june, 1962

7 6 2 1962 3 june, 1962

8 6 30 1962 1 july, 1962

9 6 31 1962 Invalid date


as june has
30days

10 1 15 1962 16 january,
1962

11 2 15 1962 16 february,
1962

12 11 15 1962 16 november,
1962

13 12 15 1962 16 december,
1962

2. Robust case testing


Robust test cases are 6n+1. Hence in 3 variable input cases, the
total number of test cases is 19.
S.no. Month(mm) Day(dd) Year(yyyy) Expected
Output

1 0 15 1900 Out of range

2 1 15 1901 16 january,
1901

3 2 15 1962 16 february,
1902

4 11 15 2024 16 november,
2024

5 12 15 2025 16 december,
2025

6 13 15 1962 Out of range

7 6 0 1962 Out of range

8 6 1 1962 2 june, 1962

9 6 2 1962 3 june, 1962

10 6 30 1962 1 july, 1962

11 6 31 1962 Invalid date

12 6 32 1962 Out of range

13 6 15 1962 16 june, 1962

14 6 15 1899 Out of range

15 6 15 1900 16 june, 1900

16 6 15 1901 16 june, 1901

17 6 15 2024 16 june, 2024

18 6 15 2025 16 june, 2025

19 6 15 2026 Out of range


3. Worst case testing
In case of the worst case testing, total test cases are 5^n. Hence 125
test cases will be generated in the worst test cases.
10 test cases out of 125 are given alongside:-

S.no. Month(mm) Day(dd) Year(yyyy) Expected


Output

1 1 1 1900 2 january,
1900

2 1 1 1901 2 january,
1901

3 1 1 1962 2 january,
1962

4 1 1 2024 2 january,
2024

5 1 1 2025 2 january,
2025

6 1 2 1900 3 january,
1900

7 1 2 1901 3 january,
1901

8 1 2 1962 3 january,
1962

9 1 2 2024 3 january,
2024

10 1 2 2025 3 january,
2025
4. Equivalence class testing
M1 = {month: month has 30 days}
M2 = {month: month has 31 days}
M3 = {month: month is February}
D1 = {day: 1 =< day =< 28}
D2 = {day: day = 29}
D3 = {day: day = 30}
D4 = {day: day = 31}
Y1 = {year: 1900 =< year =< 2025}

S.no. Month(mm) Day(dd) Year(yyyy) Expected


output

WN1 6 14 2000 6/15/2000

WN2 7 29 1996 7/30/1996

WN3 2 30 2002 2/31/2002


(impossible)

WN4 6 31 2000 7/1/2000


(impossible)

SN1 6 14 2000 6/15/2000

SN2 6 14 1996 6/15/1996

SN3 6 14 2002 6/15/2002

SN4 6 29 2000 6/30/2000

SN5 6 29 1996 6/30/1996

SN6 6 29 2002 6/30/2002

SN7 6 30 2000 6/31/2000


(impossible)

SN8 6 30 1996 impossible

SN9 6 30 2002 impossible


SN10 6 31 2000 invalid

SN11 6 31 1996 invalid

SN12 6 31 2002 invalid

SN13 7 14 2000 7/15/2000

SN14 7 14 1996 7/15/1996

SN15 7 14 2002 7/15/2002

SN16 7 29 2000 7/30/2000

SN17 7 29 1996 7/30/1996

SN18 7 29 2002 7/30/2002

SN19 7 30 2000 7/31/2000

SN20 7 30 1996 7/31/1996

SN21 7 30 2002 7/31/2002

SN22 7 31 2000 8/1/2000

SN23 7 31 1996 8/1/1996

SN24 7 31 2002 8/1/2002

SN25 2 14 2000 2/15/2000

SN26 2 14 1996 2/15/1996

SN27 2 14 2002 2/15/2002

SN28 2 29 2000 Invalid input

SN29 2 29 1996 3/1/1996

SN30 2 29 2002 Invalid input

SN31 2 30 2000 Invalid input

SN32 2 30 1996 Invalid input

SN33 2 30 2002 Invalid input

SN34 2 31 2000 Invalid input


SN35 2 31 1996 Invalid input

SN36 2 31 2002 Invalid input

5. Decision table
M1 = {month: 1….12/days(month)=30}
M2 = {month: 1….12/days(month=31 where month does not equal
12)}
M3 = {month: {12}}
M4 = {month: {2]}
D1 = {day: 1….27}
D2 = {day: {20}}
D3 = {day: {29}}
D4 = {day: {30}}
D5 = {day: {31}}
Y1 = {year: 1900….2025/ leap year(year)}
Y2 = {year: 1900….2025/ common year(year)}
Test Cases For Decision Table:

S.no. Month Day Year Expected


Output

1-3 April 15 2001 April 16,


2001

4 April 30 2001 May 1,2001

5 April 31 2001 impossible

6-9 January 15 2001 January 16,


2001

10 January 31 2001 February 1,


2001

11-14 December 15 2001 December


16, 2001

15 December 31 2001 January 1,


2002

16 February 15 2001 February


16, 2001

17 February 28 2004 February


29, 2004

18 February 28 2001 March 1,


2001

19 February 29 2004 March 1,


2004

20 February 29 2001 impossible

21-22 February 30 2001 impossible


6. Cause Effect graph

C1 = M1, C2 = M2, C3 = M3, C4 = M4, C5 = D1, C6 = D2, C7 = D3,


C8 = D4, C9 = D5, C10 = Y1, C11 = Y2, e1 = a1, e2 = a2, e3 = a3,
e4 = a4, e5 = a5.
Experiment-2

Aim: To determine the Next date, given the current date. Perform
following White Box Testing techniques:
1. Flow graph
2. DD Path
3. Cyclomatic complexity
4. Identification of independent paths
White Box Testing:
Program Next Date
Declare tomorrow Day, tomorrow Month, tomorrow Year as integer
Declare Day, Month, Year as integer
Output(“Enter today’s date in the form, MM DD YYYY”)
Input(month, day, year)
Case month of
Case1: month is 1,3,5,7,8 or 10 : 31 day months-(except Dec)
If Day < 31
Then tomorrow Day = day+1
Else
tomorrow Day = 1
tomorrow Month = month+1
Else if
Case 2: month is 4,6,9 or 11 : 30 day months-
If day < 30
Then tomorrow Day = day+1
Else
tomorrow Day = 1
tomorrow Month = month+1
End if
Case 3: month is 12 : December
If day < 31
Then tomorrow Day = day+1
Else
tomorrow Day = 1
tomorrow Month = 1
tomorrow Year = year+1
If year = 2025 then output (“out of range”)RETURN
End if
Case 4: month is 2: February
If day < 28
Then tomorrow Day = day+1
Else
If day = 28
Then if (is leap)
Then tomorrow Day = 29
Else
tomorrow Day = 1
tomorrow Month = 3
End if
End if day = 29
Then if (is leap)
Then
tomorrow Day = 1
tomorrow Month = 3
Else
output(“Invalid Date”) Return
End if
End if
End if
End case
output(“Tomorrow Date is”, tomorrow Month, tomorrow Day,
Tomorrow Year”)
End Next Date

Flow Graph

DD Path
Flow Graph Nodes DD Path Graph Remarks
Corresponding nodes

1,2 A1 Sequential node

3 B1 Decision node

4 C1 Decision node

5 D1 Decision node

6 E1 Sequential node

7,8,9 F1 Sequential node

10 G1 Junction node

11 H1 Decision node

12 I1 Decision node

13 J1 Sequential node

14,15,16 K1 Sequential node

17 L1 Junction node

18 M1 Decision node

19 N1 Decision node

20 O1 Sequential node

21,22,23,24,25 P1 Sequential node

26 Q1 Junction node

27 R1 Decision node

28 S1 Decision node

29 T1 Sequential node

30 U1 Decision node

31 V1 Sequential node

32 W1 Decision node

33 X1 Sequential node
34,35,36 Y1 Sequential node

37 Z1 Junction node

38 A2 Sequential node

39 B2 Decision node

40,41,42,45 C2 Sequential node

43,44 D2 Sequential node

46 E2 Junction node

47 F2 Junction node

48,49 G2 Sequential node

50 H2 Junction node

Cyclomatic Complexity
Number of edges(e) = 41
Number of nodes(n) = 33
1) V(G) = e - n + 2p = 42 - 33 + 2 = 11
2) V(G) = R + 1 = 10 + 1 = 11

Independent paths
Independent paths in the above flow chart are:
1. A1B1C1D1E1G1G2H2
2. A1B1C1D1F1G1G2H2
3. A1B1H1I1J1L1G2H2
4. A1B1H1I1K1L1G2H2
5. A1B1C1M1N1O1Q1G2H2
6. A1B1C1M1N1P1H2
7. A1B1C1R1S1T1F2G2H2
8. A1B1C1R1S1U1V1W1X1Z1E2F2G2H2
9. A1B1C1R1S1U1V1W1Y1Z1E2F2G2H2
10. A1B1C1R1S1U1A2B2C2E2F2G2H2
11. A1B1C1R1S1U1A2B2D2H2
Experiment-3

Aim: To classify the type of triangle as Scalene, isosceles, equilateral, or


not a triangle. Perform all Black box testing techniques:
1. Boundary value Analysis
2. Robust testing
3. Worst case testing
4. Equivalence class testing
5. Decision table
6. Cause effect graph
Problem Domain: Consider a program for the classification of a
triangle. Its input is a triple of positive integers and the data type for
input parameters ensures that these will be integers greater than 0
and less than or equal to 100. The program output may be one of the
following words:
Scalene; Isosceles; Equilateral; Not a triangle.
Based on the input of sides, calculation is performed to determine
the type of triangle. If the user inputs any value outside the range,
Invalid Input is displayed as the output, otherwise, the respective
type of triangle.
Black Box Testing
1. Boundary value analysis –

Range : [1,100]
1<= a <=100
1<= b <=100
1<= c <=100

Three inputs – a, b, c (n=3)


Total no. of test cases = 4n+1 = 13
Test case
A B C Expected Output
no.
1 50 50 1 Isosceles
2 50 50 2 Isosceles
3 50 50 50 Equilateral
4 50 50 99 Isosceles
5 50 50 100 Not a triangle
6 50 1 50 Isosceles
7 50 2 50 Isosceles
8 50 99 50 Isosceles
9 50 100 50 Not a triangle
10 1 50 50 Isosceles
11 2 50 50 Isosceles
12 99 50 50 Isosceles
13 100 50 50 Not a triangle

2. Robust testing –
In robust testing, like the boundary value analysis, it generates test cases
based on a number of variables. The difference here is that it also
considers the invalid values making the test cases 6n+1.
So, total test cases = 19

Test case
A B C Expected Output
no.
1 50 50 1 Isosceles
2 50 50 2 Isosceles
3 50 50 50 Equilateral
4 50 50 99 Isosceles
5 50 50 100 Not a triangle
6 50 1 50 Isosceles
7 50 2 50 Isosceles
8 50 99 50 Isosceles
9 50 100 50 Not a triangle
10 1 50 50 Isosceles
11 2 50 50 Isosceles
12 99 50 50 Isosceles
13 100 50 50 Not a triangle
14 50 50 0 Invalid Input
15 50 50 101 Invalid Input
16 50 0 50 Invalid Input
17 50 101 50 Invalid Input
18 0 50 50 Invalid Input
19 101 50 50 Invalid Input

3. Worst case testing –


Here, total test cases are 5^n. Therefore, 125 test cases.
Some of the test cases are as follows.
Test case
A B C Expected Output
no.
1 1 1 1 Equilateral
2 1 1 2 Not a triangle
3 1 1 50 Not a triangle
4 1 1 99 Not a triangle
5 1 1 100 Not a triangle
6 1 2 1 Not a triangle
7 1 2 2 Isosceles
8 1 2 50 Not a triangle
9 1 2 99 Not a triangle
10 1 2 100 Not a triangle
11 1 50 1 Not a triangle
12 1 50 2 Not a triangle
13 1 50 50 Isosceles
14 1 50 99 Not a triangle
4. Equivalence class testing –
O1={<a,b,c>: Equilateral triangle with sides a,b,c}
O2={<a,b,c>: Isosceles triangle with sides a,b,c}
O3={<a,b,c>: Scalene triangle with sides a,b,c}
O4={<a,b,c>: Not a triangle with sides a,b,b}

Test case
A B C Expected Output
no.
1 50 50 50 Equilateral
2 50 50 99 Isosceles
3 100 99 50 Scalene
4 50 100 50 Not a triangle

I1={a: a < 1}
I2={a: a > 100}
I3={a: 1 ≤ a ≤ 100}
I4={b: b < 1}
I5={b: b > 100}
I6={b: 1 ≤ b ≤ 100}
I7={c: c < 1}
I8={c: c > 100}
I9={c: 1 ≤ c ≤ 100}
I10={< a,b,c >: a = b = c}
I11={< a,b,c >: a = b, a ≠ c}
I12={< a,b,c >: a = c, a ≠ b}
I13={< a,b,c >: b = c, a ≠ b}
I14={< a,b,c >: a ≠ b, a ≠ c, b ≠ c}
I15={< a,b,c >: a = b + c}
I16={< a,b,c >: a > b +c}
I17={< a,b,c >: b = a +c}
I18={< a,b,c >: b > a + c}
I19={< a,b,c >: c = a + b}
I20={< a,b,c >: c > a +b}
Test case
A B C Expected Output
no.
1 0 50 50 Invalid Input
2 101 50 50 Invalid Input
3 50 50 50 Equilateral
4 50 0 50 Invalid Input
5 50 101 50 Invalid Input
6 50 50 50 Equilateral
7 50 50 0 Invalid Input
8 50 50 101 Invalid Input
9 50 50 50 Equilateral
10 60 60 60 Equilateral
11 50 50 60 Isosceles
12 50 60 50 Isosceles
13 60 50 50 Isosceles
14 100 99 50 Scalene
15 100 50 50 Not a triangle
16 100 50 25 Not a triangle
17 50 100 50 Not a triangle
18 50 100 25 Not a triangle
19 50 50 100 Not a triangle
20 25 50 100 Not a triangle

5. Decision table –
C1={ a<b+c }
a1={ Not a triangle }
C2={ b<a+c }
a2={ Scalene }
C3={ c<a+b }
a3={ Isosceles }
C4={ a=b }
a4={ Equilateral }
C5={ b=c }
a5={ Impossible }
C6={ a=c }

6. Cause effect graph –


C1={ a<b+c }
e1={ Not a triangle }
C2={ b<a+c }
e2={ Scalene }
C3={ c<a+b }
e3={ Isosceles }
C4={ a=b }
e4={ Equilateral }
C5={ b=c }
e5={ Impossible }
C6={ a=c }
Experiment-4

Aim: To classify the type of triangle as Scalene, Isosceles,


Equilateral, or Not a Triangle. Perform following White Box Testing
techniques:
1. Flow graph
2. DD path
3. Cyclomatic complexity
4. Identification of independent paths

White Box Testing


Program:
1. Int main()
2. {
3. Int a,b,c, validInput=0;
4. Printf(“Enter the side a”);
5. Scanf(“%d”,&a);
6. Printf(“Enter the side b”);
7. Scanf(“%d”,&b);
8. Printf(“Enter the side c”);
9. Scanf(“%d”,&c);
10. If (a>0 && a<=100 && b>0 && b<=100 && c>0 && c<=100){
11. If (a+b>c && c+a>b && b+c>a){
12. validInput = 1;
13. }
14. }
15. Else{
16. validInput = -1;
17. }
18. If (validInput==1){
19. If (a==b && b==c){
20. Printf(“The triangle is equilateral”);
21. }
22. Else if (a==b || b==c || a==c){
23. Printf (“The triangle is isosceles”);
24. }
25. Else {
26. Printf(“The triangle is scalene”);
27. }
28. }
29. Else if (validInput==0){
30. Printf(“Triangle cannot be formed”);
31. }
32. Else {
33. Printf(“The inputs are invalid”);
34. }
35. Getch();
36. Return 0;
37. }
1. Flow graph –
Mapping of program graph(nodes) with DD graph(nodes)

Flow graph nodes DD path graph nodes Remarks

1-9 A Sequential nodes


10 B Decision node
11 C Decision node
12,13 D Sequential nodes
14 E Junction node
15,16,17 F Sequential nodes
18 G Decision node
19 H Decision node
20,21 I Sequential nodes
22 J Decision node
23,24 K Sequential node
25,26,27 L Sequential nodes
28 M Junction node
29 N Decision node
30,31 O Sequential node
32,33,34 P Sequential node
35 Q Junction node
36,37 R Sequential nodes
2. DD graph –

3. Cyclomatic complexity –
Number of edges, e = 23
Number of nodes, n = 18

V(G) = e – n + 2*P = 7

4. Identification of independent paths –


i. ABFGNPQR
ii. ABFGNOQR
iii. ABCEGNPQR
iv. ABCDEGNOQR
v. ABFGHIMQR
vi. ABFGHJKMQR
vii. ABFGHJMQR
Experiment-5

Aim: For Commission problem, perform all black box


testing techniques:
1. Boundary value Analysis
2. Robust testing
3. Worst cases testing
4. Equivalent class testing
5. Decision table
6. Cause effect graph
Problem Domain: A desert cooler salesperson sold cooler
fans, pumps and bodies that were made by a cooler maker.
Fans cost $55, pumps cost $40 and bodies cost $35. The
salesperson has to sell at least one complete cooler per
month and the production limits were such that the most the
salesperson could sell in a month was 70 fans, 80 pumps
and 90 bodies. The salesperson used to send the details of
sold items to the cooler maker. The cooler maker then
computed the salesperson’s commission as follows:-
a. 10% on sales upto and including $1500.
b. 15% of the next $500 and
c. 20% on any sales in excess of $2000.
The commission program produced a monthly sales report
that gave the total number of fans, pumps and bodies sold,
the sales person’s total dollar sales and finally the
commission.
Black Box Testing
1. Boundary value analysis -
Range:-
1<= fans <=70
1<= pumps <=80
1<= bodies <=90
Three inputs – fans, pumps, bodies (n=3) Total no. of
test cases = 4n+1 = 13

Case ID Fans Pumps Bodies Sales Commission

1 35 40 1 3560 537

2 35 40 2 3595 544

3 35 40 45 5100 845

4 35 40 89 6640 1153

5 35 40 90 6675 1160

6 35 1 45 3540 533

7 35 2 45 3280 541

8 35 79 45 6660 1157

9 35 80 45 6700 1165

10 1 40 45 3530 471

11 2 40 45 3285 482

12 69 40 45 6970 1219

13 70 40 45 7025 1230

2. Robust testing -
In robust testing, like the boundary value analysis, it
generates test cases based on a number of variables.
The difference here is that it also considers the invalid
values making the test cases 6n+1.
So, total test cases = 19
Case ID Fans Pumps Bodies Sales Commission

1 35 40 1 3560 537

2 35 40 2 3595 544

3 35 40 45 5100 845

4 35 40 89 6640 1153

5 35 40 90 6675 1160

6 35 1 45 3540 533

7 35 2 45 3280 541

8 35 79 45 6660 1157

9 35 80 45 6700 1165

10 1 40 45 3530 471

11 2 40 45 3285 482

12 69 40 45 6970 1219

13 70 40 45 7025 1230

14 35 40 0 invalid -

15 35 40 91 invalid -

16 35 81 45 invalid -

17 35 0 45 invalid -

18 0 40 45 invalid -

19 71 40 45 invalid -

3. Worst case testing -


Here, total test cases are 5^n. Therefore, 125 test
cases. Some of the test cases are as follows.

Case ID Fans Pumps Bodies Sales


1 1 1 1 130

2 1 1 2 165

3 1 1 45 1670

4 1 1 89 3210

5 1 1 90 3245

6 1 2 1 170

7 1 2 2 205

8 1 2 45 1710

9 1 2 89 3250

10 1 2 90 3285

11 1 40 1 1690

12 1 40 2 1725

… … … … …

124 70 80 89 10165

125 70 80 90 10200

4. Equivalence Class testing -


I1 = {fans: 1<= fans<=70}
I2 = {pimps: 1<= pumps <=80}
I3 = {bodies: 1<= bodies <=90}
For values outside the above classes, the expected
output is “Invalid input”. Rest it is calculated sales.
Case ID Fans Pumps Bodies Expected
output

1 35 40 45 5100

2 0 40 45 Invalid input

3 35 0 45 Invalid input

4 35 40 0 Invalid input

5 71 40 45 Invalid input

6 35 81 45 Invalid input

7 35 40 91 Invalid input

5. Decision table -
R1 R2 R3 R4 R5 R6 R7 R8 R9

C1:fans=1 T F F F F F F F F

C2:1<=fans<=7 - T T F T F F F T
0

C3:1<=pumps< - T F T F T F F T
=80

C4:1<=bodies< - F T T F F T F T
=90

A1:terminate X
input loop

A2:invalid fans X X X X
input

A3:invalid X X X X
pumps inputs

A4:invalid X X X X
bodies inputs

A5:calculate X X X X X X X
sales &
commission
A6:proceed to X
next table

R1 R2 R3 R4

C1:sales=1 T F F F

C2:sales>0 and sales<=1500 T F F

C3:sales>1500 and T F
sales<=2000

C4:sales>2000 T

A1:terminate input loop X

A2:commission=10%*sales X

A3:commission=10% of X
1500+(sales-1500)*15%

A4:commission=10% of X
1500+15% of
500+(sales-2000)*20%

6. Cause effect graph -


C1 : 1<= fans <=70
C2 : 1<= pumps <=80
C3 : 1<= bodies <=90
C4 : 0< sales <=1500
C5 : 1500< sales <=2000
C6 : sales >2000
E1 : invalid fans input
E2 : invalid pumps input
E3 : invalid bodies input
E4 : calculate total fans, pumps and bodies
E5 : calculate sales
E6 : cannot calculate sales
E7 : commission = 10% of sales
E8 : commission = 10% of 1500 + (sales-1500) of 15%
E9 : commission = 10% of 1500 + 15% of 500 +
(sales-2000) of 20%
Experiment-6

Aim: For Commission problem, perform all white box testing


techniques:
1. Flow graph
2. DD path
3. Cyclomatic complexity
4. Identification of independent paths
White Box Testing
Program:
1. Function Commission()
2. Declare fans, pumps, bodies
3. Declare fanprice, pumpprice, bodiesprice
4. Declare totalfans, totalpump, totalbodies
5. Declare fansales, pumpsales, bodiessales
6. Declare sale, commission
7. Fanprice = 55
8. Pumpprice = 40
9. Bodiesprice = 35
10. Totalfans = 0
11. Totalpump=0
12. Totalbodies=0
13. Input (fans)
14. While(fans>=1)
15. Input(pumps, bodies)
16. Totalfans=totalfans + fans
17. Totalpumps=totalpumps + pumps
18. Totalbodies=totalbodies + bodies
19. Input (fans)
20. End while
21. Output (totalfans)
22. Output (totalpumps)
23. Output (totalbodies)
24. Fansales=fanprice*totalfans
25. Pumpsales=pumpprice*totalpumps
26. Bodiessales=bodiesprice*totalbodies
27. Sales=fansales+pumpsales+bodiessales
28. Output (sales)
29. If sales>0 then
30. Commission = 0.1*1500
31. Commission += 0.15*500
32. Commission += 0.2*(sales-2000)
33. Else if sales>1500 then
34. Commission = 0.1*1500
35. Commission += 0.15*(sales-1500)
36. Else
37. Commission = 0.1*sales
38. End if
39. End if
40. Output (commission)
41. End commission
1. Flow graph -
Mapping of program graph(nodes) with DD graph(nodes)

Flow graph nodes DD path graph nodes Remark

1-13 A Sequential node

14 B Decision node
15-19 C Sequential node

20-28 D Sequential node

29 E Decision node

30,31,32 F Sequential node

33 G Decision node

34,35 H Sequential node

36,37 I Sequential node

38 J Junction node

39 K Junction node

40,41 L Sequential node

2. DD graph -
3. Cyclomatic complexity -
Number of edges, e = 15
Number of nodes, n = 12
V(G) = e - n + 2 * P = 5

4. Identification of independent paths -


1. ABCDEFKL
2. ABCBCDEFKL
3. ABCDEFKL
4. ABCDEGHJKL
5. ABCDEGIJKL
Experiment-7

Aim: Create a test plan document for any application


Test plan: Library Management System
Table of contents:
1. Introduction
2. Purpose
3. Scope
4. Testing strategies
a. Unit testing
b. System and integration testing
c. Performance and stress testing
d. Accepting testing
5. Features to be tested
6. Hardware requirements
7. Environment requirements
8. Test schedule
9. Risk and mitigation
10. Tools

Introduction –
The traditional system to manage libraries in every institution is either
keeping track of the books in a register or keeping track of a similar
entry on the computer in csv or excel format. This type of work is fine
until one needs data from the logs.
Purpose –
The library management system is an online application for assisting
a librarian in managing a book library in ,say, a university. The system
should provide a basic set of features to add or update books. Search
for books and manage them. This test plan document supports the
following objectives:
● Identify existing project information and software that should be
tested.
● List of recommended test requirements
● Description of testing techniques to be employed
● Identify required resources and provide an estimate of test
efforts
● List the deliverables elements of test activities

Scope -
The system that is to be developed provides the related information on
students and system administrators.
● Creating a system admin who will manage system
● Admin will have login activity
● Can add/edit/delete/view the category
● Can add/edit/delete/view the books issued
● Can search for books

Testing Strategies -
Unit testing:
In order to test a single module, one needs to provide a complete
environment i.e. beside the module required:-
● Procedures belonging to other modules
● Non local data structures
● Procedure to call the function of module
Unit testing was done on each and every module.
a. Test for admin module
● Testing login interface
● Student account addition
● Book addition
b. Test for student login modules
● Test for student login interface
● Test for account creation
System and integration testing:
● UI: interface from where all inputs are given
● DBMS: location where all calculations are done and stored
● VAL: validation module
● CNI: these contents are displayed in the reports
Performance and stress testing:
Stress testing involving testing beyond normal operational opacity.
Normally this kind of test is done to determine the system’s
robustness in terms of extreme load for example multi-user testing.
User acceptance testing:
There are different types of acceptance testing. Most common is user
acceptance testing.
Features to be testing:
● GUI test
● Database test
● Base operation test
● Advanced operations test
● Checkin and checkout test
● Bill
Hardware requirements -
● OS: Windows
● IDE: VS
● Language: Python
● Browser: Chromium
● Database: MySQL
Environment Requirements -
● Mainframe: Specify both necessary and desired properties of the
test environment
● Workstation: Computers in the library to be used. Mobile phones
through which records can be viewed.

Test Schedule -

S.no Task Days Start time End time Responsibili


ty

1. Understandi 5 2 july 7 july Team


ng &
analyzing
reports

2. Generate 10 7 july 17 july Member 1


test
scenarios

3. Test case 40 7 july 17 august Member 2


documentati
on

4. Verify eno. 1 17 july 17 august Member 3


Setup

5. Unit testing 10 18 august 28 august Member 4

6. Integration 10 28 august 7 september Member 5


testing

7. Final testing 15 7 september 22 End user


september

8. Summary 1 23 23 Team
testing september september
Risk and mitigation -
● Reassigned developer staff to limited staff to avoid pending
work.
● Keeping a backup of the battery for electricity issues.
Tools -
● Selenium
● QTP
Experiment-8

Aim: Study of any open-source testing tools: (Selenium)


Theory: Selenium is a robust set of tools that supports rapid
development of test automation for web based applications. It is an
open-source tool that is used for automating the tests carried out on
web browsers. It was originally developed by Jason Huggins in 2004
as an internal tool at Thought Works. Selenium supports automation
across different browsers, platforms and programming languages.
Selenium can be easily deployed on platforms such as Windows,
Linux, Solaris and Macintosh. Moreover, it supports OS (Operating
System) for mobile applications like iOS, windows mobile and android.
It supports a variety of programming languages through the use of
drivers specific to each language. Languages supported by Selenium
include C#, Java, Perl, PHP, Python and Ruby.
Components in Selenium:
Selenium software is not just a single tool but a suite of software, each
piece catering to different Selenium QA testing needs of an
organization.
1. Selenium integrated development environment
2. Selenium remote control (RC)
3. WebDriver
4. Selenium Grid
Selenium Integrated Development Environment (IDE) is the simplest
framework in the Selenium suite and is the easiest one to learn. It is a
Firefox plugin that you can install as easily as you can with other
plugins. However, because of its simplicity, Selenium IDE should only
be used as a prototyping tool. If you want to create more advanced
test cases, you will need to use either Selenium RC or WebDriver.
Selenium RC was the flagship testing framework of the whole
Selenium project for a long time. This is the first automated web
testing tool that allows users to use a programming language they
prefer.
The WebDriver proves itself to be better than both Selenium IDE and
Selenium RC in many aspects. It implements a more modern and
stable approach in automating the browser’s actions. WebDriver,
unlike Selenium RC, does not rely on JavaScript for Selenium
Automation Testing. It controls the browser by directly communicating
with it.
Selenium Grid is a tool used together with Selenium RC to run parallel
tests across different machines and different browsers all at the same
time. Parallel execution means running multiple tests at once.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy