Understanding Testing Fundamentals Part - 2
Concepts
Types of Testing
o Functional Testing
o Non-Functional Testing
Testing Techniques
o Black Box Testing
o White Box Testing
o Grey Box Testing
Testing Approaches
o Manual Testing
o Automated Testing
Introduction
In the previous unit, we understood each phase of the software testing
life cycle.
In this unit, we will learn about manual testing and automated testing,
understand the various testing techniques and approaches, and
familiarize ourselves with different types of testing.
1. Types of Testing
We know that software testing is the process of ensuring that a software
application is working correctly.
During each phase of the STLC, we need to perform different types of
testing to ensure the software meets the specified requirements.
Software testing is the process of ensuring that a software application is
working correctly. There are different testing types to software testing
depending on the objective of the testing.
Let's explore the various types of software testing to gain a better
understanding of their purposes and methodologies.
1.1 Functional Testing
It is a type of software testing which is used to verify the functionality of
the software application.
Example
It involves checking different functionalities of the website like:
Are we able to browse the catalog of items?
Are we able to add items to the shopping cart?
Are we able to remove items from the shopping cart?
Are we able to checkout and pay for the items?
There are four most common types of functional testing:
1.1.1 Unit Testing
It involves testing individual parts, or "units", of the software
application.
This could be testing a single function or module of code.
Example
Let's say, we have a function that calculates the square of a number in
our code.
During unit testing, we aim to verify whether the code accurately
calculates the square or not.
1.1.2 Integration Testing
It is a type of software testing in which individual software modules are
combined and tested as a group to evaluate the interactions and data
exchange between those components.
Example
Here, we have an example of integration testing where we combine two
test cases to test the functionality of adding products to the shopping cart
and calculating the total price:
Test Case 1: Add Products to the Shopping Cart.
Add a product with a price of 100 to the shopping cart.
Verify that the product is successfully added.
Test Case 2: Calculate Total Price
Add another product with a price of 50 to the shopping cart.
Calculate the total price.
Verify that the total price is 150.
Here, we do integration testing by verifying that products are added
correctly to the shopping cart, and the total price calculation provides the
expected output.
1.1.3 System Testing
System testing is a level of software testing that focuses on evaluating
the entire system as a whole.
Example
1. Test Case 1: User Registration
Register for a user account.
Verify that the user is logged successfully.
2. Test Case 2: Product Listing
Browse the product listing.
Verify that all products are correctly displayed with accurate
details.
3. Test Case 3: Shopping Cart
Add products to the shopping cart.
Verify that the selected products are added correctly and the
total price is calculated accurately.
4. Test Case 4: Payment Processing
Proceed to checkout and select a payment method
Simulate a payment transaction using a test payment gateway
Verify that the payment is processed successfully and the
order is confirmed
Here, we do system testing where we test the overall functionality of the
system that allows users to sign in/sign up, displays available products,
stores selected products, calculates the total price, and handles payment
processing.
1.1.4 Acceptance Testing
It aims to verify whether a system meets the specified requirements and
is suitable for delivery to the end-users or stakeholders.
Example Testing
For example, let's imagine we are testing an E-Commerce website where
users can browse and purchase products. During acceptance testing, we
would perform tasks such as:
Creating a new user account and verifying that the registration
process is smooth and error-free.
Browsing through different product categories, adding items to the
shopping cart, and ensuring that the website accurately reflects the
selected products.
Proceeding to the checkout process, entering shipping and payment
details, and verifying that the transaction is processed correctly.
Testing various payment methods, such as credit cards or digital
wallets, to ensure they function as expected.
Verifying that order confirmations and email notifications are sent
promptly to users after successful purchases.
Testing the website's responsiveness and compatibility across
different devices and web browsers to ensure a consistent user
experience.
Checking if the website adheres to any specific design or branding
guidelines, ensuring it represents the business appropriately.
Now, let's learn about non-functional testing, which involves testing
software for factors other than just its basic functions.
1.2 Non - Functional Testing
It evaluates important aspects of the software beyond its functional
behavior, such as performance, security, usability, and other
requirements.
Example
Let's say we're testing an e-commerce website that has thousands of
users logging in at the same time
In non-functional testing, we would test the website's performance under
heavy load to ensure that it doesn't crash or slow down.
There are four most common types of non-functional testing:
1.2.1 Performance Testing
It ensure that a software program or system achieves specific
performance objectives, such as desired response time.
Example
We test the website's speed when you click on categories or search. The
test ensures fast response and quick display of results.
1.2.2 Security Testing
Security testing involves assessing the website's protection against
unauthorized access and potential security vulnerabilities.
Example
We test the website's login feature to ensure it securely prevents
access with incorrect passwords.
We test whether the website implements secure connections
(HTTPS) to protect users' data, especially when handling sensitive
information like payment details.
1.2.3. Load Testing
Load testing involves evaluating the website's performance under high
user traffic.
Example
We have a website that is used by millions of people every day. During
high-traffic events, such as Big billion days, our website can experience
slowdown or even crash. To prevent this, we perform load testing on our
website before these events.
The load test ensures website stability under increased traffic, checking
for crashes or significant slowdowns.
1.2.4 Usability Testing
Usability testing assesses the website's user-friendliness and ease of
navigation.
Example
We verify if the website has user-friendly menus, buttons, and search
functions, which ensures easy navigation and a smooth purchasing
process.
More Testing Types
In addition to these software testing types, there are also other types of
testing that are important while performing software testing. They are
Regression Testing
API Testing
Regression Testing
Regression testing is performed to ensure that recent changes or updates
in the software do not negatively impact previously working
functionalities.
Example
We make changes to the website's checkout process by adding a new
payment method. To ensure that this change does not introduce any
issues in existing functionalities, we conduct regression testing.
We verify that all previously working features, such as adding items to
the cart and applying discount codes, still function correctly after the
update.
API Testing
API testing involves testing the application programming interfaces
(APIs) to ensure they function correctly, securely, and efficiently.
Example
We have an e-commerce application that interacts with a UPI (Unified
Payments Interface) application through an API integration.
We conduct API testing to validate that the E-Commerce application can
correctly send payment requests to the UPI application, receive payment
confirmations, and handle any errors that may occur during the process.
We have learned the different types of software testing, let's take a look
at some of the testing techniques that can be used to perform these tests.
Question 1 of 3
In Unit Testing, what is the primary focus?
Testing the whole software system
Individual parts or units of the ssoftware
Testing under high user traffic
Testing the user-friendliness
friendliness of the software
Show AnswerSubmit
2. Testing Techniques
Testing techniques are the methods used to evaluate software to find
defects. There are many different testing techniques, each with its own
purpose and benefits. Some of the most common testing techniques are
as follows:
2.1 Black Box Testing
It is a type of testing where the tester doesn't have any knowledge of the
internal workings of the software.
It focuses on examining the software's inputs and outputs without
considering the internal code or structure.
Example
In black box testing, we would test how the website behaves when a
customer enters their personal information and clicks the "submit"
button
2.2 White Box Testing
White box testing is a type of testing where the tester has knowledge of
the internal structure and code of the software.
It involves testing the internal logic of the software. Testers use this
knowledge to design test cases that ensure all parts of the code are tested
thoroughly.
It is mostly done by software developers.
Example
Testing the checkout process of an online store.
Test Case 1: We verify that the shopping cart calculates the correct
total price by checking the underlying code that performs the
calculation.
Test Case 2: We test the handling of discount codes by examining
the code logic that applies discounts and ensure that the correct
discounts are applied.
Test Case 3: We validate the database updates by checking the
code that updates inventory quantities after a successful purchase
to ensure that stock levels are updated correctly.
Test Case 4: We test the error handling by intentionally triggering
an error in the payment processing code and verifying that our
system handles the error gracefully and displays an appropriate
error message.
Test Case 5: We validate the integration with third-party payment
gateways by examining the code responsible for communicating
with the payment gateway API and ensuring that payments are
processed correctly.
2.3 Grey Box Testing
The tester has partial access to the internal workings of the software
application. This approach combines elements of both black box and
white box testing.
Example
In grey box testing, we might have access to the code that calculates the
total cost of a customer's order, but not the code that handles the
website's security
Question 1 of 3
Which testing technique involves examining the software's inputs and
outputs without considering the internal code or structure?
White Box Testing
Black Box Testing
Grey Box Testing
Regression Testing
Show AnswerSubmit
3. Testing Approaches
Testing approaches are different ways or methods used to test software.
These approaches determine how testing is carried out and can be
broadly classified into two categories:
3.1 Manual Testing
Manual testing involves human testers who carefully execute test cases
and evaluate the software's functionality, usability, and other aspects.
Example
Imagine we are testers and using an e-commerce website to purchase a
item. We should manually perform the following steps:
Open the website and search for the desired item.
Click on the item’s link to view its details.
Add the item to the shopping cart.
Proceed to the checkout page, enter the shipping address, and
select a payment method.
Click the "Place Order" button to complete the purchase.
As a tester we should follow the predefined set of steps, carefully
observing and noting any issues, such as
broken links,
incorrect information, or
unexpected behavior, etc.
3.2 Automated Testing
Automated testing involves using software tools and scripts to perform
tests, eliminating the need for manual execution. It is more efficient and
can quickly execute repetitive and complex test cases.
Automated testing requires testers to write scripts or use testing tools to
define the test scenarios and expected outcomes
Example
Imagine a software program that automatically interacts with the e-
commerce website to simulate user actions:
The program searches for a specific product using predefined
criteria.
It verifies if the search results match the expected outcome.
The program adds the product to the cart, simulating a user action.
It proceeds through the checkout process, entering predefined
shipping and payment details.
Manual vs Automation Testing
Manual Testing Automation Testing
Testing performed by using
Testing performed by human testers
specializedsoftware tools to execute
Manual Testing Automation Testing
manually executing test cases cases
Test cases are executed manually, step- Test cases are executed
by-step, by following predefined automatically
procedures by running scripts or test automation
frameworks
Faster execution and can handle
Time-consuming for large or complex
applications
large volumes of test data
Summary
Types of Testing:
o Functional Testing: Verifying the functionality of the
software application.
Unit Testing: Testing individual parts or units of the
software.
Integration Testing: Testing the interaction and data
exchange between software modules.
System Testing: Evaluating the entire system as a
whole.
Acceptance Testing: Verifying whether the system
meets specified requirements.
o Non-Functional Testing: Evaluating aspects beyond
functionality, such as performance, security, and usability.
Performance Testing: Checking if the software meets
performance objectives.
Security Testing: Assessing protection against
unauthorized access and security vulnerabilities.
Load Testing: Evaluating performance under high user
traffic.
Usability Testing: Assessing user-friendliness and ease
of navigation.
o More Testing Types:
Regression Testing: Ensuring recent changes do not
impact previously working functionalities.
API Testing: Testing application programming
interfaces for correct functionality.
Testing Techniques:
o Black Box Testing: Testing based on inputs and outputs
without knowledge of internal workings.
o White Box Testing: Testing with knowledge of internal
structure and code.
o Grey Box Testing: Partial knowledge of internal workings
combined with black and white box testing.
Testing Approaches:
o Manual Testing: Human testers execute test cases to evaluate
functionality, usability, etc.
o Automated Testing: Software tools and scripts are used to
execute tests, improving efficiency.