KEMBAR78
Darsh STQA1 | PDF | Software Testing | Unit Testing
0% found this document useful (0 votes)
33 views12 pages

Darsh STQA1

Uploaded by

ronipatel193
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)
33 views12 pages

Darsh STQA1

Uploaded by

ronipatel193
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/ 12

L or t

FACULTY OF ENGINEERING AND TECHNOLOGY


BACHELOR OF TECHNOLOGY

SOFTWARE TESTING AND QUALITY ASSURANCE


(203105396)

VII SEMESTER

Computer Science And Engineering Department

Laboratory Manual
Session 2024-25
Parul Institute of Technology
Software Testing and Quality Assurance

CERTIFICATE

This is to certify that

Mr./Ms Debajit Padhi with enrolment no.

210305105280 has successfully completed his/her laboratory experiments in

the SOFTWARE TESTING AND QUALITY ASSURANCE (203105396)

from the department of COMPUTER SCIENCE AND ENGINEERING

during the academic year 2024-2025.

Date of Submission:......................... Staff In Charge:...........................

Head Of Department:...........................................
INDEX

Sr. Experiment Title Page No Start Completion Sign Mark


No From To Date Date s/10
1 Advance Study of Automation
Testing

2 Design test cases using


Boundary value analysis.
3 Design test cases using
Equivalence class partitioning

4 Design independent paths by


calculating cyclometic
complexity using date problem

5 Design test cases using decision


table

6 Design independent paths by


taking DD path using date
problem

7 Using Selenium IDE, write a


test suite containing minimum 4
test cases

8 Install Selenium server and


demonstrate it using a script in
Java/PHP

9 Write and test a program to


login specific web page.
10 Write and test a program to
provide total number of objects
present/available on the page.

11 Write and test a program to


update 10 student records table
into excel file.
Parul Institute of Technology
Software Testing & Quality Assurance
B.tech 4th Year , 7-Sem
Enrollment no : 210305105280

Practical : 1

Automation Testing
Automation testing is a software testing technique that uses automated tools and
scripts to execute test cases, compare actual outcomes with expected results,
and report findings. The primary goal of automation testing is to increase the
efficiency, effectiveness, and coverage of the testing process. It reduces manual
intervention, speeds up repetitive testing tasks, and helps ensure the software is
robust and error-free.

Key aspects of automation testing include:


1. Automated Test Scripts: Predefined sequences of steps created using
automation tools to perform specific tests on the software.
2. Test Tools: Software applications like Selenium, QTP, JUnit, TestNG,
and others, which facilitate the creation, execution, and management of
automated tests.
3. Regression Testing: Automated testing is particularly useful for
regression testing, ensuring that new code changes do not adversely affect
existing functionalities.
4. Continuous Integration/Continuous Deployment (CI/CD):
Automation testing is integral to CI/CD pipelines, enabling rapid and
reliable software releases by continuously testing new code changes.
5. Repeatability and Consistency: Automated tests can be run repeatedly
with consistent results, reducing human error

There are several types of automation testing, each serving different purposes in
the software development lifecycle. Here are some of the key types:

1. Unit Testing:
o Description: Tests individual units or components of the software
to ensure each part functions correctly.
o Tools: JUnit, NUnit, TestNG.
2. Integration Testing:
o Description: Tests the interaction between integrated units or
components to identify interface defects.
o Tools: JUnit, TestNG, Postman for API testing.

1
Parul Institute of Technology
Software Testing & Quality Assurance
B.tech 4th Year , 7-Sem
Enrollment no : 210305105280

3. Functional Testing:
o Description: Verifies that the software functions according to the
specified requirements.
o Tools: Selenium, QTP/UFT, TestComplete.
4. Regression Testing:
o Description: Ensures that new code changes do not negatively
affect existing functionality.
o Tools: Selenium, QTP/UFT, Jenkins for CI/CD integration.
5. Smoke Testing:
o Description: A preliminary test to check the basic functionality of
the application before further testing.
o Tools: Selenium, QTP/UFT.
6. Sanity Testing:
o Description: A subset of regression testing, performed to verify
that specific sections of the application work correctly after minor
changes.
o Tools: Selenium, QTP/UFT.
7. Performance Testing:
o Description: Assesses the speed, responsiveness, and stability of
the application under various conditions.
o Types:
 Load Testing: Simulates multiple users to assess the
