100% found this document useful (1 vote)
327 views

Software Testing Lab Final

The document contains test cases for the functional requirements of an online ticket booking system. It includes 15 test cases that test the ability to add, edit, delete, and access different elements of the system. Some examples of test cases include testing that a theater can be added, that only administrators can edit movies, and that the concert date cannot be set before the ticket release date. The test cases validate the input data, expected output, and actual output to determine if each test passed or failed.

Uploaded by

Unknown
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
327 views

Software Testing Lab Final

The document contains test cases for the functional requirements of an online ticket booking system. It includes 15 test cases that test the ability to add, edit, delete, and access different elements of the system. Some examples of test cases include testing that a theater can be added, that only administrators can edit movies, and that the concert date cannot be set before the ticket release date. The test cases validate the input data, expected output, and actual output to determine if each test passed or failed.

Uploaded by

Unknown
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 112

M.C.A.

-Semester V

PraPractical No. 1
Software Requirement Specification of Hotel Management System
Deficiency

Comments and Suggestions

There is no provision for changed rate &


customers feedback

There should be Module to show changed rate


and space for customers feedback

There was a confusion in the terms that who is


the customer and who is a employees of the
hotel.

We can use code name system for employees


of the hotel to avoid confusion.

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

Software Requirements Specification for Online ticket booking system


.
Defects
Customer has to fill number of forms and
Information which makes the process tedious.
There is no provision for providing updates to the
customer.

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

Movies can Pass


be deleted.

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

A band can Run as


be
applicat
removed
ion

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

Expected result Actual result


Regular
Regular

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

Using boundary value analysis (BVA) method


#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
clrscr();
int lower = 1;
int upper = 504;
int months;
cout<<"\nEnter any number of months between 1 and 504:\n";
cin>>months;
if(months<lower || months>upper)
{
cout<<"Entered number is not in given range";
}
if(months>=1 && months <= 6)
cout<<"\nTrainee";
else if( months > 6 && months <= 36 )
cout<<"\nJunior Staff";
else if(months>36 && months <=504)
cout<<"\nSenior Staff";
getch();
}

M.C.A.-Semester V

Test cases for BVA of given program:


Test case
number

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

cout"\n Your ticket can not be booked.;


getch();
}

Test cases for given program using branch coverage:


Test Cases:
Test Case

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

Using Path coverage method


Program:-

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();
}

a) Control Flow Graph

M.C.A.-Semester V

a
IF (units>=25)
THE

ELS
E

IF((units>=10 &&
units<25)

e
THEN

ELSE

IF( units>0 &&


units<10)

THE

ELSE

f
ENDIF

j
ENDIF

ENDIF

b) Determine cyclomatic complexity of the control flow graph :


Cyclomatic Complexity of a graph is calculated as:

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

d) Prepare test cases to execute each path in basic set of


Test Cases Table
Test Case

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)

Test Case Matrix

1
a,d,g,i,l,m,n

a,d,g,h,i,l,m,n
a,d,e,f,m,n

Using condition coverage method For Hotel Management System

#include<stdio.h>
#include<conio.h>
void main()
{

10

a,b,c,n

Program:

X
X

M.C.A.-Semester V

int yrs,grade,hrs,bonus; //2


printf("Enter the no of years worked : "); //3
scanf("%d", &yrs); //4
printf("\nEnter the grade : "); //5
scanf("%d", &grade); //6
printf("\nEnter the no of hours worked"); //7
scanf("%d", &hrs); //8
if(yrs > 1) //9
bonus = bonus + 10; //10
if(grade > 3) //11
bonus = bonus + 10; //12
if(hrs > 180) //13
bonus = bonus + 10; //14
getch();//15
}

Conditional Coverage:
Yrs > 1

Grade > 3

Hrs > 180

Input value
(yrs,grd,hrs)

Lines
executed

1,1,160

Possible
outcome
(bonus)
0%

1,1,185

10%

1-9, 11,

1-9, 11, 13,15

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

AIM:To create SRS for school management system.


