Software Testing Lab Final
Software Testing Lab Final
-Semester V
PraPractical No. 1
Software Requirement Specification of Hotel Management System
Deficiency
Function Requirement
1. Reservation/Booking
1.1. The system shall record reservations.
1.2. The system shall record the customers first name.
1.3. The system shall record the customers last name.
1.4. The system shall record the number of occupants.
1.5. The system shall record the room number.
1.6. The system shall display the default room rate.
1.6.1. The system shall allow the default room rate to be changed.
1.6.2. The system shall require a comment to be entered, describing the reason for
changing the default room rate.
1.7. The system shall record the customers phone number.
1.8. The system shall display whether or not the room is guaranteed.
1.9. The system shall generate a unique confirmation number for each reservation.
1.10. The system shall automatically cancel non-guaranteed reservations if the customer has
not provided their credit card number by 6:00 pm on the check-in date.
1.11. The system shall record the expected check-in date and time.
1.12. The system shall record the expected checkout date and time.
1.13. The system shall check-in customers.
1.14. The system shall allow reservations to be modified without having to reenter all the
customer information.
1.15. The system shall checkout customers.
1.15.1. The system shall display the amount owed by the customer.
1.15.2. To retrieve customer information the last name or room number shall be used
1.15.3. The system shall record that the room is empty.
1.15.4. The system shall record the payment.
1.15.5. The system shall record the payment type.
1.16. The system shall charge the customer for an extra night if they checkout after 11:00
a.m.
1.17. The system shall mark guaranteed rooms as must pay after 6:00 pm on the check-in
date.
The system shall record customer feedback.
M.C.A.-Semester V
2. Food
2.1. The system shall track all meals purchased in the hotel (restaurant and room service).
2.2. The system shall record payment and payment type for meals.
2.3. The system shall bill the current room if payment is not made at time of service.
2.4. The system shall accept reservations for the restaurant and room service.
3. Management
3.1. The system shall display the hotel occupancy for a specified period of time (days;
including past, present, and future dates).
3.2. The system shall display projected occupancy for a period of time (days).
3.3. The system shall display room revenue for a specified period of time (days).
3.4. The system shall display food revenue for a specified period of time (days).
3.5. The system shall display an exception report, showing where default room and food
prices have been overridden.
3.6. The system shall allow for the addition of information, regarding rooms, rates, menu
items, prices, and user profiles.
3.7. The system shall allow for the deletion of information, regarding rooms, rates, menu
items, prices, and user profiles.
3.8. The system shall allow for the modification of information, regarding rooms, rates, menu
items, prices, and user profiles.
The system shall allow managers to assign user passwords
M.C.A.-Semester V
Comments/Suggestion
Try to ask for only necessary information from the
customer so that the processing will be quicker.
There should be some email facilities to provide
updates to the customer.
Functional Requirements:
FR1: Allow all registered users to purchase tickets for concerts.
FR2: Allow someone to register to become a user.
FR3: The system will send out automated emails to validated users.
FR4: The user signup form should test that the form is filled in by a human and not a computer program.
FR5: Allow admin/staff users to add:
Theaters
Movies
Show Time
Cities/Towns
FR6: Allow admin/staff users to edit and delete:
Theaters
Movies
Show time
FR6: The System will allow for semi automated emails, including:
Birthday emails
Movie Update emails
FR7: The system will allow clients to search for theaters by:
City/Town
FR8: A client user should be able to edit some of their information
Contact Details
o Address
o Telephone Number
o Email address
Credit Card Details
Password
FR9: The system will allow admin/staff users to make changes to certain settings including:
Database
o Username
o Password
o Database Name
Style and Formatting, without having to edit any PHP or CSS code.
FR10: The website should be simple to use for both client and staff so that a manual is not required for
either user, although some tool tips may be required on the administration side of the site.
M.C.A.-Semester V
Practical No. 2
Unit Testing For Online Ticket Booking System
Sr. Requir
No ement
.
1 FR5
Test
Case
Id
TCI
_1
Test Case
Objective
Prereq
uisite
Descrip
tion
Input data
Expected
Output
Actual
Output
Resu
lt
A Theater
name can
be added
to the
system
Run as
applicat
ion
Enter
the
details
and
click
submit
A staff user
should be
able to add
information
into the
system.
Staff users
are able to
add
theaters to
the system
Pass
2 FR5
TCI
_2
Only
Run as
administrat applicat
ors and
ion
data entry
staff can
add
informatio
n
Enter
the
details
and
click
submit
Theater
Name Art
Centre,
Town/City
Aberystwyth,
Capacity
2500
Login name:
Test user
Password:
TestUser
only
Pass
administrat
ors and
data entry
staff can
add
information
.
3 FR6
TCI
_5
That a
movie
informatio
n can be
updated
select
movie
and
click
delete
button
4 FR6
TCI
_6
Only
Run as
administrat applicat
ors and
ion
data entry
staff can
edit
movies
Browse
direct
link for
edit
movies
Browse
direct link
for edit
movies
Only staff
set as
administrat
ors and
data entry
staff should
be able to
gain access
to add
information
A staff user
should be
able to
update
information
about a
movie that
exists in
the system.
Only staff
set as
administrat
ors and
data entry
staff should
be able to
gain access
to edit
movies.
5 FR6
TCI
_7
A movie
can be
removed
select
movie
and
click edit
button
A staff user
should be
able to
Run as
applicat
ion
Run as
applicat
ion
Movies
Pass
information
can be
edited.
only
administrat
ors and
data entry
staff can
edit movies
Pass
M.C.A.-Semester V
6 FR5
TCI
_10
A Show
Time can
be added.
Run as
applicat
ion
7 FR6
TCI
_13
A Show
Time can
be updated
Run as
applicat
ion
8 FR6
TCI
_15
9 FR5
TCI
_18
A city /
town can
be added.
Run as
applicat
ion
10 FR5
TCI
_19
When a
city / town
is added
all require
fields have
been filled
in
Run as
applicat
ion
filled
out
informat
ion click
edit
button
Enter
the
details
and
click
submit
remove a
movie from
the system
Select
show
time
filled
out
informat
ion and
click
edit
select
band
and
click
delete
button
Enter
the
details
and
click
submit
click edit
button
click
submit
City/town:
click delete
button
City/town:
Bristol
A
staff/admin
user should
be able to
add
information
about a
show time
of a movie
to the
system.
A staff user
should be
able to
update a
show time
that exists
on the
system.
A Show
Time can
be added to
the
database.
Pass
A Show
time can be
updated
Pass
A staff user
should be
able to
remove a
band from
the system.
A staff user
should be
able to add
information
about a
town or a
city into
the system.
a band can
be deleted.
Pass
If a staff
user tries to
add a city /
town and
leaves a
required
field blank
all required
fields must
be filled in
before the
data is
added to
the
A city/town Pass
can be
added.
Pass
M.C.A.-Semester V
11 FR5
TCI
_20
A city /
town
cannot be
added
twice
Run as
applicat
ion
Fill out
city/tow
n name
and
click
submit
City/town:
Bristol
12 FR6,
TCI
_24
A theater
cannot
have two
movies
booked on
the same
time.
Run as
applicat
ion
add
movies
on same
time
Movie :The
Lost World
The
concert
date
cannot be
after the
release
date for
the tickets
Run as
applicat
ion
a staff
user
tries to
add a
concert
with the
ticket
release
date set
after the
concert
date
they are
returned
to the
click submit
button
13 FR5,
FR6
TCI
_26
Show Time:
3.00 p.m.5.30p.m.
they are
returned to
the concert
form and
informed
of the error.
If a staff
user tries to
add a city
with the
same name
as another
city they
are
returned to
the concert
form and
informed
of the error.
If a staff
user tries to
add a
concert for
a movie
when one
is already
booked for
that time
they are
returned to
the Show
time form
and
informed
of the error.
database.
If a staff
user tries to
add a
concert
with the
ticket
release date
set after the
concert
date they
are
returned to
the concert
form and
informed
if the
Pass
release date
is after the
concert
date the
concert
will not be
added and
the user
will
returned to
the concert
form and
informed
of the error.
a town or
city cannot
be added
twice.
Pass
A movie
Pass
cannot be
added if
there is
already a
booking for
that movie
on that
time.
M.C.A.-Semester V
14
FR2
TCI
_32
it is
possible
for nonmembers
of the site
to sign up
to become
a member.
Run as
applicat
ion
15
FR2
TCI
_34
a client is
not able to
sign up
without
the
password
in the
password
and re-
Run as
applicat
ion
concert
form
filled
out
details
and
click
submit
button
filled
out user
name
and
passwor
d and
click
login
button
of the error.
First Name
Mark,
Surname
Bradley,
Email
Address
mdb2@aber.
ac.uk, Date
of Birth 11
June
1984,Addres
s Line 1
108D,Addres
s Line 2
Pentre Jane
Morgan,Tow
n
Aberystwyth,
County
Ceredigion,P
ostcode
SY23
3TG,Telepho
ne Number
0132244184
8,User Name
mdb2,Passw
ord
password,Car
d Type: Card
B,Card
Number
0123987456,
Start Date:
07/2003,Expi
ry Date:
10/2008,Secu
rity Code
951
click login
button
Upon
completion
of the
client form
the user
should be
registered
with the
site.
Test passed
users are
able to sign
up for the
site using
the client
form.
Pass
The client
should not
be able to
sign up in
the site if
the both
passwords
do not
match.
Users are
able to
change
their
address
details
once they
have
logged into
Pass
M.C.A.-Semester V
enter
password
fields
matching.
That a
client user
can edit
their
address
details
once they
have
signed in
16
FR9
TCI
_35
17
FR9
TCI
_36
That a
client user
can edit
their credit
card
details
once they
have
signed in.
18
FR9
TCI
_37
19
FR8
TCI
_38
the site.
Run as
applicat
ion
filled
out
address
info and
click
edit
button
click edit
button
Run as
applicat
ion
filled
out
credit
cart
details
and
click
edit
button
click edit
button
That a
Run as
client user applicat
can change ion
their
password
once they
have
signed in.
click
change
passwor
d link
and
change
passwor
d
click change
password
button
Basic
Search for
a city
returns
correct
results.
select
city and
search
concerts
click search
button
Run as
applicat
ion
A client
should be
able to edit
their
address
details
once they
have
logged into
the
website.
A client
should be
able to edit
their credit
card details
once they
have
logged into
the
website.
A client
should be
able to edit
their
password
once they
have
logged into
the
website.
The user
should be
shown all
of the
concerts in
the town
selected in
the drop
down
menu.
Pass
Users are
able to
change
their credit
card details
once they
have
logged into
the site.
Pass
Users are
able to
change
their
password
once they
have
logged into
the site.
Pass
User was
Pass
shown a
list of all
concerts in
the selected
city.
M.C.A.-Semester V
Practical No. 3
Black box testing for Hotel management system
Using equivalence class partitioning method
Program:
#include<iostream.h>
#include<conio.h>
void main(){
clrscr();
int amount;
cout<<"\nEnter affordable amount for a room:";
cin>>amount;
if(amount <= 2000)
cout<<"\nRegular";
else if(amount < 4000)
cout<<"\nDelux";
else
cout<<"\nSuperDelux";
getch();}
M.C.A.-Semester V
Test no.
T1.1
Pre requisite
Input values
Amount
3000
<=2000
T1.2
2001<=
4000
Amount
<=4000
T1.3
Amount <=0
-500
T1.4
Amount
4002
>=4001
T1.5
Amount
1000
>=2000
Program Number
Line number
1
12
2
NA
Remarks
Pass
Delux
Super Delux
Fail
Error
Super Delux
Regular
Super Delux
Fail
Pass
Error
Regular
Fail
Actual Deficiencies
Delux room is
categorized as Super
Delux
Error message not
displayed on invalid
input
Required Statement
else if(amount<=4000)
if(amount <= 0 ||
amount >1000 )
M.C.A.-Semester V
M.C.A.-Semester V
Prerequisite
Input value
Expected
result
Actual result
Remark
months=1
Trainee
Message
Trainee
Pass
months=504
504
Senior Staff
Message
Senior Staff
Pass
months=0
Not in range
Message
Entered
number is not
in given
range
Pass
months=505
505
Not in range
Message
Entered
number is not
in given
range
Pass
months=35
35
Junior staff
Message
Junior Staff
Pass
M.C.A.-Semester V
Practical No. 4
White box testing for Online Ticket booking system
Using branch coverage method
Program:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int count = 0;
char section = ; // Balcony or Upperstall
bool success;
int availableInBalcony = 50
int availableInUpperstall = 75
cout<<"\nEnter length:";
cin>> count;
cout<<"\nEnter section:";
cin>> section;
success = 0;
while(count <= 100&& count >=0)
{
if(section = Balcony)
{
if (count < = availableInBalcony )
{
availableInBalcony = availableInBalcony - count;
success = 1;
}
}
else
{
if (count < = availableInUpperstall)
{
availableInUpperstall = availableInUpperstall - count;
success = 1;
}
}
}
if (success = 1)
cout"\n Your ticket is booked successfully.;
else
M.C.A.-Semester V
Input Value
Expected Output
Actual Output
Remark
Number
Count
Section
48
48
Pass
70
70
Pass
43
43
Pass
64
64
Pass
-5
MSG
MSG
Pass
102
MSG
MSG
Pass
10
33
33
Pass
34
MSG
MSG
Pass
-10
MSG
MSG
Pass
10
101
MSG
MSG
Pass
Section Notation:
B=Available Balcony
U=Available Upper Stall
MSG= Your ticket cannot be booked
M.C.A.-Semester V
Branch/Loop
Possible
Test Cases
values
Count<=100
F
Count<=B
*
*
T
F
10
F
Count<=U
*
*
*
*
M.C.A.-Semester V
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int charges=0;
int units=0;
int dis=0;
cout<<"\n Enter numbar of tickets :";
cin>>units;
if(units>=25)
{
dis=(500*units)/100;
charges=(units*20)-dis;
}
else
if(units>=10 && units<25)
{
dis=(200*units)/100;
charges=(units*20)-dis;
}
else
if(units>0 && units<10)
charges=units*20;
else
cout<<"\n Number of tickets entered is INVALID";
cout<<"\n Amount of bill=Rs."<<charges;
getch();
}
M.C.A.-Semester V
a
IF (units>=25)
THE
ELS
E
IF((units>=10 &&
units<25)
e
THEN
ELSE
THE
ELSE
f
ENDIF
j
ENDIF
ENDIF
M.C.A.-Semester V
v(G) =e n + 2
Where,
e = number of edges in the graph
n=number of nodes in the graph
Here,
e=14
n=12
And hence
v(G) = 14 12 + 2
=4
c) Find out basic set of independent path
Path 1: a-d-g-i-k-l-m-n
Path 2: a-d-g-h-j-l-m-n
Path 3: a-d-e-f-m-n
Path 4: a-b-c-n
Input Values
Expected Output
Actual Output
Remark
M.C.A.-Semester V
Number
1
100
100
Pass
25
375
375
Pass
10
180
180
Pass
MSG
MSG
Pass
-5
MSG
MSG
Pass
140
140
Pass
27
405
405
Pass
12
216
216
Pass
29
435
435
Pass
10
32
480
480
Pass
e) Test Matrix:
Path(e.g. 1-2-3-4-19)
1
a,d,g,i,l,m,n
a,d,g,h,i,l,m,n
a,d,e,f,m,n
#include<stdio.h>
#include<conio.h>
void main()
{
10
a,b,c,n
Program:
X
X
M.C.A.-Semester V
Conditional Coverage:
Yrs > 1
Grade > 3
Input value
(yrs,grd,hrs)
Lines
executed
1,1,160
Possible
outcome
(bonus)
0%
1,1,185
10%
1-9, 11,
M.C.A.-Semester V
1,5,100
10%
1,4,190
20%
13-15
1-9,
11-13,15
1-9, 11-15
3,2,50
10%
1-11, 13,15
3,2,200
20%
1-11, 13-15
3,4,100
20%
1-13, 15
3,5,200
30%
1-15
Practical 5
M.C.A.-Semester V
1: Introduction
The project for the Zilla Parishad School will prove very useful since it is very much reliable
and GUI based.
A) Background
The Proposed project has many advantages over the present existing project. The main
features of the proposed project are as follows: The project is fully GUI based with many user-friendly features.
It has high data security due to the presence of login passwords.
There are many validations at most places to prevent invalid data entries.
High durability of the data as compared to the present system.
Searching of previously entered data on just entering the primary key.
Report generation as per the most common needs of management.
Additional supports provided during entry of data.
B)Overall Description
M.C.A.-Semester V
c) Environment Characteristics
The front end of the system is in Visual Basic & back end is MS-Access.
i)H/W
Pentium Processor, Mouse Keyboard, 512MB Ram, Screen, Manual Operator(Clerk) for data
entry.
ii)S/W
Visual Basic 6.0, Windows XP/NT, Microsoft Access
iii)User
Clerk or data entry operator
2: Goals of implementation
The Proposed project has many advantages over the present existing project. The main
features of the proposed project are as follows: The project is fully GUI based with many user-friendly features.
It has high data security due to the presence of login passwords.
There are many validations at most places to prevent invalid data entries.
High durability of the data as compared to the present system.
Searching of previously entered data on just entering the primary key.
Report generation as per the most common needs of management.
Additional supports provided during entry of data.
M.C.A.-Semester V
3: Functional Requirement
R1 : Staff Master
Description
The staff details are entered through this form.
Input: Entered Details in the form are saved if successful.
Output: Success or error message.
R1.1 )Add Button
Description: Add a new record in the database
Input: Click the add button
Output: The fields are cleared and the user can enter new data.
M.C.A.-Semester V
R1.8) Search by ID
Description: Search through the database
Input: Enter the id of the staff and click the search button
Output: The pointer is navigated to the searched record if found otherwise a failure message is
displayed.
R2 : Student Master
Description
The student details are entered through this form.
Input: Entered Details in the form are saved if successful.
Output: Success or error message.
R2.1 )Add Button
Description: Add a new record in the database
Input: Click the add button
Output: The fields are cleared and the user can enter new data.
M.C.A.-Semester V
R2.8) Search by ID
Description: Search through the database
M.C.A.-Semester V
Input: Enter the id of the student and click the search button
Output: The pointer is navigated to the searched record if found otherwise a failure message is
displayed.
M.C.A.-Semester V
M.C.A.-Semester V
M.C.A.-Semester V
M.C.A.-Semester V
M.C.A.-Semester V
M.C.A.-Semester V
M.C.A.-Semester V
M.C.A.-Semester V
M.C.A.-Semester V
M.C.A.-Semester V
Practical 6
Aim:
a)
Test given programs using Equivalence
class partitioning
b)
Find out any defects in given programs
c)Apply Equivalence class partitioning method
of testing for application School management
system
Description:
M.C.A.-Semester V
M.C.A.-Semester V
#include<iostream.h>
M.C.A.-Semester V
#include<conio.h>
void main()
{
clrscr();
int height;
cout<<"\nEnter height of a person in
centimeter:";
cin>>height;
if(height <= 150)
cout<<"\nShort";
else if(height < 170)
cout<<"\nMedium";
else
cout<<"\nTall";
getch();
}
Test no.
Prerequisite
Input
values
Expected
result
Actual
result
Remarks
T1.1
height<=150
150
Short
Short
Pass
M.C.A.-Semester V
T1.2
151<=height<
=170
170
Medium
Tall
Fail
T1.3
height>=171
172
Tall
Tall
Pass
T1.4
height <= 0
-5
Error
Program
Quits
Fail
T1.5
300
Error
Program
Quits
Fail
Program Number
Line number
Actual Deficiencies
Required
Statement
16
Medium Height
categorized as Tall
NA
if(height <= 0 ||
height >170 )
cout << Input
values are not
valid
exit(1);
Corrected Program:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int height;
M.C.A.-Semester V
#include<iostream.h>
M.C.A.-Semester V
#include<conio.h>
void main()
{
clrscr();
int weight;
cout<<"\nEnter weight of a person in
kilograms:";
cin>>weight;
if(weight <= 50)
cout<<"\nThin";
else if( weight > 50 && weight <= 75 )
cout<<"\nMedium";
else
cout<<"\nFat";
getch();
}
Test no.
Prerequisit
e
Input
values
Expected
result
Actual
result
Remarks
T2.1
weight<=5
50
Thin
Thin
Pass
M.C.A.-Semester V
0
T2.2
51<=weigh
t<=75
75
Medium
Medium
Pass
T2.3
weight>=7
6
80
Fat
Fat
Pass
T2.4
weight <=
0
-5
Error
Program
Quits
Fail
T2.5
weight >=
250
255
Error
Program
Quits
Fail
Program Number
Line number
Actual Deficiencies
Required
Statement
13
Extra code
else if (weight
<=75)
Corrected Program 2:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int weight;
cout<<"\nEnter weight of a person in
kilograms:";
cin>>weight;
M.C.A.-Semester V
getch();
}
Program3:
M.C.A.-Semester V
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int height,weight;
cout<<"\nEnter height of a person in
centimeter:";
cin>>height;
cout<<"\nEnter weight of a person in
kilograms:";
cin>>weight;
if(height <=151)
{
if(weight <= 50)
cout<<"\nShort in height and thin by
weight";
else if( weight <= 75 )
M.C.A.-Semester V
M.C.A.-Semester V
Test no.
Prerequisite
Input
values
Expected
result
Actual
result
Remarks
T3.1
(height<=150)
and
(weight<=50)
height =
150
Short in
height
and thin
by
weight
Short in
height
and thin
by
weight
Pass
(height<=150)
and
(51<=weight<=
75)
height =
Short in
height
and
medium
by
weight
Short in
height
and
medium
by
weight
Pass
(height<=150)
and
(weight>=76)
height =
Short in
height
and fat
by
weight
Short in
height
and fat
by
weight
Pass
(151<=height<
=170) and
height =
Medium
in height
Medium
in
Pass
T3.2
T3.3
T3.4
weight
=50
weight
=
weight
=
M.C.A.-Semester V
T3.5
T3.6
T3.7
T3.8
T3.9
T3.10
(weight<=50)
weight
=
and thin
by
weight
height
and thin
by
weight
(151<=height<
=170) and
(51<=weight<=
75)
height =
Medium
in height
and
medium
by
weight
Medium
in
height
and
medium
by
weight
Pass
(151<=height<
=170) and
(weight>=76)
height =
Medium
in height
and fat
by
weight
Medium
in
height
and fat
by
weight
Pass
(height>=171)
and
(weight>=76)
height =
Tall in
height
and thin
by
weight
Tall in
height
and thin
by
weight
Pass
(height>=171)
and
(weight<=50)
height =
Tall in
height
and
medium
by
weight
Tall in
height
and
medium
by
weight
Pass
(height>=171)
and
(weight>=76)
height =
Tall in
height
and fat
by
weight
Tall in
height
and fat
by
weight
Pass
(height<=0) and
(weight<=0)
height =
-5
Error
Program
quits
Fail
Error
Program
quits
Fail
weight
=
weight
=
weight
=
weight
=
weight
=
weight
=-10
T3.11
(height>=250)
and (weight
>=250)
height =
260
weight
=250
M.C.A.-Semester V
Program Number
Line number
Actual Deficiencies
Required
Statement
12
Incorrect values
if (height<=150)
Corrected Program 3:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int height,weight;
cout<<"\nEnter height of a person in
centimeter:";
cin>>height;
cout<<"\nEnter weight of a person in
kilograms:";
cin>>weight;
M.C.A.-Semester V
if(height <=150)
{
if(weight <= 50)
cout<<"\nShort in height and thin by
weight";
else if( weight <= 75 )
cout<<"\nShort in height and medium
by weight";
else
cout<<"\nShort in height and fat by
weight";
}
else if(height <= 170)
{
if(weight <= 50)
cout<<"\nMedium in height and thin
by weight";
else if( weight <= 75 )
cout<<"\nMedium in height and
medium by weight";
else
M.C.A.-Semester V
M.C.A.-Semester V
getch();
}
Prerequisite
Input
values
Expecte
d result
Actual
result
Remark
SCM_01
9000000000<=number<=9
999999999
98204696
60
It
Should
accept
Phone
number
is
accepte
d
Pass
SCM_02
Number>99999999999
98204696
6055
It
should
not be
accepte
d
Phone
number
is not
accepte
d
Pass
SCM_03
Number<9000000000
10
It
should
not be
accepte
d
Phone
number
is not
accepte
d
Pass
M.C.A.-Semester V
Prerequisite
Input
values
Expected
result
Actual
result
Remark
SCM_01
300<=basic
payment<=
15000
10000
It Should
accept
Basic
payment
is
accepted
Pass
SCM_02
Basic
Payment>15
000
15001
It should
not be
accepted
Basic
payment
is not
accepted
Pass
SCM_03
Basic
Payment
<300
299
It should
not be
accepted
Basic
payment
is not
accepted
Pass
M.C.A.-Semester V
Prerequisite
Input
values
Expecte
d result
Actual
result
Remark
SCM_01
Date of
Establishment>
Date of
Birth<Date of
Joining
05/10/19
70
It
Should
accept
Date of
birth is
accepte
d
Pass
SCM_02
Date of Joining
<= Date of Birth
05/10/20
00
It should
not be
accepte
d
Date of
Birth is
accepte
d
Fail
Note:
Date of Establishment is assumed to be
05/10/1989
Date of Joining is assumed to be 05/10/1991
M.C.A.-Semester V
Prerequisit
e
Input
values
Expected
result
Actual
result
Remark
SCM_01
Date of
Joining<=D
ate of
Retirement
05/11/19
91
It Should
accept
Date of
Retireme
nt is
accepted
Pass
SCM_02
Date of
Joining>Dat
e of
Retirement
05/09/19
91
It should
not be
accepted
Date of
Retireme
nt is
accepted
Fail
SCM_03
Date of
Retirement
>=Date Of
Establishme
nt
05/11/19
91
It should
be
accepted
Date Of
Retireme
nt is
accepted
Pass
SCM_04
Date of
Retirement
<Date Of
Establishme
nt
05/11/19
21
It should
not be
accepted
Date Of
Retireme
nt is
accepted
Fail
Note:
Date of Establishment is assumed to be
05/10/1989
Date of Joining is assumed to be 05/10/1991
M.C.A.-Semester V
Field: Search By ID
Test case
number
Prerequisite
Input
values
Expected
result
Actual
result
Remark
SCM_01
ID<1
It Should
not be
accepted
Id is not
accepted
Pass
SCM_02
0>ID<=Upper
limit
It should
be
accepted
Id is
accepted
Pass
SCM_03
ID>Upper
Limit
299
It should
not be
accepted
Id is not
accepted
Pass
Prerequisite
Input
values
Expected
result
Actual
result
Remark
SCM_01
Standard<1
It Should
not be
accepted
Standard
is not
accepted
Pass
SCM_02
0>Standard<
=9
It should
be
accepted
Standard
is
accepted
Pass
SCM_03
Standard>9
15
It should
not be
accepted
Standard
is not
accepted
Pass
M.C.A.-Semester V
Type of testing: Black box(Equivalent class partitioning)
Field: Total Annual Income
Test case
number
Prerequisit
e
Input
values
Expected
result
Actual
result
Remark
SCM_01
300<=total
annual
income<=1
5000
10000
It Should
accept
Total
Pass
Annual
Income is
accepted
SCM_02
Total
Annual
Income>15
000
15001
It should
not be
accepted
Total
Annual
Income
is not
accepted
SCM_03
Total
Annual
Income
<300
299
It should
not be
accepted
Total
Pass
Annual
Income is
not
accepted
Pass
Prerequisit
e
Input
values
Expected
result
Actual
result
Remark
SCM_01
300<=DA<
=5000
10000
It Should
accept
DA is
accepted
Pass
SCM_02
DA>5000
15001
It should
not be
accepted
DA is
not
accepted
SCM_03
DA <300
299
It should
not be
accepted
DA is not
accepted
M.C.A.-Semester V
Pass
Pass
Prerequisit
e
Input
values
Expected
result
Actual
result
Remark
SCM_01
300<=TA<
=2000
10000
It Should
accept
TA is
accepted
Pass
SCM_02
TA>2000
15001
It should
not be
accepted
TA is
not
accepted
Pass
SCM_03
TA <300
299
It should
not be
accepted
TA is not
accepted
Pass
M.C.A.-Semester V
Prerequisite
Input
values
Expected
result
Actual
result
Remark
SCM_01
300<=HRA<
=2500
10000
It Should
accept
HRA is
accepted
Pass
SCM_02
HRA>2500
15001
It should
not be
accepted
HRA is
not
accepted
Pass
SCM_03
HRA <300
299
It should
not be
accepted
HRA is
not
accepted
Pass
Prerequis
ite
Input
values
Expected
result
Actual
result
Remark
SCM_01
0<=Inco
me
Tax<=150
00
10000
It Should
accept
Income
tax is
accepted
Pass
SCM_02
Income
Tax>=Bas
ic
Payment
15001
It should
not be
accepted
Income
tax
is
not
accepted
Pass
SCM_03
Income
-299
It should
Income
Pass
M.C.A.-Semester V
Tax<0
SCM_04
Income
Tax>=Gro
ss
Payment
16000
not be
accepted
tax is
not
accepted
It should
not be
accepted
Income
tax is
not
accepted
Pass
Practical 7
Aim:
Description:
Boundary value analysis
M.C.A.-Semester V
M.C.A.-Semester V
M.C.A.-Semester V
Given program:
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
clrscr();
int lower = 1000;
int upper = 10000;
int num;
cout<<"\nEnter any number between 1000
and 10000:\n";
cin>>num;
if(num<lower || num>upper)
{
M.C.A.-Semester V
M.C.A.-Semester V
Test case
number
Prerequisit
e
Input
value
Expected
result
Actual
result
Remark
num=1000
1000
not prime
number
Message:
Not
prime
number
pass
num=1000
0
10000
not prime
number
Message:
Not
prime
number
prime
num=999
999
Not in
range
Message
Entered
number is
not in
given
range
Pass
num=1000
1
10001
Not in
range
Message
Entered
number is
not in
given
range
Pass
num in
range 1000
to 10000
1002
not prime
number
Message:
Not
prime
number
Pass
M.C.A.-Semester V
Program Line
number number
Actual
Expecte
defect/defici d
ency
stateme
nt
Flag value is If
set
(flag==0
incorrectly
)
29
Corrected program:
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
clrscr();
int lower = 1000;
int upper = 10000;
int num;
cout<<"\nEnter any number between 1000
and 10000:\n";
cin>>num;
M.C.A.-Semester V
if(num<lower || num>upper)
{
cout<<"Entered number is not in given
range";
exit(0);
}
int flag = 0;
for(int i=2;i<=num/2;i++)
{
if(num%i==0)
{
cout<<"Entered number is not prime";
flag = 1;
break;
}
}
if(flag == 0)
{
cout<<"entered number is prime";
}
getch();
M.C.A.-Semester V
M.C.A.-Semester V
Remark
Test case
number
Prerequisi
te
Input
values
Expected
result
Actual
result
SMS_SD_0
1
Standard
=1
It should
be
accepted
Standard
is
accepted
Pass
SMS_SD_0
2
Standard
= 10
10
It should
be
accepted
Standard
is
accepted
Pass
SMS_SD_0
3
Standard
<1
It should
not be
accepted
Standard
is not
accepted
Pass
SMS_SD_0
4
Standard>
10
11
It should
not be
accepted
Standard
is not
accepted
Pass
SMS_SD_0
5
1 <=
Standard
<= 10
It should
be
accepted
Standard
is
accepted
Pass
M.C.A.-Semester V
Prerequisite
Input values
Expect
ed
result
Actual
result
Remar
k
SMS_SD_
01
Number= 9000000000
9000000000
It
Should
accept
Phone
numb
er is
accept
ed
Pass
SMS_SD_
02
Number=99999999999
9999999999
9
It
should
be
accept
ed
Phone
numb
er is
accept
ed
Pass
SMS_SD_
03
Number<9000000000
10
It
should
not be
accept
ed
Phone
numb
er is
not
accept
ed
Pass
SMS_SD_
04
Number>9999999999
1000000000
0000
It
should
not be
accept
ed
Phone
numb
er is
not
accept
ed
Pass
SMS_SD_
05
9000000000<=number<=9
999999999
9820469660
It
Should
accept
Phone
numb
er is
accept
Pass
M.C.A.-Semester V
ed
M.C.A.-Semester V
Prerequisite
Input values
Expect
ed
result
Actual
result
Remar
k
SMS_SD_
01
Basic Payment=
300
300
It
Should
accept
Basic
Payme
nt is
accept
ed
Pass
SMS_SD_
02
Basic Payment =
15000
15000
It
should
be
accept
ed
Basic
Payme
nt is
accept
ed
Pass
SMS_SD_
03
Basic
Payment<300
10
It
should
not be
accept
ed
Basic
Payme
nt is
not
accept
ed
Pass
SMS_SD_
04
Basic Payement
>15000
16000
It
should
not be
accept
ed
Basic
Payme
nt is
not
accept
ed
Pass
SMS_SD_
05
300<= Basic
Payement
<=15000
700
It
Should
accept
Basic
Payem
ent is
accept
ed
Pass
M.C.A.-Semester V
Prerequisite
Input
values
Expect
ed
result
Actual
result
Remar
k
SMS_SD_0
1
ID= 1
It
Should
accept
ID is
accept
ed
Pass
SMS_SD_0
2
Upper limit
It
should
be
accept
ed
ID is
accept
ed
Pass
SMS_SD_0
3
ID<1
It
should
not be
accept
ed
ID is
not
accept
ed
Pass
SMS_SD_0
4
ID>Upper limit
Upper limit
+2
It
should
not be
accept
ed
ID is
not
accept
ed
Pass
SMS_SD_0
5
1<= ID <=Upper
limit
It
Should
accept
ID is
accept
ed
Pass
M.C.A.-Semester V
Prerequisite
Input values
Expect
ed
result
Actual
result
Remar
k
SMS_SD_
01
Total Annual
Income = 300
300
It
Should
accept
Total
Annua
l
Incom
e is
accept
ed
Pass
SMS_SD_
02
Total Annual
Income = 15000
15000
It
should
be
accept
ed
Total
Annua
l
Incom
e is
accept
ed
Pass
SMS_SD_
03
Total Annual
Income <300
10
It
should
not be
accept
ed
Total
Annua
l
Incom
e is
not
accept
ed
Pass
SMS_SD_
04
Total Annual
Income >15000
16000
It
should
not be
accept
ed
Total
Annua
l
Incom
e is
not
accept
ed
Pass
SMS_SD_
05
300<= Total
Annual Income
<=15000
700
It
Should
accept
Total
Annua
l
Pass
M.C.A.-Semester V
Incom
e is
accept
ed
M.C.A.-Semester V
Prerequisite
Input values
Expect
ed
result
Actual
result
Remar
k
SMS_SD_
01
DA = 300
300
It
Should
accept
DA is
accept
ed
Pass
SMS_SD_
02
DA = 5000
5000
It
should
be
accept
ed
DA is
accept
ed
Pass
SMS_SD_
03
DA <300
10
It
should
not be
accept
ed
DA is
not
accept
ed
Pass
SMS_SD_
04
DA >5000
6000
It
should
not be
accept
ed
DA is
not
accept
ed
Pass
SMS_SD_
05
300<= DA
<=5000
700
It
Should
accept
DA is
accept
ed
Pass
M.C.A.-Semester V
Prerequisite
Input values
Expect
ed
result
Actual
result
Remar
k
SMS_SD_
01
TA = 300
300
It
Should
accept
TA is
accept
ed
Pass
SMS_SD_
02
TA = 2000
2000
It
should
be
accept
ed
TA is
accept
ed
Pass
SMS_SD_
03
TA <300
10
It
should
not be
accept
ed
TA is
not
accept
ed
Pass
SMS_SD_
04
TA >2000
6000
It
should
not be
accept
ed
TA is
not
accept
ed
Pass
SMS_SD_
05
300<= TA
<=2000
700
It
Should
accept
TA is
accept
ed
Pass
M.C.A.-Semester V
Prerequisite
Input values
Expect
ed
result
Actual
result
Remar
k
SMS_SD_
01
HRA = 300
300
It
Should
accept
HRA is
accept
ed
Pass
SMS_SD_
02
HRA = 2500
2000
It
should
be
accept
ed
HRA is
accept
ed
Pass
SMS_SD_
03
HRA <300
10
It
should
not be
accept
ed
HRA is
not
accept
ed
Pass
SMS_SD_
04
HRA >2500
6000
It
should
not be
accept
ed
HRA is
not
accept
ed
Pass
SMS_SD_
05
300<= HRA
<=2500
700
It
Should
accept
HRA is
accept
ed
Pass
M.C.A.-Semester V
Prerequisite
Input values
Expect
ed
result
Actual
result
Remar
k
SMS_SD_
01
Income Tax = 0
It
Should
accept
Incom
e Tax
is
accept
ed
Pass
SMS_SD_
02
Income Tax =
15000
15000
It
should
be
accept
ed
Incom
e Tax
is
accept
ed
Pass
SMS_SD_
03
-5
It
should
not be
accept
ed
Incom
e Tax
is not
accept
ed
Pass
SMS_SD_
04
Income Tax
>15000
16000
It
should
not be
accept
ed
Incom
e Tax
is not
accept
ed
Pass
SMS_SD_
05
700
It
Should
accept
Incom
e Tax
is
accept
ed
Pass
M.C.A.-Semester V
Prerequisite
Input values
Expect
ed
result
Actual
result
Remar
k
SMS_SD_
01
Provident Fund =
0
It
Should
accept
Provid Pass
ent
Fund is
accept
ed
SMS_SD_
02
Provident Fund =
15000
15000
It
should
be
accept
ed
Provid Pass
ent
Fund is
accept
ed
SMS_SD_
03
Provident Fund
<0
-5
It
should
not be
accept
ed
Provid Pass
ent
Fund is
not
accept
ed
SMS_SD_
04
Provident Fund
>15000
16000
It
should
not be
accept
ed
Provid Pass
ent
Fund is
not
accept
ed
SMS_SD_
05
0<= Provident
Fund <=15000
700
It
Should
accept
Provid Pass
ent
Fund is
accept
ed
M.C.A.-Semester V
Practical 8
Aim:
Description:
Branch coverage:
A branch is the outcome of a decision, so branch coverage
simply measures which decision outcomes have been tested.
M.C.A.-Semester V
Given program:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
M.C.A.-Semester V
int length = 0;
int count = 0;
cout<<"\nEnter length:";
cin>>length;
cout<<"\nEnter count:";
cin>>count;
while(count <= 6)
{
if(length >= 100)
length = length - 2;
else
length = count * length;
count = count + 1;
}
cout"\n Length = "<<length;
getch();
}
M.C.A.-Semester V
Test cases:
Test
Input values Expect Actual Remar
Case
output k
Count Length ed
numbe
output
r
1
101
594
594
Pass
100
588
588
Pass
99
493
493
Pass
102
102
102
Pass
103
103
103
Pass
104
104
104
Pass
100
98
98
Pass
-10
55
4920
4920
Pass
-107
27016
27016
Pass
10
-100
-600
-600
Pass
M.C.A.-Semester V
Test Matrix:
Branch/lo Possib
op
le
value
Count <= T
6
Test cases
2 3 4
* *
F
Length>= T
100
F
10
M.C.A.-Semester V
Application: Hospital Management system
Module: frmsplash
Type of testing: White box(branch coverage)
Progarm:
Option Explicit
Dim x As Integer
M.C.A.-Semester V
End If
End Sub
Test cases:
Test
Input Expect Actual remark
Case
values ed
output
numbe
output
X
r
1
X=0
X=
X+15
X = X+ Pass
15
X=15
X=
X+15
X = X+ Pass
15
X=30
X=
X+15
X = X+ Pass
15
X=45
X=
X+15
X = X+ Pass
15
X=60
X=
X+15
X = X+ Pass
15
X=75
X=
X+15
X = X+ Pass
15
X=90
X=
X+15
X = X+ Pass
15
X=105 Show
main
form
Main
Pass
form is
display
M.C.A.-Semester V
ed
9
X=120 Show
main
form
Main
Pass
form is
display
ed
10
X=135 Show
main
form
Main
Pass
form is
display
ed
Test Matrix:
Branch/lo Possib
op
le
value
X < =100
T
F
Test cases
2 3 4
* * *
10
M.C.A.-Semester V
Practical 9
Aim:
Description:
Path coverage
This metric reports whether each of the possible paths in each function have
been followed. A path is a unique sequence of branches from the function entry
to the exit.
M.C.A.-Semester V
Also known as predicate coverage. Predicate coverage views paths as possible
combinations of logical conditions.
Since loops introduce an unbounded number of paths, this metric considers only
a limited number of looping possibilities. A large number of variations of this
metric exist to cope with loops. Boundary-interior path testing considers two
possibilities for loops: zero repetitions and more than zero repetitions. For dowhile loops, the two possibilities are one iteration and more than one iteration.
Path coverage has the advantage of requiring very thorough testing. Path
coverage has two severe disadvantages. The first is that the number of paths is
exponential to the number of branches. For example, a function containing 10 ifstatements has 1024 paths to test. Adding just one more if-statement doubles
the count to 2048. The second disadvantage is that many paths are impossible
to exercise due to relationships of data. For example, consider the following
C/C++ code fragment:
if (success)
statement1;
statement2;
if (success)
statement3;
Path coverage considers this fragment to contain 4 paths. In fact, only two are
feasible: success=false and success=true.
M.C.A.-Semester V
#include<iostream.h>
#include<conio.h>
Statem
ent
number
1
2
Statement
void main(){
float bill_amt = 20.0;
float charges;
int units;
cout<<Enter Number of
units:;
cin>>units;
if(units<50)
charges = units * 2.0;
else if (units < 150)
charges = units * 3.0;
else if (units < 200)
charges = units * 4.0;
else if (units < 250)
charges = units * 5.0;
M.C.A.-Semester V
else
charges = units * 6.0;
bill_amt += charges;
cout<<"Amount of bill =
Rs."<<bill_amt;
M.C.A.-Semester V
M.C.A.-Semester V
Find out:
E = 16
N = 13
And hence
V(G) = 16 13 + 2
V(G)=5
Path 2: 1, 2, 3, 5, 6, 12, 13
Path 3: 1,2,3,5,7,8,12,13
M.C.A.-Semester V
Test cases:
Test
case
numbe
r
Input
Expected
Actual
values(units) output(Bill Outpu
amount)
t
25
70
70
100
320
320
175
720
720
225
1145
1145
275
1670
1670
20
20
M.C.A.-Semester V
50
170
170
150
620
620
200
1020
1020
10
250
1520
1520
M.C.A.-Semester V
Path(e.g. 1-2-3-4-19)
1, 2, 3, 4, 12, 13
1, 2, 3, 5, 6, 12, 13
1,2,3,5,7,8,12,13
1, 2, 3, 5, 7, 9, 10,
12, 13
1, 2, 3, 5, 7, 9, 11,
12, 13
1
0
X
X
X
X
X
X
X
X
M.C.A.-Semester V
Salary
Salary<=5000
Designation
Clerk
5000<salary<=1500 Supervisor
0
15000<salary<=350 Manager
00
35000<salary<=750 Senior manager
00
75000<salary<=450 Director
000
M.C.A.-Semester V
Program:
#include<iostream.h>
#include<conio.h>
Statem
ent
number
Statement
1
2
void main()
{
float salary = 0.0;
cout<<Enter Salary:;
cin>>salary;
if(salary<=5000)
cout << "\n Clerk";
else if (salary >5000 && salary <=
15000)
cout << "\n Supervisor";
else if (salary >15000 && salary
<= 35000)
cout << "\n Manager";
else if (salary > 35000 && salary
M.C.A.-Semester V
<= 75000)
cout << "\n Senior Manager";
else if (salary > 75000 && salary
<= 450000)
cout << "\n Director";
M.C.A.-Semester V
M.C.A.-Semester V
Path 2: 1, 2, 3, 5, 6, 13
Path 3: 1, 2, 3, 5, 7, 8, 13
M.C.A.-Semester V
Path 4: 1, 2, 3, 5, 7, 9, 10, 13
M.C.A.-Semester V
Test cases:
Test
Input
Expected
case
values(un output(Bill
numbe its)
amount)
r
Actual
Output
25
Clerk
Clerk
7000
Supervisor
Supervisor
16000
Manager
Manager
36000
Senior
Manager
Senior
Manager
76000
Director
Director
Clerk
Clerk
5000
Clerk
Clerk
15000
Supervisor
Supervisor
35000
Manager
Manager
10
75000
Senior
Manager
Senior
Manager
11
450000
Director
Director
M.C.A.-Semester V
M.C.A.-Semester V
Path(e.g. 1-2-3-4-19)
1, 2, 3, 4, 13
1, 2, 3, 5, 6, 13
1,2,3,5,7,8, 13
1, 2, 3, 5, 7, 9, 10,
13
1, 2, 3, 5, 7, 9, 11,
12, 13
1 1
0 1
X X
X
X
X
X
X
X
X
M.C.A.-Semester V
Practical 10
Aim:
Description:
M.C.A.-Semester V
M.C.A.-Semester V
Program:
#include<stdio.h>
#include<conio.h>
Statem
ent
number
Statement
void main(){
int year,rem_4,rem_100,rem_400;
scanf("%d", &year);
rem_4=year%4;//5
rem_100=year%100;//6
rem_400=year%400;//7
if((rem_4 == 0 && rem_100 != 0)||
rem_400==0)//8
printf("It is a leap year.\n");//9
M.C.A.-Semester V
else//10
printf(" It is not a leap
year.\n");//11
getch();//12
}
n) Condition coverage
rem_4 == rem_100 !
0
=0
rem_400=
=0
Input
value
Possible outcome
Lines
executed
1,2,3,
4,5,6,
7,8,10
,11,12
NA
NA
NA
600
Not leap
year
1,2,3,
4,5,6,
M.C.A.-Semester V
7,8,10
,11,12
F
NA
NA
NA
100
Leap Year
1,2,3,
4,5,6,
7,8,9,
12
1,2,3,
4,5,6,
7,8,9,
12
396
Leap Year
1,2,3,
4,5,6,
7,8,9,
12
NA
NA
NA