application’s behavior under expected load.
 Stress Testing: Tests the application under extreme
conditions to identify its breaking point.
 Tools: JMeter, LoadRunner, Gatling.
8. Security Testing:
o Description: Identifies vulnerabilities, threats, and risks in the
application to ensure data protection and security.
o Tools: OWASP ZAP, Burp Suite, Selenium with security testing
plugins.
9. Acceptance Testing:
o Description: Validates the end-to-end functionality of the
application and ensures it meets business requirements.
o Types:
 User Acceptance Testing (UAT): Performed by end-users.
 Operational Acceptance Testing (OAT): Ensures the
operational readiness of the application.
o Tools: Selenium, QTP/UFT.
10. GUI Testing:
o Description: Verifies the graphical user interface to ensure it meets
the specified requirements.
o Tools: Selenium, QTP/UFT, TestComplete.

2
Parul Institute of Technology
Software Testing & Quality Assurance
B.tech 4th Year , 7-Sem
Enrollment no : 210305105280

11. API Testing:


o Description: Tests the application programming interfaces (APIs)
to ensure they perform as expected.
o Tools: Postman, RestAssured, SoapUI.
12. Data-Driven Testing:
o Description: Uses external data sources (like Excel, CSV,
databases) to drive test cases and validate application behavior with
different data sets.
o Tools: Selenium with data-driven testing frameworks, TestNG.

Automation testing offers several advantages over manual testing,


including:
1. Increased Test Coverage: Automated tests can execute a large number of
test cases quickly, allowing for more comprehensive testing and better
coverage of different scenarios, configurations, and edge cases.
2. Improved Accuracy and Consistency: Automated tests are executed
consistently without human intervention, reducing the risk of human error
and ensuring that the same test steps are followed each time.
3. Time and Cost Savings: Once automated test scripts are created, they can
be run repeatedly with minimal effort, reducing the time and resources
required for manual testing. This can lead to significant cost savings,
especially for regression testing and long-term maintenance.
4. Early Detection of Defects: By integrating automated tests into the
development process (e.g., through Continuous Integration and
Continuous Deployment practices), defects can be identified and fixed
early, before they propagate to later stages of development or production.
5. Reusability and Maintainability: Automated test scripts can be reused
across multiple test cycles, reducing the effort required for regression
testing. Additionally, well-designed automated tests are easier to maintain
and update compared to manual test cases.
6. Parallel Execution: Many automation testing tools support the parallel
execution of test scripts, allowing for faster test execution and reduced
overall testing time.
7. Non-functional Testing: Automation testing is particularly valuable for
non-functional testing, such as performance testing, load testing, and
stress testing, where manual testing would be impractical or impossible.
8. Unattended Execution: Automated tests can run unattended, allowing
testers to work on other tasks or conduct exploratory testing during off-
hours or weekends.

3
Parul Institute of Technology
Software Testing & Quality Assurance
B.tech 4th Year , 7-Sem
Enrollment no : 210305105280

9. Detailed Reporting and Analytics: Automated testing tools provide


detailed reports and analytics on test execution, including pass/fail rates,
execution times, and captured logs or screenshots, which can be used for
analysis and decision-making.
10. Support for Agile and DevOps: Automation testing aligns well with Agile
and DevOps methodologies, enabling continuous testing and rapid
feedback loops, which are essential for delivering high-quality software
rapidly and frequently.

While automation testing offers numerous advantages, it is important to note


that it does not completely replace manual testing. Manual testing is still
necessary for exploratory testing, usability testing, and scenarios that require
human judgment and creativity.

When it comes to automation testing, there are three main