SRS(SYSTEM REQUIREMENT AND SPECIFICATION)

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

1.Collection of forms by the Students


2.Submission of forms by the Students
3.Admission Process get started
4.Student want to cancel the admission
5.New Teacher
6.Start of working day
7.Exams get started
8.Generation of Results

M.C.A.-Semester V

9.Management request for the Salary Report


10.Management request for the Students Attendance Report
11.Management request for the Teachers Attendance Report
12.Management request for the Students Result Report
13.Students get the admission in the school

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.

R1.2 )Modify Button


Description: Modify an existing record in the database
Input: Click the Modify button
Output: The fields are altered as per the user needs.
R1.3 )Update Button
Description: Save the modified record to the database
Input: Click the update button
Output: The modified fields are saved if successful.
R1.4 ) Save Button
Description: Save a new record in the database
Input: Click the save button
Output: The fields are saved if successful.
R1.5 )Cancel Button
Description: Cancel the entered data in the fields
Input: Click the cancel button
Output: The fields are cleared and the pointer jumps to the last record.
R1.6 )Delete Button

M.C.A.-Semester V

Description: Delete an existing record in the database


Input: Click the delete button
Output: The current record is deleted
R1.7) Search by name
Description: Search through the database
Input: Enter the name 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.

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.2 )Modify Button


Description: Modify an existing record in the database
Input: Click the Modify button
Output: The fields are altered as per the user needs.
R2.3 )Update Button
Description: Save the modified record to the database
Input: Click the update button
Output: The modified fields are saved if successful.
R2.4 ) Save Button
Description: Save a new record in the database
Input: Click the save button
Output: The fields are saved if successful.
R2.5 )Cancel Button
Description: Cancel the entered data in the fields
Input: Click the cancel button
Output: The fields are cleared and the pointer jumps to the last record.
R2.6 )Delete Button
Description: Delete an existing record in the database
Input: Click the delete button
Output: The current record is deleted
R2.7) Search by name
Description: Search through the database
Input: Enter the name 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.

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

R3 : Student Attendance Details


Description
The student attendance details are entered through this form.
Input: Entered Details in the form are saved if successful.
Output: Success or error message.
R3.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.

R3.2 )Modify Button


Description: Modify an existing record in the database
Input: Click the Modify button
Output: The fields are altered as per the user needs.
R3.3 )Update Button
Description: Save the modified record to the database
Input: Click the update button
Output: The modified fields are saved if successful.
R3.4 ) Save Button
Description: Save a new record in the database
Input: Click the save button
Output: The fields are saved if successful.
R3.5 )Cancel Button
Description: Cancel the entered data in the fields
Input: Click the cancel button
Output: The fields are cleared and the pointer jumps to the last record.
R3.6 )Delete Button

M.C.A.-Semester V

Description: Delete an existing record in the database


Input: Click the delete button
Output: The current record is deleted
R3.7) Search by division
Description: Search through the database
Input: Enter the division 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.

R3.8) Search by Standard


Description: Search through the database
Input: Enter the standard 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

R4 : Staff Attendance Details


Description
The staff attendance details are entered through this form.
Input: Entered Details in the form are saved if successful.
Output: Success or error message.
R4.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.

R4.2 )Modify Button


Description: Modify an existing record in the database
Input: Click the Modify button
Output: The fields are altered as per the user needs.
R4.3 )Update Button
Description: Save the modified record to the database
Input: Click the update button
Output: The modified fields are saved if successful.
R4.4 ) Save Button
Description: Save a new record in the database
Input: Click the save button
Output: The fields are saved if successful.
R4.5 )Cancel Button
Description: Cancel the entered data in the fields
Input: Click the cancel button
Output: The fields are cleared and the pointer jumps to the last record.
R4.6 )Delete Button

M.C.A.-Semester V

Description: Delete an existing record in the database


Input: Click the delete button
Output: The current record is deleted

M.C.A.-Semester V

R5 : Pay Slip Transaction


