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

Software Testing

Software testing is the process of demonstrating that errors are not present and ensuring that a program performs its intended functions correctly. It involves various phases including requirement analysis, test planning, test case development, execution, and closure, and can be categorized into manual and automated testing, as well as different types such as unit, integration, system, and acceptance testing. The document also discusses principles of testing, verification and validation, and the importance of independent testing to ensure reliability and quality of software products.

Uploaded by

mayankgrover846
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

Software Testing

Software testing is the process of demonstrating that errors are not present and ensuring that a program performs its intended functions correctly. It involves various phases including requirement analysis, test planning, test case development, execution, and closure, and can be categorized into manual and automated testing, as well as different types such as unit, integration, system, and acceptance testing. The document also discusses principles of testing, verification and validation, and the importance of independent testing to ensure reliability and quality of software products.

Uploaded by

mayankgrover846
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/ 61

SOFTWARE TESTING

What is testing?

• Testing is the process of demonstrating that errors are not present.


• The purpose of testing is to show that the program performs its
intended functions correctly.
• It also establish confidence that a program does what it is supposed
to do.
“Testing is the process of executing a program
with the intent of finding errors”.
• Why to test?
To cut the cost and deliver a reliable product.

• Who should test?


Testing persons are different from developers.

• What should we test?


Testers should test those areas where the probability of getting
errors is high. There should a strategy to develop test cases for testing
small portion and also develop test cases for the complete system.
Principles of testing

• All tests should be traceable to customer requirement.


• Test should be planned long before the testing begins.
• The Pareto principle applies to software testing.
• Testing should “begin in small” and progress towards “in the large”
• Exhaustive testing is not possible.
• To be most effective, testing should be conducted by an independent
third party.
Some Terminologies
• Error
• Mistake
• Bug :- When developers makes errors while coding.
• Fault :- When error exists fault occurs. A fault is a result of an error
which can cause system to fail.
• Failure :- failure is said to be the inability of the system to perform the
desired task. Failure occurs when fault exists in the system.
• Test case and Test Suite
Test case is described as an input description and an expected output
description.
Test case ID:

Section I Section II
Before execution After execution

Purpose: Execution History:

Pre condition: Result:

Inputs: If fails, any possible reason(Optional):

Expected Outputs: Any other observation:

Post condition: Any suggestion:

Written by: Run by:

Date: Date:
Verification and Validation
Validation

• Validation is process to ensure that the software that has been built is
traceable to satisfies the user requirements. If the software matches
requirements for which it was made, it is validated.
• Validation ensures the product under development is as per the user
requirements.
• Validation answers the question – "Are we developing the product
which attempts all that user needs from this software?".
• Validation emphasizes on user requirements.
Verification

Verification is the process of ensuring that the software correctly


implements a specific function, is developed adhering to the proper
specifications and methodologies.
• Verification ensures the product being developed is according to
design specifications.
• Verification answers the question– "Are we developing this product
by firmly following all design specifications?“
• Verifications concentrate on the design and system specifications.
Testing = Validation + Verification
Software Testing Life Cycle
Requirement Analysis :
• In this phase quality assurance team understands the requirements
like what is to be tested.
• If anything is missing or not understandable then the quality
assurance team meets with the stakeholders to better understand the
detailed knowledge of requirements.
Test Planning :
Is where all testing plans are defined.
The team calculates the estimated effort and cost for the testing work.
This phase gets started once the requirement-gathering phase is
completed.
Test Case Development
• The test case development phase gets started once the test planning
phase is completed.
• In this phase testing team notes down the detailed test cases. The
testing team also prepares the required test data for the testing.
• When the test cases are prepared then they are reviewed by the
quality assurance team
Test Environment Setup
• The test environment decides the conditions on which software is
tested.
• This is independent activity and can be started along with test case
development.
Test Execution
• After the test case development and test environment setup test
execution phase gets started.
• In this phase testing team starts executing test cases based on
prepared test cases in the earlier step.

