0% found this document useful (0 votes)
4 views

Advance Software Testing Lab File

Uploaded by

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

Advance Software Testing Lab File

Uploaded by

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

NOIDA INSTITUTE OF ENGINEERING & TECHNOLOGY

GREATER NOIDA

ADVANCE SOFTWARE
TESTING LAB
BMCA0314P
Master of Computer Applications

(Session:2024-2025)
Affiliated to

Dr. A.P.J. Abdul Kalam Technical University, Lucknow (U.P.)

Under Guidance of: Submitted by:


Ms. Lakshmi Kumari ASHUTOSH PANDEY

(Asst. Professor) Roll No:.2301330140041


INDEX

Sr.No. Date List of Experiment Remark

1 Write a program in C language in


demonstration the working of thefollowing
constructs.
i) do. While
ii) while.do
iii) if…else
iv) switch
v) for

2 A program for written in C language forMatrix


Multiplication fails || introspect the causes for its
failure and write downthe possible
reasons for its failure

3 Take ATM system and study its system


specifications and report
various bugs
4 Write the test cases for banking
application.
5 Create a test plan document for any
application.(e.g.,. Library Management
System)
6 Study of any testing tool (e.g., Win runner)

7 Study of any web testing tool (e.g. Selenium)

8 Study of any bug tracking tool (e.g., Bugzilla, bug


bit)

9 Study of any test management tool (e.g., Test


Director)

10 Study of any open source-testing tool (e.g., Test Link)


Experiment 1:-Write a program to demonstrate the working of
the following constructs: 1) do...while 2) if...else 3)while 4)switch
5)for loop
A.Aim-To demonstrate the working if else construct
Objective-To understand the working of if else with different range of values and test
cases

Code:
#include<stdio.h>