Description
The pay slip details are entered through this form.
Input: Entered Details in the form are saved if successful.
Output: Success or error message.
R5.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.

R5.2 )Modify Button


Description: Modify an existing record in the database
Input: Click the Modify button
Output: The fields are altered as per the user needs.
R5.3 )Update Button
Description: Save the modified record to the database
Input: Click the update button
Output: The modified fields are saved if successful.
R5.4 ) Save Button
Description: Save a new record in the database
Input: Click the save button
Output: The fields are saved if successful.
R5.5 )Cancel Button
Description: Cancel the entered data in the fields
Input: Click the cancel button
Output: The fields are cleared and the pointer jumps to the last record.
R5.6 )Delete Button

M.C.A.-Semester V

Description: Delete an existing record in the database


Input: Click the delete button
Output: The current record is deleted
R5.7) Navigational Buttons
Description: Navigate through the database.
Input: Click the respective buttons
Output: The pointer is navigated to the searched record if found otherwise a failure message is
displayed.
R5.8) Pay Slip Button
Description: Generate the pay slip for the respective employees
Input: Click the pay slip button
Output: A report is displayed, containing the pay slip details

M.C.A.-Semester V

R6 :Result Transaction Details


Description
The result transaction details are entered through this form.
Input: Entered Details in the form are saved if successful.
Output: Success or error message.
R6.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.

R6.2 )Modify Button


Description: Modify an existing record in the database
Input: Click the Modify button
Output: The fields are altered as per the user needs.
R6.3 )Update Button
Description: Save the modified record to the database
Input: Click the update button
Output: The modified fields are saved if successful.
R6.4 ) Save Button
Description: Save a new record in the database
Input: Click the save button
Output: The fields are saved if successful.
R6.5 )Cancel Button
Description: Cancel the entered data in the fields
Input: Click the cancel button
Output: The fields are cleared and the pointer jumps to the last record.
R6.6 )Delete Button

M.C.A.-Semester V

Description: Delete an existing record in the database


Input: Click the delete button
Output: The current record is deleted
R6.7) Navigational Buttons
Description: Navigate through the database.
Input: Click the respective buttons
Output: The pointer is navigated to the searched record if found otherwise a failure message is
displayed.

R6.8) Get Total Button


Description: Generate the total of marks for the respective student
Input: Click the get total button
Output: The total of the marks is displayed in a field named Total, Grade and Percentage are
automatically calculated

M.C.A.-Semester V

Non Functional Requirements


1. Correct entry and not fictional data.
2. Backup of back end database must be done at periodic intervals.
3. Response time is not real time.
4. Security of data Data is not encrypted in the database, only username password facility is
to be provided
5. Must run under configuration which are mentioned previously in hardware and software
requirements.

M.C.A.-Semester V

Practical 6

Aim:

To perform black box testing of given programs


using equivalence class partitioning method.

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:

Equivalence class partitioning

Equivalence partitioning is a software testing technique that


divides the input data of a software unit into partition of data
from which test cases can be derived. In principle, test cases
are designed to cover each partition at least once. This
technique tries to define test case that uncovers classes of
errors, thereby reducing the total number of test cases that
must be developed.
In rare cases equivalence partitioning is also applied to
outputs of a software component, typically it is applied to the

M.C.A.-Semester V

inputs of a tested component. The equivalence partitions are


usually derived from the requirements specification for input
attributes that influence the processing of the test object. An
input has certain ranges which are valid and other ranges
which are invalid. Invalid data here does not mean that the
data is incorrect, it means that this data lies outside of specific
partition. This may be best explained by the example of a
function which takes a parameter "month". The valid range for
the month is 1 to 12, representing January to December. This
valid range is called a partition. In this example there are two
further partitions of invalid ranges. The first invalid partition
would be <= 0 and the second invalid partition would be >=
13.

The testing theory related to equivalence partitioning says


