Advance Software Testing Lab File
Advance Software Testing Lab File
GREATER NOIDA
ADVANCE SOFTWARE
TESTING LAB
BMCA0314P
Master of Computer Applications
(Session:2024-2025)
Affiliated to
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-
Outputs:
Test Case
Test Case No – 2
Test Case Name – Negative Values with range-
Output:
Test Case-3
Test Case Name-Out of Range Values testing –
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;
while (num != 0)
{ if (num % 2 ==
0)
scanf("%d", &num);
}
}
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
Output:
Test Case
Test Case No – 2
Test Case Name – Negative Values with range-
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
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;
do {
factorial *= number;
number--;
} while (number > 1);
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);
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;
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];
if (n != p)
printf("The multiplication isn't possible.\n");
else
{
printf("Enter elements of second matrix\n");
multiply[c][d] = sum;
sum = 0;
}
}
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
Output:
Experiment 3 :- Take ATM system and study its system
specifications and report various bugs.
Features to be tested:
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_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_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
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