ST Practical
ST Practical
Practical:-1
Aim:-A). Create a glossary of at least five software testing terminologies
with explanations.
Software Testing is the process of evaluating a software application to ensure that it meets
specified requirements and works correctly without defects. It helps in identifying errors,
gaps, or missing requirements.
1. Test Case
A Test Case is a set of conditions, inputs, execution steps, and expected results designed to
verify a particular functionality of a software application.
2. Bug (Defect)
A Bug or Defect is an error or flaw in the software that causes it to produce incorrect or
unexpected results or behave differently from the specified requirements.
3. Verification
Verification is the process of checking whether the software is being developed according to
the specified requirements and design documents. It answers the question: “Are we building
the product right?”
4. Validation
Validation is the process of checking whether the developed software meets the user’s needs
and expectations. It answers the question: “Are we building the right product?”
5. Test Plan
A Test Plan is a formal document that describes the scope, objectives, testing approach,
resources, and schedule of testing activities.
6. Regression Testing
Regression Testing is performed to ensure that new changes or updates in the software do not
negatively affect existing functionality.
1
Software Testing (4360706) 239810307003
B). Describe why both SDLC and STLC are essential in the software
development process
1. SDLC (Software Development Life Cycle)
SDLC is a structured process followed to develop software in systematic phases such as:
Requirement Analysis
Design
Implementation (Coding)
Testing
Deployment
Maintenance
[SDLC]
Importance of SDLC:
Provides a clear roadmap for software development.
Ensures proper planning and documentation.
Reduces project risk and development cost.
Improves software quality.
Helps complete the project within time and budget.
2
Software Testing (4360706) 239810307003
Requirement Analysis
Test Planning
Test Case Development
Test Environment Setup
Test Execution
Test Closure
[STLC]
Importance of STLC:
Ensures thorough and structured testing.
Helps detect defects at early stages.
Improves software reliability and performance.
Ensures the product meets quality standards.
Reduces maintenance cost after deployment.
Why Both SDLC and STLC Are Essential
SDLC focuses on developing the software.
STLC focuses on validating and verifying the software.
SDLC ensures the product is built properly.
STLC ensures the product works correctly and meets user requirements.
3
Software Testing (4360706) 239810307003
Practical 2
Aim:-Enlist and present at least three popular testing methodology (e.g.,
Agile, Waterfall) with its advantages and disadvantages.
Theory:
A Testing Methodology is a systematic approach used to perform software testing activities
during the Software Development Life Cycle (SDLC). Different methodologies are used
depending on project requirements, size, complexity, and client needs.
Below are three popular testing methodologies:
1. Waterfall Model
Description:
The Waterfall Model is a linear and sequential software development methodology where
each phase must be completed before the next phase begins. Testing is performed only after
the development phase is completed.
[Waterfall Model]
Phases:
Requirement Analysis
Design
Implementation
Testing
4
Software Testing (4360706) 239810307003
Deployment
Maintenance
Advantages:
Simple and easy to understand.
Clear documentation at every stage.
Suitable for small projects with fixed requirements.
Easy to manage due to defined stages.
Disadvantages:
Testing starts very late.
Difficult to make changes once development begins.
Not suitable for complex or large projects.
Higher risk if requirements change.
2. Agile Methodology
Description:
Agile is an iterative and incremental methodology where development and testing are
performed simultaneously in small cycles called Sprints. It focuses on customer collaboration
and continuous improvement.
[Agile model]
Features:
Short development cycles (2–4 weeks).
Continuous feedback from clients.
5
Software Testing (4360706) 239810307003
Frequent releases.
Advantages:
Flexible to requirement changes.
Early detection of defects.
Faster delivery of working software.
Improved customer satisfaction.
Disadvantages:
Less documentation.
Requires skilled team members.
Difficult to estimate cost and time accurately.
Scope may expand frequently.
[V-model]
6
Software Testing (4360706) 239810307003
Advantages:
Early test planning.
Defects are identified at early stages.
Clear relationship between development and testing.
Suitable for projects with well-defined requirements.
Disadvantages:
Not flexible to requirement changes.
No early working prototype.
Not suitable for dynamic projects.
Conclusion of Comparison
Waterfall is best for small, fixed-requirement projects.
Agile is best for dynamic and changing requirements.
V-Model is best when quality assurance and early testing are priorities.
7
Software Testing (4360706) 239810307003
Practical 3
Aim:-Write program and design test cases for the following Control and
decision-making statement. 1) For... Loop 2) Switch...case 3) Do... While 4)
If...else
1) For Loop
Program (C Language Example)
#include <stdio.h>
int main() {
int i, sum = 0;
for(i = 1; i <= 5; i++) {
sum = sum + i;
}
printf("Sum = %d", sum);
return 0;
}
Test Cases
2) Switch Case
Program
#include <stdio.h>
int main() {
int choice = 2;
switch(choice) {
case 1:
printf("Addition");
8
Software Testing (4360706) 239810307003
break;
case 2:
printf("Subtraction");
break;
case 3:
printf("Multiplication");
break;
default:
printf("Invalid Choice");
}
return 0;
}
Test Cases
3) Do While Loop
Program
#include <stdio.h>
int main() {
int i = 1;
do {
printf("%d ", i);
i++;
} while(i <= 5);
9
Software Testing (4360706) 239810307003
return 0;
}
Test Cases
4) If Else Statement
Program
#include <stdio.h>
int main() {
int number = 10;
if(number % 2 == 0) {
printf("Even Number");
} else {
printf("Odd Number");
}
return 0;
}
Test Cases
10
Software Testing (4360706) 239810307003
Practical 4
Aim:-Design test cases for different tasks (OTP Verification, Image upload,
Age verification in Registration) in any software modules using
Equivalence partitioning, boundary value analysis, and decision table
testing techniques of Black Box Testing.
Equivalence Partitioning (EP)
Boundary Value Analysis (BVA)
Decision Table Testing
1) OTP Verification Module
Assumption:
OTP must be 6-digit numeric
Valid range: 000000 to 999999
OTP expires in 2 minutes
A) Equivalence Partitioning (EP)
11
Software Testing (4360706) 239810307003
No No Upload Failed
Minimum 18 Accepted
Maximum 60 Accepted
Overall Explanation
Equivalence Partitioning reduces the number of test cases by dividing input into valid
and invalid classes.
Boundary Value Analysis focuses on edge values where defects are most likely.
Decision Table Testing is used when output depends on multiple conditions.
Practical 5
Aim:-A) Identify system specification & design test cases for Sales Invoice
Management.
13
Software Testing (4360706) 239810307003
TC1 Valid Login Correct username & password Login Successful Pass
TC2 Invalid Correct username, wrong Error Message Pass
Password password
2) Create Invoice
14
Software Testing (4360706) 239810307003
4) Invoice Search
15
Software Testing (4360706) 239810307003
2) Passenger Details
3) Seat Selection
4) Payment Module
5) Ticket Cancellation
16
Software Testing (4360706) 239810307003
17
Software Testing (4360706) 239810307003
18
Software Testing (4360706) 239810307003
4) Additional Considerations
Login should work on different browsers.
Response time should be less than 2 seconds.
Session should expire after logout.
System should prevent unauthorized access.
Practical 7
Aim:-Develop an RTM and measure testing metrics for any two dynamic
web pages of an e-commerce website.
1) Selected Dynamic Web Pages
19
Software Testing (4360706) 239810307003
2) System Requirements
A) Product Details Page – Requirements
20
Software Testing (4360706) 239810307003
21
Software Testing (4360706) 239810307003
= (9 / 10) × 100
= 90%
3) Test Fail Percentage
Formula:
Fail Percentage = (Failed Test Cases / Executed Test Cases) × 100
= (1 / 10) × 100
= 10%
4) Defect Density (Example)
Assume:
Total Defects Found = 2
Total Pages Tested = 2
Defect Density = Total Defects / Total Modules
=2/2
= 1 defect per module
5) Interpretation of Metrics
Test Execution Rate = 100% → All test cases executed.
Pass Percentage = 90% → Good quality but needs minor fixes.
Defect Density = 1 → Moderate defect presence.
Practical 8
Aim:-Execute test cases for a travel booking app and prepare a test
summary report.
22
Software Testing (4360706) 239810307003
A) Login Module
23
Software Testing (4360706) 239810307003
D) Payment Module
4) Defect Details
D1 Flight Search System allows booking for past date High Open
5) Testing Metrics
1) Test Execution Rate
= (Executed / Designed) × 100
= (12 / 12) × 100
= 100%
2) Pass Percentage
= (Passed / Executed) × 100
= (11 / 12) × 100
= 91.67%
3) Fail Percentage
24
Software Testing (4360706) 239810307003
Practical 9
Aim:-Prepare defect report after executing test cases for registration page.
1) Module Description – Registration Page
The Registration Page allows new users to create an account by entering:
Full Name
25
Software Testing (4360706) 239810307003
Email Address
Mobile Number
Password
Confirm Password
Date of Birth
Gender
Submit Button
2) Test Execution Summary
Total Test Cases Executed = 10
Total Passed = 7
Total Failed = 3
Failed test cases resulted in defects.
3) Defect Report
A Defect Report is a document that contains detailed information about identified bugs
during testing.
Defect 1
Field Details
Defect ID DEF-01
Module Registration Page
Title System accepts invalid email format
Description The system accepts email without “@” symbol (example:
[Link])
Steps to 1. Open Registration Page 2. Enter invalid email 3. Click Submit
Reproduce
Expected Result System should display validation error message
Actual Result Registration successful
Severity High
Priority High
Status Open
Reported By Tester
Date [Enter Date]
Defect 2
Field Details
26
Software Testing (4360706) 239810307003
Defect ID DEF-02
Module Registration Page
Title Password accepted with less than minimum length
Description System accepts password with 4 characters while minimum required
is 8
Defect 3
Field Details
Defect ID DEF-03
Module Registration Page
Title Age validation not working properly
Description System allows user with age below 18 years
Steps to Reproduce Enter DOB making age 15 years
Expected Result Registration should be rejected
Actual Result Registration successful
Severity High
Priority Medium
Status Open
4) Defect Summary
27
Software Testing (4360706) 239810307003
Practical 10
Aim:-Prepare defect report after executing test cases for Withdrawn of
amount from ATM Machine.
1) Module Description – ATM Withdrawal Functionality
The ATM Withdrawal module allows a user to:
Insert ATM Card
28
Software Testing (4360706) 239810307003
Enter PIN
Select Withdrawal Option
Enter Amount
Confirm Transaction
Receive Cash
Print Receipt
2) Test Execution Summary
Total Test Cases Executed = 12
Total Passed = 9
Total Failed = 3
The failed test cases resulted in the following defects.
3) Defect Report
A Defect Report contains detailed information about the bugs identified during testing.
Defect 1
Field Details
Defect ID ATM-DEF-01
Module Withdrawal
Title System allows withdrawal with insufficient balance
Description When account balance is ₹1000 and user enters ₹2000, the system
processes transaction instead of showing insufficient balance message
Steps to 1. Insert card 2. Enter correct PIN 3. Select Withdraw 4. Enter amount
Reproduce greater than balance 5. Confirm
Expected System should display "Insufficient Balance" message
Result
Actual Result Transaction processed
Severity Critical
Priority High
Status Open
Reported By Tester
Date [Enter Date]
Defect 2
Field Details
Defect ID ATM-DEF-02
Module PIN Validation
29
Software Testing (4360706) 239810307003
Title ATM does not block card after 3 incorrect PIN attempts
Description Card remains active even after entering wrong PIN more than 3
times
Steps to Enter wrong PIN 4 times
Reproduce
Expected Result Card should be blocked after 3 failed attempts
Actual Result System allows further attempts
Severity High
Priority High
Status Open
Defect 3
Field Details
Defect ID ATM-DEF-03
Module Amount Entry
Title ATM accepts invalid denomination amount
Description System accepts ₹125 which is not multiple of ₹100
Steps to Reproduce Enter ₹125 and confirm
Expected Result System should show "Enter amount in multiples of 100"
Actual Result Transaction processed
Severity Medium
Priority Medium
Status Open
4) Defect Summary
30
Software Testing (4360706) 239810307003
6) Observation
Critical defect in balance validation must be fixed immediately.
Security defect in PIN validation is high priority.
Minor validation defect found in denomination check.
Practical 11
Aim:-A) Install and set up the Selenium WebDriver and necessary drivers
(e.g., Chrome Driver, Gecko Driver) on your system.
1) Software Requirements
Java JDK (Version 8 or above)
Eclipse IDE or IntelliJ IDEA
Selenium WebDriver JAR files
31
Software Testing (4360706) 239810307003
Chrome Browser
Mozilla Firefox Browser
Chrome Driver
Gecko Driver
Step 1: Install Java JDK
1. Download Java JDK from official Oracle website.
2. Install JDK on your system.
3. Set Environment Variables:
o Set JAVA_HOME path
32
Software Testing (4360706) 239810307003
import [Link];
import [Link];
33
Software Testing (4360706) 239810307003
@Test
public void testAddition() {
assertEquals(5, 2 + 3);
}
}
2) Install TestNG in Eclipse
TestNG is an advanced testing framework similar to JUnit but more powerful.
Steps:
1. Open Eclipse
2. Go to Help → Eclipse Marketplace
3. Search "TestNG"
4. Click Install
5. Restart Eclipse
After installation:
1. Right click Project → Configure → Convert to TestNG
2. TestNG library will be added.
Example TestNG Test:
34
Software Testing (4360706) 239810307003
import [Link];
@Test
public void testMethod() {
[Link]("TestNG is working");
}
}
IntelliJ Installation (Alternative)
In IntelliJ:
JUnit and TestNG can be added through:
o File → Project Structure → Libraries
Verification Checklist
✔ Java installed correctly
✔ Selenium JAR files added
✔ ChromeDriver working
✔ GeckoDriver working
✔ JUnit installed
✔ TestNG installed
Practical 12
Aim:-Design and run test script for a registration page using Selenium tool
and JUnit.
1) Objective
To automate testing of the Registration Page using:
Selenium WebDriver
JUnit Framework
Chrome Browser
35
Software Testing (4360706) 239810307003
2) Preconditions
Java installed
Selenium WebDriver configured
ChromeDriver added to system path
JUnit added to project
Registration page URL available
Example URL (Assumption):
[Link]
3) Test Scenario
Test Scenario: Verify successful registration with valid data.
4) Test Script using Selenium + JUnit
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import static [Link].*;
WebDriver driver;
@Before
public void setUp() {
driver = new ChromeDriver();
[Link]().window().maximize();
[Link]("[Link]
}
36
Software Testing (4360706) 239810307003
@Test
public void testRegistration() {
// Enter Name
WebElement name = [Link]([Link]("name"));
[Link]("John Doe");
// Enter Email
WebElement email = [Link]([Link]("email"));
[Link]("john123@[Link]");
// Enter Password
WebElement password = [Link]([Link]("password"));
[Link]("Pass@123");
// Confirm Password
WebElement confirmPassword = [Link]([Link]("confirmPassword"));
[Link]("Pass@123");
assertEquals(expectedMessage, actualMessage);
37
Software Testing (4360706) 239810307003
@After
public void tearDown() {
[Link]();
}
}
5) Explanation of Script
@Before → Opens browser and loads registration page
@Test → Executes test case steps
@After → Closes browser
assertEquals() → Validates expected and actual result
6) Test Execution Result
38
Software Testing (4360706) 239810307003
Faster execution
Reusable scripts
Reduces human error
Suitable for regression testing
Practical 13
Aim:-Design and run test script for a Login page and home page using
Selenium tool and TestNG.
1) Objective
To automate the testing of:
Login Page functionality
Successful redirection to Home Page
Using:
Selenium WebDriver
39
Software Testing (4360706) 239810307003
TestNG
Chrome Browser
2) Preconditions
Java installed
Selenium configured
ChromeDriver added to system path
TestNG installed in Eclipse/IntelliJ
Application URL available
Example URL (Assumption):
[Link]
3) Test Scenarios
Scenario 1:
Verify login with valid username and password.
Scenario 2:
Verify error message for invalid login.
Scenario 3:
Verify user is redirected to Home Page after successful login.
4) Test Script using Selenium + TestNG
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
WebDriver driver;
40
Software Testing (4360706) 239810307003
@BeforeMethod
public void setUp() {
driver = new ChromeDriver();
[Link]().window().maximize();
[Link]("[Link]
}
@Test(priority = 1)
public void validLoginTest() {
[Link]([Link]("username")).sendKeys("testuser");
[Link]([Link]("password")).sendKeys("Pass@123");
[Link]([Link]("loginBtn")).click();
[Link](actualTitle, expectedTitle);
}
@Test(priority = 2)
public void invalidLoginTest() {
[Link]([Link]("username")).sendKeys("wronguser");
[Link]([Link]("password")).sendKeys("wrongpass");
[Link]([Link]("loginBtn")).click();
41
Software Testing (4360706) 239810307003
@AfterMethod
public void tearDown() {
[Link]();
}
}
5) Explanation of Script
@BeforeMethod → Opens browser and loads Login page before each test
@Test → Executes test case
priority → Defines execution order
[Link]() → Validates expected result
@AfterMethod → Closes browser after test execution
6) Home Page Verification Logic
After successful login:
Page title should be "Home Page"
OR
URL should change to /home
OR
Logout button should be visible
Example Additional Validation:
[Link]([Link]([Link]("logoutBtn")).isDisplayed());
7) Test Execution Result
43