that only one test case of each partition is needed to evaluate
the behaviour of the program for the related partition. In other
words it is sufficient to select one test case out of each
partition to check the behaviour of the program. To use more
or even all test cases of a partition will not find new faults in
the program. The values within one partition are considered to
be "equivalent". Thus the number of test cases can be reduced
considerably.

An additional effect by applying this technique is that you also


find the so called "dirty" test cases. An inexperienced tester
may be tempted to use as test cases the input data 1 to 12 for
the month and forget to select some out of the invalid
partitions. This would lead to a huge number of unnecessary
test cases on the one hand, and a lack of test cases for the
dirty ranges on the other hand.

M.C.A.-Semester V

a) Test given programs using Equivalence class


partitioning
Program1:

//This program categorize a person according to


height

#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

height >= 250

300

Error

Program
Quits

Fail

Program Number

Line number

Actual Deficiencies

Required
Statement

16

Medium Height
categorized as Tall

else if(height <=


170)

NA

Error message not


displayed on
invalid input

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

cout<<"\nEnter height of a person in


centimeter:";
cin>>height;
if(height <= 150)
cout<<"\nShort";
else if(height <= 170)
cout<<"\nMedium";
else
cout<<"\nTall";
if(height <= 0 || height >250)
{
cout << Invalid input;
exit(1);
}
getch(); }
Program 2:

//This program categorize a person according to


weight

#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

if(weight <= 50)


cout<<"\nThin";
else if(weight <= 75 )
cout<<"\nMedium";
else
cout<<"\nFat";
if(weight <= 0 || weight >250)
{
cout << Invalid input;
exit(1);
}

getch();
}

Program3:

M.C.A.-Semester V

//This program categorize a person according to


height and weight

#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

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
cout<<"\nMedium in height and fat by
weight";
}
else
{
if(weight <= 50)

M.C.A.-Semester V

cout<<"\nTall in height and thin by


weight";
else if( weight <= 75 )
cout<<"\nTall in height and medium
by weight";
else
cout<<"\nTall in height and fat by
weight";
}
getch();
}

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:

//This program categorize a person according to


height and weight

#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

cout<<"\nMedium in height and fat by


weight";
}
else
{
if(weight <= 50)
cout<<"\nTall in height and thin by
weight";
else if( weight <= 75 )
cout<<"\nTall in height and medium
by weight";
else
cout<<"\nTall in height and fat by
weight";
}
if((height<=0 || height>=250)||(weight <= 0 ||
weight >=250))
{
cout << Invalid input;
exit(1);
}

M.C.A.-Semester V

getch();
}

b) Apply Equivalence class partitioning method


of testing an application School Management
System
Application: School Management system
Module: Staff Details
Type of testing: Black box(Equivalent class partitioning)
Field: Phone number
Test
case
number

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

Application: School Management system


Module: Staff Details
Type of testing: Black box(Equivalent class partitioning)
Field: Basic Payment
Test case
number

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

Application: School Management system


Module: Staff Details
Type of testing: Black box(Equivalent class partitioning)
Field: Date of Birth
Test
case
number

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

Application: School Management system


Module: Staff Details
Type of testing: Black box(Equivalent class partitioning)
Field: Date Of Retirement
Test case
number

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

Application: School Management system


Module: Staff Details
Type of testing: Black box(Equivalent class partitioning)

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

Note: Upper limit is the last record in the


particular table in the database
Application: School Management system
Module: Student Details
Type of testing: Black box(Equivalent class partitioning)
Field: Standard
Test case
number

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

Application: School Management system


Module: Student Details

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

Application: School Management system


Module: PaySlip Details
Type of testing: Black box(Equivalent class partitioning)
Field: Dearness Allowance(DA)
Test case
number

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

Application: School Management system


Module: PaySlip Details
Type of testing: Black box(Equivalent class partitioning)
Field: Travelling Allowance (TA)
Test case
number

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

Application: School Management system


Module: PaySlip Details
Type of testing: Black box(Equivalent class partitioning)
Field: Housing Rent Allowance Allowance(HRA)
Test case
number

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

Application: School Management system


