Software Testing Unit 2
Software Testing Unit 2
UNIT II
Types and Levels of Testing
Presented by
M S RATHOD
LIF, GPA
COURSE OUTCOMES (COs)
At the end of this course, student will be able to:
1) Apply various software testing methods.
2) Prepare test cases for different types and levels
of testing.
3) Prepare test plan for an application.
4) Identify bugs to create defect report of given
application.
5) Test software for performance measures using
automated testing tools.
6) Apply different testing tools for a given
application.
Unit Outcomes
Apply specified testing level for a web
based application.
Apply Acceptance testing for given web
based application.
Apply the given performance testing for
an application.
Generate test cases for the given
application using regression and GUI
testing.
Levels of testing
Unit/component testing
The most basic type of testing.
verify each part of the software by isolating it
perform tests to demonstrate that each individual
component is correct in terms of fulfilling
requirements and the desired functionality.
performed at the earliest stages of the development
process.
to minimises software development risks, as well
as time and money wasted in having to go back
and undo fundamental problems in the program
once it is nearly completed.
Integration testing
aims to test different parts of the system in combination in
order to assess if they work correctly together
By testing the units in groups, any faults in the way they
interact together can be identified.
testers can adopt either a bottom-up or a top-down integration
method.
In bottom-up integration testing, testing builds on the results
of unit testing by testing higher-level combination of units
(called modules) in successively more complex scenarios.
It is recommended that testers start with this approach first,
before applying the top-down approach which tests higher-
level modules first and studies simpler ones later.
System testing
As the name implies, all the components of the software
are tested as a whole in order to ensure that the overall
product meets the requirements specified.
a very important step as the software is almost ready to
ship and it can be tested in an environment which is very
close to that which the user will experience once it is
deployed.
System testing enables testers to ensure that the product
meets business requirements, as well as determine that it
runs smoothly within its operating environment. This
type of testing is typically performed by a specialized
testing team.
Acceptance testing
a product is given the green light or not.
The aim of this type of testing is to evaluate whether the system
complies with the end-user requirements and if it is ready for
deployment.
The testing team will utilise a variety of methods, such as pre-
written scenarios and test cases to test the software and use the
results obtained from these tools to find ways in which the system
can be improved.
The scope of acceptance testing ranges from simply finding
spelling mistakes and cosmetic errors, to uncovering bugs that
could cause a major error in the application.
By performing acceptance tests, the testing team can find out how
the product will perform when it is installed on the user’s system.
There are also various legal and contractual reasons why
acceptance testing has to be carried out.
The testing sequence
Stubs and drivers in Unit Testing
Suppose you have two units and you do
not want to test the units individually but
as an integrated system to save your time.
Once the system is integrated and you
found error in an integrated system it
becomes difficult to differentiate that the
error occurred in which unit so unit
testing is mandatory before integrating the
units.
Stubs and drivers in Unit Testing
When developer is coding the software it
may happen that the dependent modules
are not completed for testing,in such cases
developers use stubs and drivers to
simulate the called(stub) and
caller(driver) units.
Unit testing requires stubs and drivers,
stubs simulates the called unit and driver
simulates the calling unit.
Stubs and drivers in Unit Testing
STUBS:
Assume you have 3 modules, Module A, Module B and
module C. Module A is ready and we need to test it, but
module A calls functions from Module B and C which are
not ready, so developer will write a dummy module which
simulates B and C and returns values to module A. This
dummy module code is known as stub.
DRIVERS:
Now suppose you have modules B and C ready but
module A which calls functions from module B and C is
not ready so developer will write a dummy piece of code
for module A which will return values to module B and C.
This dummy piece of code is known as driver.
Integration Testing
Integration Testing focuses on checking
data communication amongst these
modules. Hence it is also termed as ‘I &
T’ (Integration and Testing), ‘String
Testing’ and sometimes ‘Thread
Testing’.
Example of Integration Test Case
This testing type is carried out at the This testing is carried at the end
developer's site. user's location.
In-depth reliability and security of In-depth reliability and security
the product are not done in this of the product are checked, and
testing type. patches are being released.
It uses both white box as well as It uses black box Testing only.
black box testing.
Execution of the test cycle might take Execution time for the test
a longer time. requires only a few months (at
maximum).
Regression Testing
REGRESSION TESTING is defined as a type of
software testing to confirm that a recent program or
code change has not adversely affected existing
features.
Regression Testing is nothing but a full or partial
selection of already executed test cases which are re-
executed to ensure existing functionalities work fine.
This testing is done to make sure that new code
changes should not have side effects on the existing
functionalities. It ensures that the old code still
works once the latest code changes are done.
Need of Regression Testing
mainly arises whenever there is
requirement to change the code and we
need to test whether the modified code
affects the other part of software
application or not.
Moreover, regression testing is needed,
when a new feature is added to the
software application and for defect fixing
as well as performance issue fixing.
How to do Regression Testing
In order to do Regression Testing process, we need
to first debug the code to identify the bugs.
Once the bugs are identified, required changes are
made to fix it, then the regression testing is done by
selecting relevant test cases from the test suite that
covers both modified and affected parts of the code.
Software maintenance is an activity which includes
enhancements, error corrections, optimization and
deletion of existing features. These modifications
may cause the system to work incorrectly.
Therefore, Regression Testing becomes necessary.
Regression Testing Techniques
Regression Testing Techniques
Retest All :- all the tests in the existing test bucket or
suite should be re-executed. This is very expensive as
it requires huge time and resources.
Regression Test Selection :- some selected test cases
from test suite are executed to test whether the
modified code affects the software application or not.
Prioritization of Test Cases:- Prioritize the test cases
depending on business impact, critical & frequently
used functionalities. Selection of test cases based on
priority will greatly reduce the regression test suite.
GUI Testing
a software testing type that checks the Graphical User
Interface of the Software.
The purpose of Graphical User Interface (GUI) Testing is to
ensure the functionalities of software application work as per
specifications by checking screens and controls like menus,
buttons, icons, etc.
GUI is what the user sees.
Say if you visit any website what you will see say homepage
it is the GUI (graphical user interface) of the site.
A user does not see the source code. The interface is visible
to the user.
Especially the focus is on the design structure, images that
they are working properly or not.
GUI Testing
GUI Testing
In Previous example, if we have to do
GUI testing we first check that the images
should be completely visible in different
browsers.
Also, the links are available, and the
button should work when clicked.
Also, if the user resizes the screen, neither
images nor content should shrink or crop
or overlap.