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

Software Testing Techniques and Strategies

Uploaded by

garggiiipatil
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

Software Testing Techniques and Strategies

Uploaded by

garggiiipatil
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 47

Software Testing

Techniques and Strategies


Software testing
• Software testing is an important process in the software development
lifecycle.
• It involves verifying and validating that a software application is free
of bugs, meets the technical requirements set by its design and
development, and satisfies user requirements efficiently and
effectively.
Definition
• Software Testing is a method to assess the software program’s
functionality. The process checks whether the actual software matches
the expected requirements and ensures the software is bug-free.
• The purpose of software testing is to identify the errors, faults, or
missing requirements in contrast to actual requirements.
• It mainly aims to measure a software program or application's
specification, functionality, and performance.
Types of Software Testing
Principles
White box Testing
• White box testing technique analyze Internal design, code structure
and working of the complete software product.
• It is also called clear box testing, open box testing, transparent box
testing, code based testing and glass box testing.
• Tester has knowledge about the internal structure or programming of
the software.
• It is mostly done by Software Developers
• Perform with integration and unit testing
What do you verify in White Box Testing
• Internal security of code
• Poorly structured paths in the coding processes
• The flow of specific inputs through the code
• Loops, Decision conditions
• Each statement of your program
• Functions & Modules on individuals basis
• Expected output
Test Cases in White Box Testing
• Path testing
• Loop testing
• Condition testing
• Statement Coverage
Path Testing
• Test all the independent paths implies that suppose a path from main()
to function G, first set the parameters and test if the program is correct
in that particular path, and in the same way test all other paths and fix
the bugs.
Loop testing
• There are loops such as While, For and, Do-While loops etc.
• It checks all Simple, Nested and Concatenated loops.
• It checks ending condition if working correctly.
Condition testing
• The logical for every value is checked, whether it is true or false.
• This means that both the if and else conditions are verified.
Statement Coverage
• Statement coverage is a testing technique in which tester traverse all
statement in code.
• It ensures that each statement of the code is executed at least once.
• Hence each line of the code is verified.
Advantages
• White box testing optimizes code so hidden errors can be identified.
• Test cases of white box testing can be easily automated.
• This testing is more thorough than other testing approaches as it
covers all code paths.
• It can be started in the SDLC phase even without GUI.
Disadvantages
• White box testing is too much time consuming when it comes to large-
scale programming applications.
• White box testing is much expensive and complex.
• It can lead to production error because it is not detailed by the
developers.
• White box testing needs professional programmers who have a
detailed knowledge and understanding of programming language and
implementation.
Black box Testing
• In black box testing the functionalities of software application are
tested without having knowledge of internal code structure,
implementation details and internal paths.
• Tester gives input values to examine its functionality & checks
whether function is giving expected output or not
• If the function produces correct output then its passed in testing,
otherwise failed
• It also known as a closed box testing and Behavioral testing
• Perform by software testers.
Test Cases in White Box Testing
• Equivalence Partitioning
• Boundary Value Analysis
• Decision Table Testing
Equivalence Partitioning
• Testers can divide possible inputs into groups or “partitions”, and test
only one example input from each group. For example, if a system
requires a user’s birth date and provides the same response for all
users under the age of 18, and a different response for users over 18, it
is sufficient for testers to check one birth date in the “under 18” group
and one date in the “over 18” group.
Boundary Value Analysis
• Testers can identify that a system has a special response around a
specific boundary value. For example, a specific field may accept only
values between 0 and 99. Testers can focus on the boundary values (-1,
0, 99 and 100), to see if the system is accepting and rejecting inputs
correctly.
Decision Table Testing
• Many systems provide outputs based on a set of conditions. Testers
can then identify “rules” which are a combination of conditions,
identify the outcome of each rule, and design a test case for each rule.
Advantages
• 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.
Disadvantages
• There is a possibility of repeating the same tests while implementing the
testing process.
• Without clear functional specifications, test cases are difficult to implement.
• It is difficult to execute the test cases because of complex inputs at different
stages of testing.
• Sometimes, the reason for the test failure cannot be detected.
• Some programs in the application are not tested.
• It does not reveal the errors in the control structure.
• Working with a large sample space of inputs can be exhaustive and
consumes a lot of time.
Gray Box Testing

