Software Testing
Software Testing
Software Testing
Software Testing
Software testing is a process of identifying the correctness of software by considering its all
attributes (Reliability, Scalability, Portability, Re-usability, Usability) and evaluating the execution of
software components to find the software bugs or errors or defects.
It involves testing of all components under the required services to confirm that whether it is
satisfying the specified requirements or not. The process is also providing the client with information
about the quality of the software.
Testing is mandatory because it will be a dangerous situation if the software fails any of time due
to lack of testing. So, without testing software cannot be deployed to the end user.
Verification Validation
It includes checking documents, design, It includes testing and validating the actual
codes and programs. product.
It does not include the execution of the It includes the execution of the code.
code.
Methods used in verification are reviews, Methods used in validation are Black Box
walkthroughs, inspections and desk- Testing, White Box Testing and non-
checking. functional testing.
1
2
Verification Validation
It checks whether the software conforms to It checks whether the software meets the
specifications or not. requirements and expectations of a
customer or not.
It can find the bugs in the early stage of the It can only find the bugs that could not be
development. found by the verification process.
The goal of verification is application and The goal of validation is an actual product.
software architecture and specification.
Verification refers to the set of activities Validation refers to the set of activities that
that ensure software correctly implements ensure that the software that has been built
the specific function. is traceable to customer requirements.
After a valid and complete specification the Validation begins as soon as project starts.
verification starts.
Verification is also termed as white box Validation can be termed as black box
testing or static testing as work product testing or dynamic testing as work product
goes through reviews. is executed.
Verification finds about 50 to 60% of the Validation finds about 20 to 30% of the
defects. defects.
Verification is based on the opinion of Validation is based on the fact and is often
reviewer and may change from person to stable.
person.eg-inspection, walk throughs, Eg.-code testing, integration testing,
Functional testing, user acceptance testing
Testing is a group of techniques to determine the correctness of the application under the
predefined script but, testing cannot find all the defect of application. The main intent of testing
is to detect failures of the application so that failures can be discovered and corrected. It does not
demonstrate that a product functions properly under all conditions but only that it is not working in
some specific conditions.
Testing includes an examination of code and also the execution of code in various environments,
conditions as well as all the examining aspects of the code. In the current scenario of software
development, a testing team may be separate from the development team so that Information
derived from testing can be used to correct the process of software development.
2
3
With the help of below image, we can easily understand the type of software testing:
Manual testing
The process of checking the functionality of an application as per the customer needs without taking
any help of automation tools is known as manual testing. While performing the manual testing on
any application, we do not need any specific knowledge of any testing tool, rather than have a
proper understanding of the product so we can easily prepare the test document.
Manual testing can be further divided into three types of testing, which are as follows:
Automation testing
Automation testing is a process of converting any manual test cases into the test scripts with the
help of automation tools, or any programming language is known as automation testing. With the
help of automation testing, we can enhance the speed of our test execution because here, we do
not require any human efforts. We need to write a test script and execute those scripts.
member of the class works similarly, i.e., if a test case in one class results in some error, other
members of the class would also result in the same error.
4. Cause effect graphing – This technique establishes a relationship between logical input called
causes with corresponding actions called the effect. The causes and effects are represented using
Boolean graphs. The following steps are followed:
1. Identify inputs (causes) and outputs (effect).
2. Develop a cause-effect graph.
3. Transform the graph into a decision table.
4. Convert decision table rules to test cases.
For example, in the following cause-effect graph:
Each column corresponds to a rule which will become a test case for testing. So there will be 4
test cases.
5. Requirement-based testing – It includes validating the requirements given in the SRS of a
software system.
6. Compatibility testing – The test case results not only depend on the product but are also on
the infrastructure for delivering functionality. When the infrastructure parameters are changed it is
still expected to work properly. Some parameters that generally affect the compatibility of software
are:
1. Processor (Pentium 3, Pentium 4) and several processors.
2. Architecture and characteristics of machine (32-bit or 64-bit).
3. Back-end components such as database servers.
4. Operating System (Windows, Linux, etc).
BlackBoxTestingType:
the following are the several categories of black box testing:
1. Functional Testing
2. Regression Testing
3. Nonfunctional Testing (NFT)
Functional Testing: It determines the system’s software functional requirements.
Regression Testing: It ensures that the newly added code is compatible with the existing code.
In other words, a new software update has no impact on the functionality of the software. This is
carried out after a system maintenance operation and upgrades.
Nonfunctional Testing: Nonfunctional testing is also known as NFT. This testing is not functional
testing of software. It focuses on the software’s performance, usability, and scalability.
Advantages of Black Box Testing:
The tester does not need to have more functional knowledge or programming skills to
implement the Black Box Testing.
4
5
Unit testing:
Unit testing is a type of software testing that focuses on individual units or components of a
software system. The purpose of unit testing is to validate that each unit of the software works as
intended and meets the requirements. Unit testing is typically performed by developers, and it is
performed early in the development process before the code is integrated and tested as a whole
system.
5
6
5. Better Documentation: Unit testing provides clear and concise documentation of the
code and its behavior, making it easier for other developers to understand and
maintain the software.
6. Facilitation of Refactoring: Unit testing enables developers to safely make changes
to the code, as they can validate that their changes do not break existing
functionality.
7. Reduced Time and Cost: Unit testing can reduce the time and cost required for later
testing, as it helps to identify and fix issues early in the development process.
Disadvantages of Unit Testing:
1. The process is time-consuming for writing the unit test cases.
2. Unit Testing will not cover all the errors in the module because there is a chance of
having errors in the modules while doing integration testing.
3. Unit Testing is not efficient for checking the errors in the UI(User Interface) part of the
module.
4. It requires more time for maintenance when the source code is changed frequently.
5. It cannot cover the non-functional testing parameters such as scalability, the
performance of the system, etc.
6. Time and Effort: Unit testing requires a significant investment of time and effort to
create and maintain the test cases, especially for complex systems.
7. 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.
8. 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.
9. Difficulty in Testing Interactions: Unit testing may not be sufficient for testing
interactions between units, as it only focuses on individual units.
10. 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.
11. Over-reliance on Automation: Over-reliance on automated unit tests can lead to a
false sense of security, as automated tests may not uncover all possible issues or bugs.
12. Maintenance Overhead: Unit testing requires ongoing maintenance and updates, as
the code and test cases must be kept up-to-date with changes to the software.
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. Integration testing is
typically performed after unit testing and before system testing.
Integration test approaches – There are four types of integration testing approaches.
Those approaches are the following:
1. 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. This approach is
typically used when the software components have a low degree of interdependence or
when there are constraints in the development environment that prevent testing individual
components.
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. While big-bang integration testing can be useful in some situations, it can also
6
7
be a high-risk approach, as the complexity of the system and the number of interactions
between components can make it difficult to identify and diagnose problems.
Advantages:
1. It is convenient for small systems.
2. Simple and straightforward approach.
3. Can be completed quickly.
4. Does not require a lot of planning or coordination.
5. May be suitable for small systems or projects with a low degree of interdependence
between components.
Disadvantages:
1. There will be quite a lot of delay because you would have to wait for all the modules to
be integrated.
2. High-risk critical modules are not isolated and tested on priority since all modules are
tested at once.
3. Not Good for long projects.
4. High risk of integration problems that are difficult to identify and diagnose.
5. This can result in long and complex debugging and troubleshooting efforts.
6. This can lead to system downtime and increased development costs.
2. Bottom-Up Integration 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:
Driver modules must be produced.
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.
7
8
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.
Applications:
1. Identify the components: Identify the individual components of your application that
need to be integrated. This could include the frontend, backend, database, and any
third-party services.
2. Create a test plan: Develop a test plan that outlines the scenarios and test cases that
need to be executed to validate the integration points between the different
components. This could include testing data flow, communication protocols, and error
handling.
3. Set up test environment: Set up a test environment that mirrors the production
environment as closely as possible. This will help ensure that the results of your
integration tests are accurate and reliable.
4. Execute the tests: Execute the tests outlined in your test plan, starting with the most
critical and complex scenarios. Be sure to log any defects or issues that you encounter
during testing.
5. Analyze the results: Analyze the results of your integration tests to identify any defects
or issues that need to be addressed. This may involve working with developers to fix
bugs or make changes to the application architecture.
6. Repeat testing: Once defects have been fixed, repeat the integration testing process
to ensure that the changes have been successful and that the application still works as
expected.
System testing:
System testing, also referred to as system-level testing or system integration testing, is the process
in which a quality assurance (QA) team evaluates how the various components of an application
interact together in the full, integrated system or application.
System testing verifies that an application performs tasks as designed. It's a type of black box
testing that focuses on the functionality of an application rather than the inner workings of a system
Improved product quality. A comprehensive system testing process ultimately boosts the
product quality. Since an integrated system is tested through multiple test sets in a product
development cycle, it provides a glimpse into whether a product can successfully work across
different platforms and environments.
Error reduction. Some errors are bound to happen during the development of complex
systems. System testing verifies a system's code and functionality against its requirements, so
errors that aren't detected during integration and unit testing can be exposed during system
testing.
8
9
Cost savings. It can be more time-consuming to fix a system defect that's detected later in the
project lifecycle. Conducting timely and continuous system testing not only reduces unexpected
costs and project delays, but also provides project managers with better budget control.
Security. Well-tested products are reliable. They ensure that the tested system doesn't contain
potential vulnerabilities that can put end users and system data at risk of potential threats.
Customer satisfaction. System testing offers visibility into the stability of a product at every
stage of development. This builds customer confidence and improves the overall user
experience.
Easier code modification. System testing can identify code problems during software
development. Fixing older code that has gone into the production environment is much harder
than modifying it while it's still in development.
With system testing, a QA team gauges if an application meets all of its technical, business
and functional requirements. To accomplish this, the QA team might utilize various types of software
testing techniques that determine the overall test coverage for an application and help catch critical
defects that hamper an application's core functionalities before release.
Alpha testing is conducted in the organization and tested by a representative group of end-users at
the developer's side and sometimes by an independent team of testers.
Beta testing is a type of User Acceptance Testing among the most crucial testing, which performed
before the release of the software. Beta Testing is a type of Field Test. It is a type of salient testing.
Real users perform this testing. This testing executed after the alpha testing. In this the new version,
beta testing is released to a limited audience to check the accessibility, usability, and functionality, and
more.Beta testing is the last phase of the testing, which is carried out at the client's or
customer's site.
9
10
Performance testing. Performance testing measures the speed, average load time, stability,
reliability and peak response times of the system under various conditions. It's typically coupled
with stress testing and may include both hardware and software testing tools.
Usability testing. These are tests to evaluate if a system is easy to use and functional for the
end user. Metrics, including user error rates, task success rates, the time it takes a user to
complete a task and user satisfaction, are used during testing.
Load testing. This is testing to determine how a system or software performs under a real-life
extreme load and test scenarios. Metrics, such as throughput, number of users and latency, are
measured through this testing.
Regression testing. Also known as sanity testing, it ensures that all changes introduced into an
application or code during system testing, recent code changes or updates haven't caused any
new bugs or issues. Regression testing is responsible for the functionality of the existing features
of a system or software.
Migration testing. This is conducted to ensure smooth migration of legacy systems to new
systems without disruptions, data loss or downtimes.
Functionality testing. This is conducted to validate a system's functionality against its functional
and business requirements.
Recovery testing. This is a type of nonfunctional testing done to ensure that a system is capable
of recovering from certain system errors, crashes and failures.
White box testing techniques analyze the internal structures the used data structures, internal
design, code structure, and the working of the software It is also called glass box testing or clear box
testing or structural testing. White Box Testing is also known as transparent testing or open box
testing. 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.
White box testing is also known as structural testing or code-based testing, and it is used to test
the software’s internal logic, flow, and structure. The tester creates test cases to examine the code
paths and logic flows to ensure they meet the specified requirements.
Statement coverage: In this technique, the aim is to traverse all statements at least once.
Hence, each line of code is tested. In the case of a flowchart, every node must be traversed at
least once. Since all lines of code are covered, it helps in pointing out faulty code.
10
11
Branch Coverage: In this technique, test cases are designed so that each branch from all
decision points is traversed at least once. In a flowchart, all edges must be traversed at least
once.
Condition Coverage: In this technique, all individual conditions must be covered as shown in
the following example:
1. READ X, Y
2. IF(X == 0 || Y == 0)
3. PRINT ‘0’
4. #TC1 – X = 0, Y = 55
5. #TC2 – X = 5, Y = 0
Multiple Condition Coverage: In this technique, all the possible combinations of the possible
outcomes of conditions are tested at least once. Let’s consider the following example:
1. READ X, Y
2. IF(X == 0 || Y == 0)
3. PRINT ‘0’
4. #TC1: X = 0, Y = 0
5. #TC2: X = 0, Y = 5
6. #TC3: X = 55, Y = 0
7. #TC4: X = 55, Y = 5
8.
Basis Path Testing: In this technique, control flow graphs are made from code or flowchart
and then Cyclomatic complexity is calculated which defines the number of independent paths
so that the minimal number of test cases can be designed for each independent path. Steps:
11
12
Loop Testing: Loops are widely used and these are fundamental to many algorithms hence,
their testing is very important. Errors often occur at the beginnings and ends of loops.
1. Simple loops: For simple loops of size n, test cases are designed that:
Skip the loop entirely
Only one pass through the loop
2 passes
m passes, where m < n
n-1 ans n+1 passes
2. Nested loops: For nested loops, all the loops are set to their minimum count, and we start
from the innermost loop. Simple loop tests are conducted for the innermost loop and this is
worked outwards till all the loops have been tested.
3. Concatenated loops: Independent loops, one after another. Simple loop tests are applied
for each. If they’re not independent, treat them like nesting.
White Testing is performed in 2 Steps:
1. Tester should understand the code well
2. Tester should write some code for test cases and execute them
Advantages:
1. White box testing is thorough as the entire code and structures are tested.
2. It results in the optimization of code removing errors and helps in removing extra lines of code.
3. It can start at an earlier stage as it doesn’t require any interface as in the case of black box
testing.
4. Easy to automate.
5. White box testing can be easily started in Software Development Life Cycle.
6. Easy Code Optimization.
Some of the advantages of white box testing include:
Testers can identify defects that cannot be detected through other testing techniques.
Testers can create more comprehensive and effective test cases that cover all code paths.
Testers can ensure that the code meets coding standards and is optimized for performance.
However, there are also some disadvantages to white box testing, such as:
Testers need to have programming knowledge and access to the source code to perform tests.
Testers may focus too much on the internal workings of the software and may miss external
issues.
Testers may have a biased view of the software since they are familiar with its internal
workings.
Overall, white box testing is an important technique in software engineering, and it is useful for
identifying defects and ensuring that software applications meet their requirements and
specifications at the code level
Disadvantages:
1. It is very expensive.
2. Redesigning code and rewriting code needs test cases to be written again.
3. Testers are required to have in-depth knowledge of the code and programming language as
opposed to black-box testing.
4. Missing functionalities cannot be detected as the code that exists is tested.
5. Very complex and at times not realistic.
6. Much more chances of Errors in production.
12
13
13