components: tests, projects, and tools.
1. Tests: Tests are the individual scripts or code that define the test
scenarios, test steps, and expected outcomes. Tests can be classified into
different types, such as unit tests, integration tests, functional tests,
regression tests, and so on. Tests are typically written in programming
languages like Java, Python, C#, or JavaScript, depending on the testing
tool or framework being used.
2. Projects: A project is a collection of tests that are organized and managed
together. A project typically represents a specific application or system
under test. Within a project, tests can be grouped into different suites or
folders based on their functionality, module, or other logical groupings.
Projects also include configuration files, test data sources, and other
supporting files required for test execution.
3. Tools: Automation testing relies on specialized tools or frameworks to
create, execute, and manage automated tests. Here are some popular
automation testing tools:

a. Selenium: An open-source tool primarily used for web application testing. It


supports multiple programming languages and can be used for various types of
testing, including functional, regression, and cross-browser testing.

b. Appium: An open-source tool for automating mobile app testing on different


platforms (iOS, Android) and devices (real or emulated/simulated).

4
Parul Institute of Technology
Software Testing & Quality Assurance
B.tech 4th Year , 7-Sem
Enrollment no : 210305105280

c. Katalon Studio: A comprehensive test automation solution that supports web,


mobile, and API testing. It offers a user-friendly interface and supports various
programming languages.

d. TestComplete: A commercial tool from SmartBear Software that supports


testing for web, desktop, and mobile applications, as well as various testing
types like functional, load, and distributed testing.

e. Cucumber: A behavior-driven development (BDD) tool that supports


automation testing through the creation of human-readable test scenarios in a
plain-text format.

f. Robot Framework: A generic test automation framework for acceptance


testing and acceptance test-driven development (ATDD). It supports multiple
programming languages and can be used for various types of testing.

g. Pytest: A popular open-source testing framework for Python that supports


unit testing, functional testing, and other types of testing.

h. Selenium Grid: A tool that allows running Selenium tests in parallel on


multiple machines and browsers, enabling faster and more efficient test
execution.

i. Apache JMeter: A load testing tool that can be used to simulate a heavy load
on servers, networks, or applications to test their performance and stability.

These tools often integrate with other components of the software development
lifecycle, such as continuous integration (CI) and continuous deployment (CD)
tools, bug tracking systems, and test management platforms, to facilitate end-to-
end automation and reporting.

Advantages of tests, projects, and tools in automation testing are as


follows:
Advantages of Tests:

1. Reusability: Automated test scripts can be reused across multiple test


cycles, reducing the effort required for regression testing and
maintenance.
2. Consistency: Tests execute the same steps consistently, ensuring that the
application is tested uniformly each time.

5
Parul Institute of Technology
Software Testing & Quality Assurance
B.tech 4th Year , 7-Sem
Enrollment no : 210305105280

3. Early defect detection: By running automated tests frequently (e.g., after


each build), defects can be identified early in the development cycle,
reducing the cost of fixing them.

Advantages of Projects:

1. Organization: Projects allow tests to be organized and grouped logically,


making it easier to manage and maintain test suites.
2. Centralized configuration: Projects provide a centralized location for
storing configuration files, test data, and other resources required for test
execution.
3. Reporting and analytics: Projects often include reporting and analytics
features, providing detailed information about test execution, pass/fail
rates, and execution times.

Advantages of Tools:

1. Efficient execution: Automation testing tools can execute tests quickly


and efficiently, saving time and resources compared to manual testing.
2. Parallel execution: Many tools support parallel execution of tests, further
reducing the overall testing time.
3. Cross-platform and cross-browser support: Tools like Selenium and
Appium enable testing across different platforms (web, mobile) and
browsers.
4. Integration with other tools: Automation testing tools can integrate with
continuous integration (CI) and continuous deployment (CD) tools, bug
tracking systems, and test management platforms, enabling end-to-end
automation and seamless reporting.
5. Customization and extensibility: Many automation testing tools are open-
source or provide APIs and plugins, allowing for customization and
extension to meet specific testing needs.
6. Record and playback: Some tools offer record and playback functionality,
which can simplify the creation of test scripts for certain types of tests.
7. Specialized testing: Tools like Apache JMeter and LoadRunner are
designed specifically for performance and load testing, enabling
comprehensive testing of application performance under different load
conditions.