• Black Box Testing involves evaluating a system based solely on its inputs and outputs, without
any knowledge of its internal workings. This method is typically used to validate the
functionality against requirements.
• White Box Testing, on the other hand, requires a comprehensive understanding of the internal
code and logic. Testers design test cases based on the program's structure, which helps in
identifying logical errors and ensuring code coverage.
• Gray Box Testing combines elements of both approaches. The tester has partial knowledge of
the internal workings, which allows for more targeted testing. This technique is particularly
effective for uncovering context-specific errors, especially in web applications, since the tester
can leverage an understanding of both requirements and internal mechanisms.
• This method emphasizes requirement-based test case generation, making it easier to identify
discrepancies between expected and actual behavior. It strikes a balance between the
thoroughness of white box testing and the broader focus of black box testing.
Objectives of Gray Box Testing
• To provide combined advantages of both black box testing and white box testing.
• To combine the input of developers as well as testers.
• To improve overall product quality.
• To reduce the overhead of long process of functional and non-functional testing.
• To provide enough free time to developers to fix defects.
• To test from the user point of view rather than a designer point of view
Advantages
• Clarity of goals: Users and developers have clear goals while doing testing.

• Done from user perspective: Gray box testing is mostly done by the user
perspective.
• High programming skills not required: Testers are not required to have high
programming skills for this testing.
• Improved product quality: Overall quality of the product is improved.

• Defect fixing: In gray box testing, developers have more time for defect fixing.
• Benefits of black box and white box testing: By doing gray
box testing, benefits of both black box and white box testing
is obtained.
• Unbiased: Gray box testing is unbiased. It avoids conflicts
between a tester and a developer.
• Effective testing: Gray box testing is much more effective in
integration testing.
Disadvantages
• Limited access to internal structure: Limited access to internal structure leads to limited access for
code path traversal.
• Source code not accessible: Because source code cannot be accessed, doing complete white box
testing is not possible.
• Not suitable for algorithm testing: Gray box testing is not suitable for algorithm testing.
• Test cases difficult to design: Most of the test cases are difficult to design.
Unit Testing
• Unit testing is a software testing method that involves testing individual components or functions
of a software application in isolation. A "unit" is the smallest testable part of an application, often a
single function or method. The primary goal is to validate that each unit of the software performs
as expected.
• Unit tests are automated and are run each time the code is changed to ensure that new code does
not break existing functionality.
• Unit tests are designed to validate the smallest possible unit of code, such as a function or a
method, and test it in isolation from the rest of the system.
• This allows developers to quickly identify and fix any issues early in the development process,
improving the overall quality of the software and reducing the time required for later testing.
Objectives
• Isolate Code: Test a small part of the code on its own to see if it works correctly.

• Check Accuracy: Make sure that each piece of code does what it’s supposed to do.

• Test All Functions: Check every function and procedure to ensure they work as expected.

• Find Bugs Early: Identify and fix problems early in development to save time and money.

• Improve Understanding: Help developers understand the code better so they can make changes easily.

• Support Code Reuse: Make it easier to reuse code by ensuring each part works correctly on its own.
Types of Unit Testing
• There are 2 types of Unit Testing:
1. Manual Testing: Manual testing is like checking each part of a project by hand, without using any
special tools. People, like developers, do each step of the testing themselves. But manual unit
testing isn’t used much because there are better ways to do it and it has some problems:
a) It costs more because workers have to be paid for the time they spend testing, especially if
they’re not permanent staff.
b) It takes a lot of time because tests have to be done every time the code changes.
c) It is hard to find and fix problems because it is tricky to test each part separately.
d) Developers often do manual testing themselves to see if their code works correctly.
2. Automation Testing: automated unit testing is a way of checking if software works correctly
without needing lots of human effort. We use special tools made by people to run these tests
automatically. These are part of the process of building the software. Here’s how it works:

a) Developers write a small piece of code to test a function in the software. This code is like a little
experiment to see if everything works as it should.
b) Before the software is finished and sent out to users, these test codes are taken out.
c) Automated testing can help us check each part of the software on its own. This helps us find out
if one part depends too much on another.
d) We usually use special tools or frameworks to do this testing automatically. These tools can tell
us if any of our code doesn’t pass the tests we set up.
e) The tests we write should be really small and focus on one specific thing at a time. They should
also run on the computer’s memory and not need internet connection.
Why unit testing is important ???
• Early Bug Detection:

• By testing individual components early in the development process, developers can identify and fix bugs before they become more complex and costly to resolve.

• Improved Code Quality:

• Writing unit tests encourages developers to write modular, clean, and maintainable code, as they must design units that can be tested independently.

• Facilitates Refactoring:

• Unit tests provide a safety net during refactoring, ensuring that changes to the code don’t introduce new bugs. If a test fails after a change, it indicates that something
has gone wrong.