Test Closure
• Where all testing-related activities are completed and documented.
• The main objective of the test closure stage is to ensure that all
testing-related activities have been completed and that the software
is ready for release.
Manual Testing Vs Automated Testing
Manual testing is a technique used to test software by utilizing the
functions and features of an application. This means that manual
testing will involve checking the defect manually by trying each
function to ensure it is working as expected.
Advantages:
Fast and accurate visual feedback
Less Expensive
No coding required
Efficient for unplanned changes
• Automated testing is a technique where the Tester writes scripts on
their own and uses a suitable Software or Automation Tool to test the
software. It allows for executing repetitive tasks without the
intervention of a Manual Tester.
Advantages
Simplifies Test Case Execution
Improves the Reliability of the test : equal focus on all the areas.
Increases the amount of test coverage
Minimizing human intervention.
Types of Manual Testing
1. White box testing
• White Box Testing is a software testing technique that
involves testing the internal structure and workings of a
software application. The tester has access to the source
code and uses this knowledge to design test cases that
can verify the correctness of the software at the code
level.
• Also know as clear box testing
• It is done by the developers
Advantages of White Box Testing:
Thorough Testing: White box testing is thorough as the entire code
and structures are tested.
Code Optimization: It results in the optimization of code, removing
errors, and helps to remove extra lines of code.
Early Detection of Defects: It can start at an earlier stage, as it doesn’t
require any interface.
Detection of Complex Defects: Testers can identify defects that
cannot be detected through other testing techniques.
2. Black box testing
• Black-box testing is a type of software testing in which the tester is not
concerned with the internal knowledge or implementation details of the
software but rather focuses on validating the functionality based on the
provided specifications or requirements.
• It is done by the testers.
Advantages of Black Box Testing:
The tester does not need to have more functional knowledge or programming
skills to implement the Black Box Testing.
It is efficient for implementing the tests in the larger system.
Tests are executed from the user’s or client’s point of view.
Test cases are easily reproducible.
It is used to find the ambiguity and contradictions in the functional
specifications.
3. Grey Box Testing
• Combination of White box testing and black box testing.
• In the Black Box Testing technique, the tester is unaware of the
internal structure of the item being tested and in White Box Testing
the internal structure is known to the tester.
• The internal structure is partially known in Gray Box Testing.
• This includes access to internal data structures and algorithms to
design the test cases.
Advantages of Gray Box Testing:
• Clarity of goals: Users and developers have clear goals while doing
testing.
• Done from a user perspective: Gray box testing is mostly done from
the user perspective, focusing on how the software behaves in
real-world scenarios.
• High programming skills not required: Testers are not required to
have high programming skills for this testing. Testers only need a basic
understanding of the internal workings, such as architecture, data
flow, or logic, which can often be learned quickly.
• Improved product quality: Since gray box testing examines both
functional behavior and internal structures, it leads to the detection
of more comprehensive bugs.
Types of Black Box Testing
Functional Testing:
• Testing in which the system is tested against the functional
requirements and specifications.
• Functional testing ensures that the requirements or specifications are
properly satisfied by the application.
• This type of testing is particularly concerned with the result of
processing.
• It checks what the system does, not how it does it.
Examples of Functional Testing Tasks:
• Checking if the login function works when valid/invalid credentials are
entered.
• Verifying if a shopping cart updates correctly when items are added or
removed.
• Testing if the "Submit" button performs the expected action (e.g.,
sends data, shows confirmation)
Advantages of Functional Testing:
• Bug-free product: Functional testing ensures the delivery of a
bug-free and high-quality product.
• Customer satisfaction: It ensures that all requirements are met and
that the customer is satisfied.
• Testing focused on specifications: Functional testing is focused on
specifications as per customer usage.
• Proper working of the application: This ensures that the application
works as expected and ensures proper working of all the functionality
of the application.
• Improves quality of the product: Functional testing ensures the
security and safety of the product and improves the quality of the
product.
Non-Functional Testing
• Performed to verify the non-functional requirements of the
application, such as performance, usability, reliability , etc.
• It verifies whether the behavior of the system is as per the
requirement or not.
• It focuses on how the system performs rather than what it does.

Non-functional testing focuses on evaluating how well a software


