Uploaded by Manikandan Manikandan

St Test cases

advertisement
Ex No:
Date:
1.SUM OF INDIVIDUAL DIGITS
Aim:
To test c program finding the sum of individual digits of a 10-digits number a single
digit is produced.
Test cases:
Test 2d
Tc-1
Tc-2
Tc-3
Tc-4
Tc-5
Tc-6
Test
Test steps Expected
description
output
Acceptance of
10 digit input
date
Nonacceptance of
character
date
Nonacceptance of
floating point
number
Actual
output
Status
Input 10 digit Accepting to
number
10 digit
number
Input a
Character x
character
should not
date x
be accepted
Accepted to success
10 digit
number
Character x
success
not accepted
Input floating
point
number
214568923
Floating
point
number not
accepted
success
Not
accepting
data more
than 10 digit
number
Result is a
single digit
number
success
Nonacceoting
SUCCESS
Floating
point
number
should not
accepted
NonInput
Not
acceptance of number
accepting
input data
more than 10 data more
greater than
digit number than 10 digit
10 digits
number
Sum of the
Result of the Result is a
digits
sum is single single digit
produces as a digit –
number
single digit
number
NonInput of a
Nonacceptance of negative
accepting
success
Tc-7
Tc-8
Tc-9
Tc-10
negativ3e
integer
number
Nonacceptance of
number as
zero
Not
acceptance of
special
character
Testing the
condition for
sum of
greater than a
Testing the
condition for
sum greater
than are equal
to a
integer
number
2015483652
Input the
number b
input data
input data
Not
accepting
data
Not
accepting
data
Success
Input a
special
character@
Not
accepting
data
Not
accepting
data
Success
Input a 10
digit number
such that
sum of the
digit.
Input 10 digit
number such
less than 0
The sum
character is a
greater than
a
The sum
character is
greater than
a
Success
The sum of
calculated is
less than a
The sum of
calculated is
less than a
Success
Ex no:
Date:
2.STUDENT MARK LIST
Aim:
To test the c program accept the inputs student name makes in subject and declare
the result as pass it the student gets maximum to in each subject: otherwise declare the
result as fail.
Test cases:
Test 1d
Tc-1
Tc-2
Tc-3
Tc-4
Tc-5
Test
Test steps Expected
description
output
Checking for
the
acceptance of
first subject
more
Checking for
the
acceptance of
second
subject mark
Checking for
the
acceptance of
3rd subject
mark
Checking for
the
acceptance of
4th subject
mark
Checking for
the
Actual
output
Status
First subject
mark is
entered
First subject
mark
accepted
First subject
mark
accepted
Success
Second
subject mark
is entered
Second
subject mark
is accepted
Second
subject mark
is accepted
Success
3rd subject
mark is
entered
3rd subject
mark is
accepted
3rd subject
mark is
accepted
Success
4th subject
mark is
entered
4th subject
mark is
accepted
4th subject
mark is
accepted
success
5th subject
mark is
5th subject
mark is
5th subject
mark is
Success
Tc-6
Tc-7
Tc-8
Tc-9
Tc-10
acceptance of
5th subject
Checking for
the non
acceptance of
negative
marks
Checking for
the result it all
subject mark
is >40
Checking for
the result it all
subject mark
<40
Checking for
the result it all
subject
mark=40
Checking for
the result it
few of the
marks is less
than 40
entered
accepted
accepted
Negative
mark <0 is
entered
Input is not
accepted
Input is not
accepted
Success
Enter all +4
first subject
mark <40
The result is
pass
The result is
pass
Success
Enter all of
the first
subject mark
<40
Enter all
subject
mark=40
The result is
fail
The result is
fail
Success
The result is
pass
The result is
pass
Success
Enter few of
first subject
mark=<40
The result is
fail
The result is
fail
success
Ex no:
Date:
3.PRIME NUMBERS
Aim:
To test to c program: program for generating n prime numbers.
Test cases:
Test 2d
Tc-1
Tc-2
Tc-3
Tc-4
Tc-5
Tc-6
Test
Test steps Expected
description
output
Checking it the
n prime
numbers are
generated
Checking it the
numbers
generated are
prime
Checking for
the non
acceptance of
negative
numbers
Checking for
the non
acceptance of
floating point
number
Checking for
non
acceptance for
character data
Checking for
the non
acceptance of
special symbols
Actual
output
Status
Input the
number of
prime number
to be 10
Input the
number of
prime number
to be 10
Input a
floating point
number
10 prime
number and
generated
10 prime
number and
generated
Success
10 numbers
are generated
and all are
prime
Input a
negative
number and it
not accepted
10 numbers
Success
are generated
and all one
prime
Input a
Success
negative
number and it
not accepted
Input a
floating point
number
Input a
floating point
number and is
not accepted
Input a
Success
floating point
number and is
not accepted
Input a
Input a
character data character data
and is not
accepted
Input special
Input a special
symbols
character and
is not
accepted
Input a
Success
character data
and is not
accepted
Input a special Success
character and
is not
accepted
Tc-7
Checking for
acceptance of
input with sign
Input number
with sign in
front
Tc-8
Checking for
prime numbers
storing from
the numbers
Tc-9
Checking for
the loop for
created then
n.ie(n+1)
Tc-10
Checking for
the loop for
created then
n.ie(n-1)
Input the
number of
required
prime
numbers
input the
number
required
prime
numbers
Input the
number of
required
prime
numbers
Input a
number with
sign in front
and it is
accepted
The prime
number starts
from skill the
not term
Input a
Success
number with
sign in front
and it is
accepted
The prime
Success
number starts
from to fill the
nth term
The prime
number
displayed up
to (n+1)
The prime
number
displayed up
to (n+1)
Success
The prime
number
displayed up
to (n-1)
The prime
number
displayed up
to (n-1)
success
Ex no:
Date:
4.SORTING AND STORING ARRAY ELEMENTS
Aim:
To test c program sort and store the elements of to arrays integers in to third list.
Test cases:
Test 2d
Tc-1
Tc-2
Tc-3
Tc-4
Tc-5
Test
Test steps Expected
description
output
Acceptance of
the number of
element list
one
Acceptance of
the number of
elements list
two
Nonacceptance of
the number of
elements is
list one is
negative
Nonacceptance of
the number of
elements in
list two is
negative
Input
acceptance
Input a
integer
number
Actual
output
Status
Number
accepted
Number
accepted
Success
Input integer Number
number
accepted
Number
accepted
Success
Input a
negative
integer
number
Number not
accepted
Number not
accepted
Success
Input a
negative
integer
number
Number not
accepted
Number not
accepted
Success
Input the
elements of
Number
accepted
Number
accepted
Success
Tc-6
Tc-7
Tc-8
Tc-9
Tc-10
for the list one
elements
Input
acceptance
for the two
elements
Checking for
the arrays
sorted and
stored in third
list
Checking for
the negative
values and
positive
values input
sort in arrays
one
Checking for
the negative
values and
positive inputs
sorting in
array
Checking for
all the inputs
with negative
values
list one
Input the
elements of
list two
Number
accepted
Number
accepted
Success
Input the
element of
the two
array
Two array
and sorted
and stored in
the third list
The arrays
Success
are stored
and sorted in
the third list
Input the
element with
both
negative and
positive
values
Input
accepted and
elements are
sorted in
third list
Input
Success
accepted and
the element
are stored in
third list
Input the
element of
array two list
both
negative and
positive
values
Input all the
elements in
both the
arrays to be
negative
Input
accepted and
the element
are sorted in
third list
Input
Success
accepted and
the elements
are sorted in
this list
Input
accepted and
elements are
sorted and
stored in the
third list
Input
success
accepted and
the elements
are sorted
and storing
the third list
Ex no:
Date:
5.STACK OPERATIONS
Aim:
To test c program experiment the operations of a stack using array implementation.
Test cases:
Test 2d
Test
Test steps
description
Tc-1
Acceptance of
maximum
element is
stack
Tc-2
Displaying
options for
stack
operations
Checking for
pushing an
element
Tc-3
Tc-4
Tc-5
Tc-6
Checking for
popping an
element
Checking for
display
element of
stack
Checking for
the
acceptance of
negative
Enter the
maximum
number of
element for
stack
The program
display the
stack
preparation
Enter an
element to
be inserted
in to
Select the
pen position
Expected
output
Actual
output
Status
Input
accepted
Input
accepted
Success
Stack
operation in
displayed
Stack
operation
inside the
stack
Element is
pushed
inside the
stack
Elements is
popped
Success
Element is
pushed
inside the
stack
Element is
popped
Success
Success
Select display The elements The element Success
option
of the stack
of the stack
displayed
are displayed
Push a
negative
integer
number
Input
accepted
Input
accepted
Success
Tc-7
Tc-8
Tc-9
Tc-10
Tc-11
Tc-12
integer
numbers
Checking for
the
acceptance of
negative float
numbers
Checking for
the
acceptance of
character data
Checking for
the
acceptance of
positive
integer
numbers
Checking for
the
acceptance of
positive float
number
Checking for
the over flow
Checking for
stack
overflow
Push a float
number
Input not
accepted
Input not
accepted
Success
Push a
positive data
Input not
accepted
Input not
accepted
Success
Push a
positive
integer
number
Input not
accepted
input not
accepted
Success
Push a
positive float
number
Input not
accepted
Input not
accepted
Success
Push the
element up
to maximum
stack size +1
Input not
accept and
display error
m array as
overflow
Pop the
element no
element in
stack and
pop again
Input not
accept and
display error
message as
“stack”
underflow
Input option Input not
not accept
accept and
displays error display error
message as
message
stack under
stack
flow
underflow
Success
success
Ex no:
Date:
6.QUEUE OPERATIONS
Aim:
To test c program: menu, draw, option for queue operation like and remove and
displays.
Test cases:
Test 2d
Tc-1
Tc-2
Test
Test steps
description
Checking for
queue
operations
being
displayed
correct
Checking for
displaying the
element at
front
Tc-3
Checking for
inserting an
element
Tc-4
Checking for
selecting an
element
Expected
output
Actual
output
Status
List of
options being
displayed for
queue
operations
Output
display for
selecting a
queue
operations
Output
display for
selecting a
queue
operations
Success
List of
options being
displayed for
queue
operations
select the
option for
displaying
front
element
Enter an
element to
be inserted
int queue
Select delete
option
Front
element is
displayed
Front
element is
displayed
Success
Element is
inserted
inside the
queue
First element
is deleted
Element is
Success
inserted
inside the
queue
First element Success
is deleted
Tc-5
Tc-6
Tc-7
Tc-8
Tc-9
Tc-10
Checking for
displaying
elements of
the queue
Checking for
the
acceptance of
negative int
number
Checking for
the
acceptance of
negative float
number
Checking for
the
acceptance of
character data
Checking for
the
acceptance of
positive
integer
number
Checking for
the
acceptance of
positive float
number
Select display The elements The elements Success
option
of the queue of the queue
are displayed display
Insert a
negative
integer
number
Input
accepted
Input
accepted
Success
Insert a
Input not
negative
accepted
float number
Input not
accepted
Success
Insert a
character
data
Input not
accepted
Input not
accepted
Success
Push a
positive
integer
number
Input
accepted
Input
accepted
Success
Push a
positive float
number
Input not
accepted
Input not
accepted
success
Ex no:
Date:
7.PALINDROME USING POINTERS
Aim:
To test the c++ program: palindrome string checking program (using pointers).
Test cases:
Test 2d
Test
Test steps
description
Tc-1
Acceptance of Input a
string of
palindrome
character only string only
with character
Testing for
Input a
palindrome
palindrome
string
string
Testing for
Input non
palindrome
palindrome
string
string
Testing for
Input a
changing in
palindrome
the code as
string
length of the
string +1
Testing for
Input a
changing the
palindrome
code an length string
of string +1
Testing for
Input a
changing in
palindrome
the code as
string
length of the
string -1
Tc-2
Tc-3
Tc-4
Tc-5
Tc-6
Expected
output
Actual
output
Status
The given
string a
palindrome
The given
string is a
palindrome
Success
The given
string is a
palindrome
The given
string is not a
palindrome
The given
string is not a
palindrome
The given
string is a
palindrome
The given
string is not a
palindrome
The given
string is not a
palindrome
success
The given
string is not a
palindrome
The given
string is not a
palindrome
Success
The given
string is not a
palindrome
The given
string is not a
palindrome
Success
Success
Success
Tc-7
Tc-8
Tc-9
Tc-10
Testing for
changing in
the code as
length of the
string -1
Testing for
string input
Testing for
changing in
the code as
length of the
string -1 for
single
character
Testing for
changing in
the code as
length of the
straight for
single
character
Input a
palindrome
string
The given
string is not a
palindrome
The given
string is not a
palindrome
Success
Input a not
character
string
Input a single
character
string
The given
string is a
palindrome
The given
character
string
The given
string is a
palindrome
The given
string is not
palindrome
Success
Input a single
character
string
The given
string is not a
palindrome
The given
string is not a
palindrome
success
success
Download