• Documentation:

• Well-written unit tests serve as documentation for the codebase. They describe how the code is expected to behave, making it easier for new developers to understand
the functionality.

• Reduces Debugging Time:

• When tests fail, it is easier to locate the source of the problem because the tests focus on specific units of code.
Advantages
• Early Issue Detection: Unit testing helps find and fix problems early, before they grow bigger and harder to
solve.

• Better Code Quality: It ensures each piece of code works as it should and meets the requirements, leading to
higher quality software.

• More Confidence: Developers feel more confident in their code because they can check that each part is
working correctly.

• Faster Development: Unit tests let developers check their changes quickly without waiting for the whole
system to be tested.

• Clear Documentation: Unit tests serve as easy-to-understand documentation for the code, helping others
know how it works.

• Safe Refactoring: Developers can change the code safely, knowing they can test to ensure nothing breaks.
• Time and Cost Savings: Finding and fixing issues early saves time and money later on in the development
process.

• Understanding Functionality: Unit tests help developers learn what each part of the code does and how to use
it.

• Code Refinement: It allows programmers to improve the code and make sure each module functions
correctly.

• Testing in Parts: Developers can test individual parts of the project without having to wait for the entire
project to be finished.
Disadvantages
• Time and Effort: Unit testing requires a significant investment of time and effort to create and maintain the
test cases, especially for complex systems.
• Dependence on Developers: The success of unit testing depends on the developers, who must write clear,
concise, and comprehensive test cases to validate the code.
• Difficulty in Testing Complex Units: Unit testing can be challenging when dealing with complex units, as it
can be difficult to isolate and test individual units in isolation from the rest of the system.
• Difficulty in Testing Interactions: Unit testing may not be sufficient for testing interactions between units, as
it only focuses on individual units.
• Difficulty in Testing User Interfaces: Unit testing may not be suitable for testing user interfaces, as it typically
focuses on the functionality of individual units.
Integration Testing
• Integration testing is the process of testing the interface between two software units or modules. It
focuses on determining the correctness of the interface. The purpose of integration testing is to
expose faults in the interaction between integrated units. Once all the modules have been unit-
tested, integration testing is performed.
• The goal of integration testing is to identify any problems or bugs that arise when different
components are combined and interact with each other.
• It helps to identify and resolve integration issues early in the development cycle, reducing the risk
of more severe and costly problems later on.
Why integration testing is important ???
• Integration testing is important because it checks if different parts of a software system work well
together. This helps find any issues with how the components communicate or fit together. By
catching these problems early, integration testing makes the software more reliable, efficient, and
of higher quality overall.
Big-Bang Integration Testing
• It is the simplest integration testing approach, where all the modules are combined and the
functionality is verified after the completion of individual module testing.
• In simple words, all the modules of the system are simply 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.
• The goal of big-bang integration testing is to verify the overall functionality of the system and to
identify any integration problems that arise when the components are combined.
• Advantages
• It is convenient for small systems.
• Simple and straightforward approach.
• Can be completed quickly.
• Does not require a lot of planning or coordination.
• May be suitable for small systems
• Disadvantages
• High risk of integration problems that are difficult to identify and diagnose.
• This can result in long and complex debugging and troubleshooting efforts.
• This can lead to system downtime and increased development costs.
• May not provide enough visibility into the interactions and data exchange between components.
• This can result in a lack of confidence in the system’s stability and reliability.
• This can lead to decreased efficiency and productivity.
• This may result in a lack of confidence in the development team.
Bottom-up testing
• In bottom-up testing, each module at lower levels are 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. This integration testing uses test
drivers to drive and pass appropriate data to the lower-level modules.
• Advantages
• 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 uses bottom up design approach.
• It is Easy to observe the test results.

• Disadvantages
• In this testing, the complexity that occurs when the system is made up of a large number of small
subsystems.
• As Far modules have been created, there is 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 to a high level to
ensure the system is working as intended.
• Advantages
• 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
• Needs many Stubs.
• 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 top-down
approach, testing can start only after the top-level module have been coded and unit tested. In
bottom-up approach, testing can start only after the bottom level modules are ready. This sandwich
or mixed approach overcomes this shortcoming of the top-down and bottom-up approaches. It is
also called the hybrid integration testing. also, stubs and drivers are used in mixed integration
testing.
• Advantages
• 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 test can be performed in top and bottom layer tests.

• Disadvantages
• For mixed integration testing, it requires 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.

You might also like