system performs and operates, rather than whether it fulfills specific
functionalities.
Types of Non Functional Testing
• Compatibility Testing: Compatibility testing ensures that the system
functions correctly with other software, hardware, and operating
systems.
• Load Testing: Simulates the expected number of users accessing the
system simultaneously to determine how the system behaves under
normal and peak usage conditions.
• Performance Testing: This assesses how well the software performs
under various loads and conditions.
• Recovery Testing: Recovery tests determine how quickly software can
rebound after a crash or failure.
• Security Testing: This type of testing identifies vulnerabilities in the
system that could be exploited by malicious actors.
• Scalability Testing: This type of testing assesses how well the system
can adapt to increasing workloads and user demands.
• Stress Testing: Stress testing pushes the system beyond its normal
operating capacity to identify its breaking point and how it handles
extreme loads.
• Usability Testing: Usability testing evaluates how easy and intuitive
the system is for users to interact with and complete tasks.
• Documentation Testing
• Localization Testing: If the software is intended for international use,
localization testing ensures that it is adapted to different languages,
cultures, and regional formats.
Levels of testing
• Unit Testing
• Integration Testing
• System Testing
• Acceptance Testing
Unit Testing
• Unit Testing is a software testing technique in which individual units
or components of a software application are tested in isolation. These
units are the most minor pieces of code, typically functions or
methods, ensuring they perform as expected.
• It is the process of testing the smallest parts of your code, like it is a
method in which we verify the code’s correctness by running it one by
one.
Prerequisites of Unit Testing
Understanding of the Software Development Process.
Knowledge of programming languages and Development tools.
Familiarity with the code base.
Ability to write test cases and understand expected outcomes.
Proficiency in using unit testing frameworks and tools.
Awareness of best practices and guidelines for writing effective unit
tests.
Clear understanding of the purpose and goals of unit testing in the
software development lifecycle.
self.assertEqual() checks whether the expected
result matches the actual result.
Each method starting with test_ is a test case.
Unittest.main() runs all the test cases.
Advantages of Unit Testing
• Trust in code
• Verify functionality
• Code maintainability
• Error detection
• Reusability
• Reduced Time and cost
Disadvantages
• Time and effort
• Dependence on developers
• Difficulty in testing complex functionality
• Difficulty in testing interactions
Integration Testing
• Integration testing focuses on verifying the interactions and data exchange
between different components or modules of a software application.
• The goal of integration testing is to identify any problems or bugs that arise
when different components are combined and interact with each other.
• Integration testing is typically performed after unit testing and before system
testing.
Big Bang Integration Testing
• It is the simplest approach to integration testing.
• All the modules of the system are put together and tested.
• This approach is practicable only for very small systems.
• If an error is found during the integration testing, it is very difficult to
localize the error as the error may potentially belong to any of the modules
being integrated.
• So, debugging errors reported during Big Bang integration testing is very
expensive to fix.
• Big-bang integration testing is a software testing approach in which all
components or modules of a software application are combined and tested
at once.
Advantages:
It is convenient for small systems.
Simple approach.
Can be completed quickly.
Does not require a lot of planning or coordination.
May be suitable for small systems.
Disadvantages:
There will be quite a lot of delay because you would have to wait for all the
modules to be integrated.
High-risk critical modules are not isolated and tested on priority since all
modules are tested at once.
Not Good for long projects.
This can result in long and complex debugging and troubleshooting efforts.
Bottom Up Integration Testing
• In bottom-up testing, each module at lower levels is tested with
higher modules until all modules are tested.
• The primary purpose of this integration testing is that each subsystem
tests the interfaces among various modules making up the
subsystem.
Advantages of Bottom-Up Integration Testing
In bottom-up testing, no stubs are required.
A principal advantage of this integration testing is that several disjoint
subsystems can be tested simultaneously.
It is easy to create the test conditions.
Best for applications that use a bottom-up design approach.
It is Easy to observe the test results.
Disadvantages of Bottom-Up Integration Testing
Driver modules must be produced.
In this testing, the complexity occurs when the system is made up of a
large number of small subsystems.
As far as modules have been created, no working model can be
represented.
Top Down Integration Testing
• In this integration testing, testing takes place from top to bottom.
• First, high-level modules are tested and then low-level modules, and
finally, integrating the low-level modules into a high-level module to
ensure the system is working as intended.
Advantages of Top-Down Integration Testing
Separately debugged module.
It is more stable and accurate at the aggregate level.
Easier isolation of interface errors.
In this, design defects can be found in the early stages.
Disadvantages of Top-Down Integration Testing
Needs many Stubs: Since lower-level modules aren't ready early,
testers have to create many stubs to simulate their behavior.
Modules at lower level are tested inadequately.
It is difficult to observe the test output.
It is difficult to stub design.
Mixed Integration Testing
• A mixed integration testing is also called sandwiched integration
testing.
• A mixed integration testing follows a combination of top-down and
bottom-up testing approaches.
• In the top-down approach, testing can start only after the top-level
module have been coded and unit tested. In the bottom-up approach,
testing can start only after the bottom-level modules are ready.
Advantages of Mixed Integration Testing
• A mixed approach is useful for very large projects having several
sub-projects.
• This Sandwich approach overcomes this shortcoming of the top-down
and bottom-up approaches.
• Parallel tests can be performed in the top and bottom layer tests.

Disadvantages of Mixed Integration Testing