Module: PaySlip Details
Type of testing: Black box(Equivalent class partitioning)
Field: Income Tax
Test case
number

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:

To perform black box testing of given programs


using boundary value analysis (BVA) method

a) Test given programs using BVA


b) Find out any defect in given program
c)Apply BVA for School Management system

Description:
Boundary value analysis

M.C.A.-Semester V

Boundary value analysis is a software testing design technique in which


tests are designed to include representatives of boundary values.
Values on the edge of an equivalence partition or at the smallest value
on either side of an edge. The values could be either input or output
ranges of a software component. Since these boundaries are common
locations for errors that result in software faults they are frequently
exercised in test cases.
The boundaries are the values on and around the beginning
and end of a partition. If possible test cases should be created
to generate inputs or outputs that will fall on and to either
side of each boundary. This would result in three cases per
boundary. The test cases on each side of a boundary should be
in the smallest increment possible for the component under
test. In the example above there are boundary values at 0,1,2
and 11,12,13. If the input values were defined as decimal
datatype with 2 decimal places then the smallest increment
would be the 0.01.
Where a boundary value falls within the invalid partition the
test case is designed to ensure the software component
handles the value in a controlled manner.Boundary value
analysis can be used throughout the testing cycle and is
equally applicable at all testing phases.
After determining the necessary test cases with equivalence
partitioning and subsequent boundary value analysis, it is
necessary to define the combinations of the test cases when
there are multiple inputs to a software component.

M.C.A.-Semester V

a) Testing given programs using BVA

M.C.A.-Semester V

// This program accepts any number between


1000 and 10000 (including both) and checks
whether it is prime or not.

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

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 == 1)
{
cout<<"entered number is prime";
}
getch();
}

M.C.A.-Semester V

Test cases for BVA of given program:

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

b) Find out any defect in given program


Defect/ Deficiency in given program:

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

c) Apply BVA for School Management system


Application: School Management system
Module: Student Details
Type of testing: Black box(BVA)
Field: Standard of a student

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

Application: School Management system


Module: Staff Details
Type of testing: Black box(BVA)
Field: Phone number
Test case
number

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

Application: School Management system


Module: Staff Details
Type of testing: Black box(BVA)
Field: Basic Payment
Test case
number

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

Application: School Management system


Module: Staff Details
Type of testing: Black box(BVA)
Field: Search By ID
Test case
number

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

ID= Upper limit

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

Note: Upper limit is the last record in the


particular table in the database

M.C.A.-Semester V

Application: School Management system


Module: Student details
Type of testing: Black box(BVA)
Field: Total Annual Income
Test case
number

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

Application: School Management system


Module: PaysSlip Details
Type of testing: Black box(BVA)
Field: Dearness Allowance (DA)
Test case
number

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

Application: School Management system


Module: PaysSlip Details
Type of testing: Black box(BVA)
Field: Travelling Allowance (TA)
Test case
number

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

Application: School Management system


Module: PaysSlip Details
Type of testing: Black box(BVA)
Field: Housing Rent Allowance (HRA)
Test case
number

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

Application: School Management system


Module: PaysSlip Details
Type of testing: Black box(BVA)
Field: Income Tax
Test case
number

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

Income Tax <0

-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

0<= Income Tax


<=15000

700

It
Should
accept

Incom
e Tax
is
accept
ed

Pass

M.C.A.-Semester V

Application: School Management system


Module: PaysSlip Details
Type of testing: Black box(BVA)
Field: Provident Fund
Test case
number

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:

To perform white box testing of given programs


using branch coverage method

d) Test given programs using branch coverage


e) Apply branch coverage method for School
Management system

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

This sounds great because it takes a more in-depth view of the


source code than simple statement coverage, but branch
coverage can also leave you wanting more.
Determining the number of branches in a method is easy.
Boolean decisions obviously have two outcomes, true and
false, whereas switches have one outcome for each caseand
don't forget the default case! The total number of decision
outcomes in a method is therefore equal to the number of
branches that need to be covered plus the entry branch in the
method (after all, even methods with straight line code have
one branch).