While these advantages highlight the benefits of using tests, projects, and tools
in automation testing, it's important to note that these components require an
initial investment in terms of time, resources, and skilled personnel to set up and
maintain. Additionally, automated testing should be combined with manual
testing efforts, as some types of testing (e.g., exploratory testing, usability
testing) may still require human intervention and judgment.
6
Parul Institute of Technology
Software Testing & Quality Assurance
B.tech 4th Year , 7-Sem
Enrollment no : 210305105280

Practical – 2
AIM : Design test cases using Boundary value Analysis
Theory :

What is Boundary Testing ?


Boundary Value Analysis (BVA) is a testing technique used to identify errors at
the boundaries rather than within the ranges of input values. It involves testing at
the edges of input ranges, including maximum, minimum, just inside/outside
boundaries, typical values, and error values.

To design and implement test cases using BVA, let's consider a simple example
of a function that processes age as an input. Suppose the valid age range is 20 to
70 inclusive.

Step-by-Step Guide for BVA

1. Identify boundaries: The boundaries are 20 and 70.


2. Determine boundary values:
o Minimum valid boundary: 20
o Just below the minimum boundary: 19
o Just above the minimum boundary: 21
o Maximum valid boundary: 59
o Just below the maximum boundary: 70
o Just above the maximum boundary: 75

Test Cases

1. Minimum Boundary Test Cases:


o Input: 20 (Expected: Valid)
o Input: 19 (Expected: Invalid)
2. Just Above Minimum Boundary Test Case:
o Input: 21 (Expected: Valid)
3. Just Below Maximum Boundary Test Case:
o Input: 59 (Expected: Valid)

7
Parul Institute of Technology
Software Testing & Quality Assurance
B.tech 4th Year , 7-Sem
Enrollment no : 210305105280

4. Maximum Boundary Test Cases:


o Input: 70 (Expected: Valid)
o Input: 75 (Expected: Invalid)

Python Implementation :

Here’s how you can implement these test cases in Python using a simple function
to check if the age is valid:

Code :

def is_valid_age(age):

if 20 <= age <= 70:

return "Valid"

else:

return "Invalid"

# Define test cases

test_cases = [

(20, "Valid"), # Minimum boundary

(19, "Invalid"), # Just below minimum boundary

(21, "Valid"), # Just above minimum boundary

(59, "Valid"), # Just below maximum boundary

(70, "Valid"), # Maximum boundary

(75, "Invalid") # Just above maximum boundary

# Run test cases

for i, (age, expected) in enumerate(test_cases):

result = is_valid_age(age)

8
Parul Institute of Technology
Software Testing & Quality Assurance
B.tech 4th Year , 7-Sem
Enrollment no : 210305105280

assert result == expected, f"Test case {i+1} failed: age={age}, expected={expected},


got={result}"

print(f"Test case {i+1} passed: age={age}, expected={expected}, got={result}")

print("All test cases passed!")

Ouput :

Test Results
Test Case Status Age Expected Actual Result
Result
1 Passed 20 Valid Valid
2 Passed 19 Invalid Invalid
3 Passed 21 Valid Valid
4 Passed 59 Valid Valid
5 Passed 70 Valid Valid
6 Passed 75 Invalid Invalid

Explanation

 Function is_valid_age: This function checks if the input age is within the
valid range (20 to 70 inclusive).
 Test Cases: We define a list of test cases, each being a tuple of (input age,
expected result).
 Running the Test Cases: We iterate through each test case, run the
function, and compare the result with the expected outcome. If the results
match, we print that the test case passed. If not, an assertion error is raised,
indicating which test case failed.

This approach ensures that the boundary conditions are thoroughly tested, helping
to catch edge case errors that might be missed with regular testing techniques.

You might also like