int main()
{

int num1;

printf("Enter a number:");
scanf("%d",&num1);

if(num1%2==0)
{

printf("Number is Even:");
}

else
{

printf("Number is Odd:");

return 0;

}
Test Case:
Test Case No. 1
Test Case Name: Positive values with range-

Input Expected Actual Output Remarks


Output
Enter a number:8 Number is Even Number is Even Success

Enter a number:56 Number is Even Number is Even Success

Enter a number:77 Number is Odd Number is Odd Success

Enter a number:11 Number is Odd Number is Odd Success

Outputs:
Test Case
Test Case No – 2
Test Case Name – Negative Values with range-

Input Expected Actual Output Remark


Output
Enter a number: -12 Number is Even Number is Even Success

Enter a number: -88 Number is Even Number is Even Success

Enter a number: -23 Number is Odd Number is Odd Success

Enter a number: -33 Number is Odd Number is Odd Success

Output:
Test Case-3
Test Case Name-Out of Range Values testing –

Input Expected Output Actual Output Remark


8473746344749 8473746344749 -224130259 Fail

Output:
B.Aim-To demonstrate the working while construct
Objective-To understand the working of while with different range of
values and test cases

Code:
#include <stdio.h>
int main() {

int num;

printf("Enter an number: ");


scanf("%d", &num);

while (num != 0)

{ if (num % 2 ==

0)

printf("%d is even.\n", num);


else
printf("%d is odd.\n", num);

printf("Enter another integer (or enter 0 to exit): ");

scanf("%d", &num);
}

printf("Exiting the program.\n");


return 0;

}
Test Case:
Test Case No. 1
Test Case Name: Positive values with range-
Input Expected Output Actual Output Remark
Enter an number:44 44 is even 44 is even Success

Enter an number:54 54 is even 54 is even Success

Enter an number:67 67 is odd 67 is odd Success

Enter an number:97 97 is odd 97 is odd Success

Output:
Test Case
Test Case No – 2
Test Case Name – Negative Values with range-

Input Expected Output Actual Outcome Remark

Enter an number: -44 -44 is even -44 is even Success

Enter an number: -66 -66 is even -66 is even Success

Enter an number: -75 -75 is odd -75 is odd Success

Enter an number: -53 -53 is odd -53 is odd Success

Output:
Test Case
Test Case 3
Test Case Name-Out of Range Values testing –
Input Expected Output Actual Output Remark
85757849493043943 85757849493043943 1270610663 is odd Fail

758493499495 758493499495 -1715711897 Fail

Output:
C.Aim-To demonstrate the working do while construct
Objective-To understand the working of do while with different range of
values and test cases

Code:

#include <stdio.h>

int main() {
int number, factorial = 1;

printf("Enter a number: ");


scanf("%d", &number);

do {
factorial *= number;
number--;
} while (number > 1);

printf("Factorial is: %d", factorial);


return 0;
}
Test Case:
Test Case No. 1
Test Case Name: Positive values with range-
Input Expected Output Actual Output Remark
Enter a number: 4 Factorial is: 24 Factorial is: 24 Success
Enter a number: 5 Factorial is: 120 Factorial is: 120 Success

Output:

Test Case -
Test Case Name-Out of Range Values testing –
Input Expected Output Actual Output Remark
54 2.308437e+71 0 Fail
88 1.854826e+134 0 Fail

Output:
D.Aim-To demonstrate the working switch construct
Objective-To understand the working of switch with different range of
values and test cases

Code:
#include <stdio.h>

int main() {
int num, i, flag = 0;

printf("Enter:");
scanf("%d", &num);

for (i = 2; i <= num / 2; ++i) {

switch (num % i)
{case 0:
flag = 1;
break;
}
}
if (flag == 0 && num != 1)
printf("%d is a prime number.\n", num);
else
printf("%d is not a prime number.\n", num);

return 0;
}
Test Case:
Test Case No. 1
Test Case Name: Positive values with range-
Input Expected Output Actual Output Remark
Enter: 7 7 is a prime number 7 is a prime number Success
Enter: 11 11 is a prime number 11 is a prime number Success
Enter: 8 8 is not a prime number 8 is not a prime number Success
Enter: 10 10 is not a prime number 10 is not a prime number Success

Output:

Test Case
Test Case No – 2
Test Case Name – Negative Values with range-
Input Expected Output Actual Output Remark
Enter: -7 -7 is a prime number -7 is a prime number Success
Enter: -5 -5 is a prime number -5 is a prime number Success
Output:

38
Test Case - 3
Test Case Name-Out of Range Values testing –
Input Expected Output Actual Output Remark
3455345345 3455345345 prime no. -839621951 prime no. Fail
3698632659 3698632659 prime no. -596334637 prime no. Fail

Output:
E.Aim-To demonstrate the working for loop construct
Objective-To understand the working of for loop with different range of
values and test cases

Code:
#include <stdio.h>

int main() {
int num, i, flag = 0;

printf("Enter a number: ");


scanf("%d", &num);

for (i = 2; i <= num / 2; ++i)


{if (num % i == 0) {
flag = 1;
break;
}
}

if (flag == 0)
printf("%d is a prime number.\n", num);
else
printf("%d is not a prime number.\n", num)return 0;}
Test Case:
Test Case No. 1
Test Case Name: Positive values with range-
Input Expected Output Actual Output Remark
Enter a number: 4 4 is not a prime number 4 is not a prime number Success
Enter a number: 5 5 is a prime number 5 is a prime number Success
Enter a number: 11 11 is a prime number 11 is a prime number Success
Enter a number: 3 3 is a prime number 3 is a prime number Success

Output:

Test Case
Test Case No – 2
Test Case Name – Negative Values with range-
Input Expected Output Actual Output Remark
Enter a number: -22 -22 is a prime number -22 is a prime number Success
Enter a number: -4 -4 is a prime number -4 is a prime number Success
Output:
Test Case 3
Test Case Name-Out of Range Values testing –
Input Expected Output Actual Output Remark
94048574593 94048574593 is a prime no. -440705919 is a prime no. Fail
46573883984 46573883984 is a prime no. -670756272 is a prime no. Fail

Output:
Experiment 2 :- A program for written in C language for Matrix
Multiplication fails introspect the causes for its failure and write
down the possible reasons for its failure.
Objective: Understand the failures of matrix multiplication
Code:
#include <stdio.h>

int main()
{
int m, n, p, q, c, d, k, sum = 0;
int first[10][10], second[10][10], multiply[10][10];

printf("Enter number of rows and columns of first matrix\n");


scanf("%d%d", &m, &n);
printf("Enter elements of first matrix\n");

for (c = 0; c < m; c++)


for (d = 0; d < n; d++)
scanf("%d", &first[c][d]);

printf("Enter number of rows and columns of second matrix\n");


scanf("%d%d", &p, &q);

if (n != p)
printf("The multiplication isn't possible.\n");
else
{
printf("Enter elements of second matrix\n");

for (c = 0; c < p; c++)


for (d = 0; d < q; d++)
scanf("%d", &second[c][d]);

for (c = 0; c < m; c++)


{ for (d = 0; d < q; d++)
{ for (k = 0; k < p; k++) {
sum = sum + first[c][k]*second[k][d];
}

multiply[c][d] = sum;
sum = 0;
}
}

printf("Product of the matrices:\n");

for (c = 0; c < m; c++)


{for (d = 0; d < q; d++)
printf("%d\t", multiply[c][d]);

printf("\n");
}
}

return 0;
}
Test Case No 1
Test Case Name: Equal no. of rows and columns
Input Expected Output Actual Outcome Remark
Enter number of rows Product of the matrix Product of the matrix Success
and columns of first
matrix 10 8 10 8
2 17 14 17 14
2
Enter elements of first
matrix
12
23
Enter number of rows
and columns of second
matrix
2
2
Enter elements of second
matrix
44
32

Output:
Test Case No 2
Test Case Name: Columns of 1st matrix not equal to rows of 2nd matrix
Input Expected Output Actual Output Remark

Enter number of rows Product of Matrix The multiplication is not Fail


and columns of first possible
matrix
32
Enter elements of first
matrix
123
1234
Enter number of rows
and columns of second
matrix
234

Output:
Experiment 3 :- Take ATM system and study its system
specifications and report various bugs.
Features to be tested:

1. Validity of the card

2. Withdraw transaction flow of ATM

3.Authentication of the user’s

4.Dispense the cash from the account

5.Verify the balance enquiry

6. Change of PIN number

Bug_Id Bug Steps to Expected Actual Status


Description reproduce Result Result
ATM_001 Invalid Card Keep Valid card in the Welcome Screen Invalid Card Fail
ATM

ATM_002 Invalid PIN 1. Keep a valid card in Menu screen Invalid PIN Fail
entered ATM display screen is
2. Enter Authorized displayed
Person
3. Menu screen should be
displayed
ATM_003 Invalid Account 1.Enter a valid User PIN Enter the Amount Invalid Fail
type selected. number screen displayed. Account type
2.Select the withdraw screen is
option on the main displayed.
menu.
3.Choose the correct type
of account (either
savings or current
account)
ATM_004 Expired card 1. Insert an expired card The system The system Fail
Acceptance into the ATM. should reject allows the
2. Enter the PIN when the card and transaction
prompted. display an to proceed.
3. Attempt any “Expired Card”
transaction(balance message.
inquiry , Withdrawal)
ATM_005 Blocked card 1. Insert a blocked card The system The system Fail
Acceptance into the ATM. should reject allows the
2. Enter the PIN when the card and transactionto
prompted. display a proceed.
3. Attempt any “Blocked Card”
transaction(balanceinquiry, Message.
withdrawal)
ATM_006 Incorrect 1. Insert a valid card The account The account Fail
Amount and enter the correct balance should balance
Deduction PIN. decrease by the decreases
2. Select “Withdraw” withdrawn by a
and enter an amount amount. different
within the account amount.
balance.
3. Complete the
transaction.
4. Check the account
balance.

ATM_007 Incorrect 1.Insert a valid card The system The system Fail
handling of and Enter the PIN. should reject proceeds
Insufficient 2.Select “Withdraw” the transaction with the
balance. and enter an amount and display an transaction
exceeding the account “Insufficient or shows an
balance. balance” unclear
3.Complete the message. error
transaction. message.
ATM_008 Cash Dispenser 1.Insert a valid card The system The system Fail
Jam Handling and enter the PIN. should notify does not
2.Select “Withdraw” the user of the notify the
and enter a valid jam and abort user and
amount. the transaction. may
3.simulate a cash incorrectly
dispenser jam. complete
the
transaction.
ATM_009 Incorrect 1. Insert a valid card The displayed The Fail
balance display and enter the correct balance should displayed
PIN. match the balance is
2. Select “Balance actual account incorrect.
Inquiry”. balance.
3. Compare the
displayed balance with
the expected balance.
ATM_010 Weak PIN 1. Insert a valid card The system The system Fail
Acceptance and enter the correct should reject should
PIN. the new PIN and accepts the
2. Select “Change PIN”. prompt for a weak PIN
3.Enter a new PIN that stronger PIN. and
does not meet security completes
criteria(too short, the change.
repetitive digits).
4.Confirm the new PIN.
Experiment 4: Write the test cases for banking application.
Registration Page
Test Steps Expected Result Actual Result Remarks
Case
1 Verify Open the registration All required fields (name, PASS
registration page and check for email, password, etc.) are
form fields required fields present
2 Valid Fill in valid user details User is successfully PASS
registration and submit the registered and redirected to
registration form the login page
3 Invalid email Enter an invalid email Registration form should PASS
format format (e.g., missing display an error message
'@' symbol) for invalid email format
4 Password Enter a weak password Registration form should PASS
strength (e.g., less than 8 display an error message
requirements characters, no special indicating password
characters) strength requirements
5 Existing email Enter an email address Registration form should PASS
address that is already display an error message
registered in the system indicating the email
address is already in use
6 Validation for Leave optional fields Registration should be PASS
optional fields empty and submit the successful even with
registration form optional fields left empty
7 Terms and Attempt to register Registration form should PASS
conditions without accepting the display an error message
acceptance terms and conditions requiring acceptance of the
terms and conditions

Reg_04 Account Users account numbers It is not visible Fail


number is is valid and visible
visible

Reg_05 Account Accepting only 15 It is not acceptable, Fail


number digits account number because you are enter12
validation digits account number

Reg_06 Case-sensitive The name is format is The entered name does not Fail
name correct follow the format of
system

51
Reg_07 Existing This user has already This user has already Pass
account registered registered

Reg_08 Existing This user has already It is accepting your account Fail
account registered number for new
registration

Reg_09 Confirmation Received the Received the confirmation Pass


e-mail confirmation code for code for validating e-mail
validating e-mail

Reg_10 Validate You are entered correct You are enter wrong Fail
CAPTCHA CAPTCHA code CAPTCHA code
code

Reg_11 Validate You are entered correct You are entered correct Pass
CAPTCHA CAPTCHA code CAPTCHA code
code

Reg_12 Display is user E-mail is already in use E-mail is already in use Pass
friendly
message for
everyone
Login Page
Test Steps Expected Result Actual Result Remarks
Case
1 Verify login Open the login page and All required fields PASS
form fields check for required fields (email/username, password)
are present
2 Successful Enter valid credentials User should be successfully PASS
login and submit the login logged in and redirected to the
form dashboard
3 Invalid Enter invalid Login form should display an PASS
credentials email/username or error message indicating
password and submit the invalid credentials
login form
4 Forgot Click on the "Forgot User should receive a PASS
password Password" link and password reset email or be
functionality follow the password prompted to answer security
recovery process questions for password
recovery

5 Remember Me Check the "Remember User session should persist PASS


option Me" checkbox and log in after closing and reopening the
application
6 Account Attempt to log in with User account should be locked PASS
logout incorrect credentials after a specified number of
multiple times consecutive failed login
attempts
Functionalities of Registration & Login Page
Registration Page:
Test Steps Expected Result Actual Output Remark
Case
Verify Navigate to User is successfully The window displays Pass
registration the registered and redirected a massage with
with valid registration to the confirmation page successfully
data page or dashboard registered.
Verify 1.Navigate 1.An error message is The email is invalid. Fail
registration to the displayed indicating the
with registration invalid email format.
invalid page. 2.Registration is not
Email 2.Enter the successful.
invalid
email
format.
Verify 1.Navigate 1.An error message is An error message is Fail
registration to the displayed indicating the displayed indicating
with registration required fields must be the required fields
missing page. filled in. must be filled in.
required 2.Leave one
fields. more
required
fields.

Login Page:
Test Steps Expected Actual Output Remark
Case Output
Verify 1.Navigate to User is successfully User is successfully Pass
login with the login page. logged in and logged in and
valid 2.Enter valid redirected to the redirected to the
Credentials credentials. dashboard or dashboard or
homepage. homepage.
Verify 1.Navigate to Login not successful. Login not successful. Fail
login with the login page.
invalid 2.Enter invalid
credentials credentials
Verify 1.Navigate to Login not successful. Login not successful. Fail
login with the login page
empty 2.Leave the
fields email or
password field
empty.
Experiment 5:Create a test plan document for any application.(e.g.,.
Library Management System)

Objectives:
• Verify the functionality of the LMS.
• Ensure the application is user-friendly and meets performance criteria
• Identify any bugs or issues before deployment..
Scope:
This test plan will cover the following functionalities:

• User Registration
• Book Search
• Book Borrowing
• Book Return
• User Account Management

Test Cases: User Registration


Input Expected Output Actual Output Remark

Valid user details Registration successful Registration successful Pass


(name, email) message message

Missing email Error message: "Email Error message: "Email Fail


required" required"

Invalid email Error message: "Invalid Error message: "Invalid Fail


format email" email"

Test Case: Book Search


Input Expected Output Actual Output Remark

Search term: List of books containing List of books containing Pass


"Harry Potter" "Harry Potter" "Harry Potter"

Search term: Message: "No results Message: "No results Fail


"Unknown found" found"
Book"
Test Case 3: Book Borrowing

Input Expected output Actual Outcome Remark

Valid book ID Book borrowed Book borrowed Pass


and user ID successfully message successfully message
Book ID not Error message: "Book not Error message: "Book not Fail
available available" available"
User ID not Error message: "User not Error message: "User not Fail
registered found" found"

Test Case 4: Book Return

Input Expected Output Actual Output Remark


Valid book ID Book returned successfully Book returned successfully Pass
and user ID message message
Book ID not Error message: "Book was Error message: "Book was Fail
borrowed not borrowed" not borrowed"
User ID not Error message: "User not Error message: "User not Fail
registered found" found"

Test Case 5: User Account Management

Input Expected Output Actual Output Remark


Update user Success message: "Email Success message: "Email Pass
email to valid updated" updated"
Update user Error message: "Invalid Error message: "Invalid Fail
email to invalid email email
Delete account Success message: Success message: Pass
(valid user ID) "Account deleted" "Account deleted"

You might also like