d) Testing given programs using Branch


coverage method

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 for given program using branch


coverage:

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

e) Apply branch coverage method for Hospital


Management system

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

Private Sub Form_Load()


frmsplash.Height = Picture1.Height
frmsplash.Width = Picture1.Width
x=0
End Sub

Private Sub Timer1_Timer()


If x < 100 Then
x = x + 15
Else
frmMain.Show
Unload Me

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:

To perform white box testing of given programs


using path coverage method

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.

f) Draw control flow graph for following program


Program:

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;

Control Flow Graph

M.C.A.-Semester V

g) Determine cyclomatic complexity of the


control flow graph

M.C.A.-Semester V

Find out:
E = 16
N = 13
And hence
V(G) = 16 13 + 2
V(G)=5

The value of V(G) tells us the upper bound on the


size of the basic ser. That is it gives us the
number of independent paths we need to find.

h) Find out basic set of independent path


Path 1: 1, 2, 3, 4, 12, 13

Path 2: 1, 2, 3, 5, 6, 12, 13

Path 3: 1,2,3,5,7,8,12,13

Path 4: 1, 2, 3, 5, 7, 9, 10, 12, 13

Path 5: 1, 2, 3, 5, 7, 9, 11, 12, 13

M.C.A.-Semester V

i) Preapare test cases to execute each path in


basic set of
Test cases:

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

Test case matrix:

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

Test case matrix


2 3 4 5 6 7 8 9

1
0

X
X

X
X

X
X

X
X

M.C.A.-Semester V

j) Write program for following situation. Draw


control flow graph, determine cyclomatic
complexity, find independent paths, prepare
table for test cases and prepare test case
matrix for each independent path.

Designation of employee according to the salary.

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

Control Flow Graph

M.C.A.-Semester V

k) Determine cyclomatic complexity of the


control flow graph
Find out:
E = 16
N = 13
And hence
V(G) = 16 13 + 2
V(G)=5

The value of V(G) tells us the upper bound on the


size of the basic ser. That is it gives us the
number of independent paths we need to find.

l) Find out basic set of independent path


Path 1: 1, 2, 3, 4, 13

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

Path 5: 1, 2, 3, 5, 7, 9, 11, 12, 13

M.C.A.-Semester V

m) Preapare test cases to execute each path in


basic set of

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

Test case matrix:

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

Test case matrix


2 3 4 5 6 7 8 9

1 1
0 1

X X
X

X
X

X
X

X
X

M.C.A.-Semester V

Practical 10
Aim:

To perform white box testing of given programs


using condition coverage method

Description:

Various condition coverage methods


Condition coverage reports the true or false
outcome of each boolean sub-expression,
separated by logical-and and logical-or if they
occur. Condition coverage measures the subexpressions independently of each other.
This metric is similar to decision coverage but
has better sensitivity to the control flow.

Multiple Condition Coverage


Multiple condition coverage reports whether
every possible combination of boolean subexpressions occurs. As with condition coverage,
the sub-expressions are separated by logical-and
and logical-or, when present. The test cases

M.C.A.-Semester V

required for full multiple condition coverage of a


condition are given by the logical operator truth
table for the condition.
For languages with short circuit operators such
as C, C++, and Java, an advantage of multiple
condition coverage is that it requires very
thorough testing. For these languages, multiple
condition coverage is very similar to condition
coverage.
A disadvantage of this metric is that it can be
tedious to determine the minimum set of test
cases required, especially for very complex
boolean expressions. An additional disadvantage
of this metric is that the number of test cases
required could vary substantially among
conditions that have similar complexity.

M.C.A.-Semester V

Assign statement number to each statement in


following program

Program:

#include<stdio.h>
#include<conio.h>

Statem
ent
number

Statement

void main(){

int year,rem_4,rem_100,rem_400;

printf("Enter the year to be tested");

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

1175 Not leap


year

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

2000 Leap Year

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

You might also like