• For mixed integration testing, it requires a very high cost because one
part has a Top-down approach while another part has a bottom-up
approach.
• This integration testing cannot be used for smaller systems with huge
interdependence between different modules.
System Testing
• System testing is a level of software testing that evaluates the
complete and integrated software system to verify that it meets
specified requirements.
• Is performed after integration testing and involves testing the entire
application as a whole to ensure that all components work together
correctly.
• It focuses on validating the system’s compliance with functional and
non-functional requirements, such as performance, usability, and
security.
• It is a black box testing.
What do you verify in System testing?
• System testing covers the end-to-end functions of a system, and thus
it provides reliability to the system.
• It helps to solve bugs after post-production.
• It tests the entire system architecture as per the business
requirement.
• This testing keeps the new and previous functionalities in a single
system to help the user understand the benefits of the newly added
features.
Acceptance Testing
• It is the final level of software testing before making the system
available for actual use.
• It is a black box test done by the end user or client.
• It is performed on a user/ live environment or in real-time scenarios.
• It is the last phase of software testing performed after System Testing
and before making the system available for actual use.
Types of Acceptance Testing
• User Acceptance Testing (UAT)
• Business Acceptance Testing (BAT)
• Contract Acceptance Testing (CAT)
• Regulations Acceptance Testing (RAT)
• Operational Acceptance Testing (OAT)
• Alpha Testing
• Beta Testing
User Acceptance Testing (UAT)
• User acceptance testing is used to determine whether the product is
working for the user correctly.
• In this specific requirement, which is used often by the customers, is
primarily picked for testing purposes. This is also termed as End-User
Testing.
Business Acceptance Testing (BAT)
• BAT is used to determine whether the product meets the business
goals and purposes or not.
Contract Acceptance Testing (CAT)
• CAT is a contract that specifies that once the product goes live, within
a predetermined period, the acceptance test must be performed, and
it should pass all the acceptance use cases.
Regulations Acceptance Testing (RAT)
• RAT is used to determine whether the product violates the rules and
regulations that are defined by the government of the country where
it is being released.
Operational Acceptance Testing (OAT)
• OAT is used to determine the operational readiness of the product
and is a non-functional test.
Alpha Testing and Beta Testing
Testing is used when the software is developed for anonymous
customers. So, formal acceptance is not possible.
Some potential customers are identified to get their view about the
product.
Alpha tests are performed at the developer’s site by the customer.
These tests are conducted in a controlled environment.
Beta tests are conducted by the customer/end user at their sites.
Developers are not present there. Beta testing is done in a real
environment that can’t be controlled by the developer.
Structural Testing
• Structural testing is a type of software testing that uses the internal
design of the software for testing, or in other words, the software
testing that is performed by the team that knows the development
phase of the software is known as structural testing.
• Also known as white box testing.
Control Flow testing
• Control flow testing is a type of structural testing that uses the
program’s control flow as a model.
• The entire code, design, and structure of the software have to be
known for this type of testing. Often, this type of testing is used by
the developers to test their own code and implementation. This
method is used to test the logic of the code so that the required
result can be obtained.
Data Flow Testing
• It uses the control flow graph to explore the unreasonable things that
can happen to data.
• Emphasizes on : In which statements the variables are defined and in
which statements the variables are used.
• The detection of data flow anomalies is based on the associations
between values and variables.
• Example : Without being initialized usage of variables. Initialized
variables are not used once.
Slice Based Testing
• It was originally proposed by Weiser and Gallagher for software
maintenance. It is useful for software debugging, software
maintenance, program understanding, and quantification of
functional cohesion. It divides the program into different slices and
tests that slice, which can majorly affect the entire software.
Mutation Testing
• Mutation testing, also known as code mutation testing, is a form of
white box testing in which testers change specific components of an
application's source code to ensure a software test suite can detect
the changes. Changes introduced to the software are intended to
cause errors in the program.
• Mutation Testing is a type of Software Testing that is performed to
design new software tests and also evaluate the quality of already
existing software tests.
• Mutation testing is related to modification a program in small ways. It
focuses to help the tester develop effective tests or locate
weaknesses in the test data used for the program.
Advantages of Structural Testing:
• It provides thorough testing of the software.
• It helps in finding out defects at an early stage.
• It helps in the elimination of dead code.
• It is not time-consuming as it is mostly automated.
Disadvantages of Structural Testing:
• It requires knowledge of the code to perform the test.
• It requires training in the tool used for testing.
• Sometimes it is expensive.
Error Seeding
• Error seeding can be defined as a process of adding errors to the
program code that can be used for evaluating the number of
remaining errors after the system software test part.
Where to use both?
• Mutation Testing is ideal when you want to test the strength of your
test cases. It ensures your tests are strong enough to catch even
subtle bugs. This method works best for small to medium-sized
applications that require thorough testing to make sure they are
robust and error-free.
• Error Seeding, on the other hand, is better suited for larger projects
or ongoing development, where you need quick feedback on how
effective your testing process is.

You might also like