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

Software Testing Unit 2

Uploaded by

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

Software Testing Unit 2

Uploaded by

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

SOFTWARE TESTING

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

Integration Test Case differs from other


test cases in the sense it focuses mainly
on the interfaces & flow of
data/information between the modules.
Here priority is to be given for
the integrating links rather than the unit
functions which are already tested.
Example of Integration Test Case

 Sample Integration Test Cases for the following scenario:


Application has 3 modules say ‘Login Page’, ‘Mailbox’ and
‘Delete emails’ and each of them is integrated logically.
Test Case Test Case
Test Case ID Expected Result
Objective Description
Check the
Enter login
interface link
credentials and To be directed to
1 between the Login
click on the Login the Mail Box
and Mailbox
button
module
Check the
interface link From Mailbox Selected email
between the select the email should appear in
2
Mailbox and and click a delete the Deleted/Trash
Delete Mails button folder
Module
Approaches, Strategies, Methodologies of
IntegrationTesting
 Big Bang Approach :
 Incremental Approach: which is further
divided into the following
◦ Top Down Approach
◦ Bottom Up Approach
◦ Sandwich Approach – Combination of Top
Down and Bottom Up
Big Bang Approach
Big Bang Testing is an Integration testing
approach in which all the components or
modules are integrated together at once and
then tested as a unit.
This combined set of components is
considered as an entity while testing.
If all of the components in the unit are not
completed, the integration process will not
execute.
Big Bang Approach
 Advantages:
 Convenient for small systems.
 Disadvantages:
 Fault Localization is difficult.
 Given the sheer number of interfaces that need to be
tested in this approach, some interfaces link to be
tested could be missed easily.
 Since the Integration testing can commence only
after “all” the modules are designed, the testing team
will have less time for execution in the testing phase.
Incremental Testing
In the Incremental Testing approach, testing
is done by integrating two or more modules
that are logically related to each other and
then tested for proper functioning of the
application.
Then the other related modules are integrated
incrementally and the process continues until
all the logically related modules are
integrated and tested successfully.
Bottom-up Integration Testing
a strategy in which the lower level modules
are tested first.
These tested modules are then further used to
facilitate the testing of higher level modules.
 The process continues until all modules at
top level are tested.
Once the lower level modules are tested and
integrated, then the next level of modules are
formed.
Bottom-up Integration Testing
Bottom-up Integration Testing
Advantages:
Fault localization is easier.
No time is wasted waiting for all modules to
be developed unlike Big-bang approach
Disadvantages:
Critical modules (at the top level of software
architecture) which control the flow of
application are tested last and may be prone to
defects.
An early prototype is not possible
Top-down Integration Testing
a method in which integration testing
takes place from top to bottom following
the control flow of software system.
The higher level modules are tested first
and then lower level modules are tested
and integrated in order to check the
software functionality.
Stubs are used for testing if some
modules are not ready.
Top-down Integration Testing
Top-down Integration Testing
Advantages:
Possibility to obtain an early prototype.
Critical Modules are tested on priority;
major design flaws could be found and
fixed first.
Disadvantages:
Needs many Stubs.
Modules at a lower level are tested
inadequately.
Bi-directional/Sandwich Testing
strategy in which top level modules are tested
with lower level modules at the same time
lower modules are integrated with top
modules and tested as a system.
It is a combination of Top-down and Bottom-
up approaches therefore it is called Hybrid
Integration Testing.
It makes use of both stubs as well as drivers.
Bi-directional/Sandwich Testing
Entry and Exit Criteria of
Integration Testing
Entry and Exit Criteria to Integration testing phase
in any software development model
Entry Criteria:
Unit Tested Components/Modules
All High prioritized bugs fixed and closed
All Modules to be code completed and integrated
successfully.
Integration tests Plan, test case, scenarios to be
signed off and documented.
Required Test Environment to be set up for
Integration testing
Entry and Exit Criteria of
Integration Testing
Exit Criteria:
Successful Testing of Integrated
Application.
Executed Test Cases are documented
All High prioritized bugs fixed and closed
Technical documents to be submitted
followed by release Notes.
Testing on Web Application
 website testing is checking your web
application or website for potential bugs before
its made live and is accessible to general public.
Web Testing checks for functionality, usability,
security, compatibility, performance of the web
application or website.
issues such as that of web application security,
the functioning of the site, its access to
handicapped as well as regular users and its
ability to handle traffic is checked.
How to test Web Application
Functionality Testing of a Website
a process that includes several testing
parameters like user interface, APIs,
database testing, security testing, client and
server testing and basic website
functionalities.
 Functional testing is very convenient and it
allows users to perform both manual and
automated testing.
 It is performed to test the functionalities of
each feature on the website.
Functionality Testing of a Website
Web based Testing Activities includes:
Test all links in your webpages are working
correctly and make sure there are no boken
links.
Links to be checked will include :-
Outgoing links
Internal links
Anchor Links
MailTo Links
Functionality Testing of a Website
Test Forms are working as expected. This will
include-
Scripting checks on the form are working as
expected. For example- if a user does not fill a
mandatory field in a form an error message is
shown.
Check default values are being populated
Once submitted, the data in the forms is submitted
to a live database or is linked to a working email
address
Forms are optimally formatted for better readability
Functionality Testing of a Website
Test Cookies are working as expected. Cookies
are small files used by websites to primarily
remember active user sessions so you do not
need to log in every time you visit a website.
Cookie Testing will include
Testing cookies (sessions) are deleted either
when cache is cleared or when they reach their
expiry.
Delete cookies (sessions) and test that login
credentials are asked for when you next visit the
site.
Functionality Testing of a Website
Test business workflow– This will
include
Testing your end – to – end workflow/
business scenarios which takes the user
through a series of webpages to complete.
Test negative scenarios as well, such that
when a user executes an unexpected step,
appropriate error message or help is
shown in your web application.
Performance Testing
 We must ensure that the user does not wait for a service
for long, otherwise the potential user will move on to the
competitor’s site.
How long does an
application take to
respond to a user
click?

 To ensure that the web application can bear the load


during the peak hours along with serving the user in
a timely and reliable manner, performance tests
including load and stress tests need to be conducted.
Performance Testing
Several factors that may influence performance
include:
(i) Response time
(ii) Memory available
(iii) Network bandwidth
(iv) Number of users
(v) User type
(vi) Time to download
(vii) Varied client machine configurations
Performance Testing
The goal of performance testing is to evaluate
the application’s performance with respect to
real world scenarios. The following issues must
be addressed during performance testing:
(i) Performance of the system during peak hours
(response time, reliability and availability).
(ii) Points at which the system performance
degrades or system fails.
(iii) Impact of the degraded performance on the
customer loyalty, sales and profits.
Load Testing
Load testing involves testing the web application
under real world scenarios by simulating
numerous users accessing the web application
simultaneously.
It tests the web application by providing it
maximum load.
The development of plans for load testing should
begin as early as possible during the software life
cycle.
Early testing will help in detection of problems
prior to deployment of the web application.
Load Testing
Load testing may follow the following steps in
order to ensure reasonable performance during
peak hours:
(i) Defining the environment for a load test
(ii) Defining the testing strategy and
determining the number of users
(iii) Identifying potential metrics
(iv) Choosing the right tool and executing the
load test
(v) Interpreting the results
Load Testing: Defining environment for
a load test
This step involves setting up of a separate
testing environment that simulates the
production environment.
The guideline is to identify the necessary
resources in order to establish the lab for
conducting load tests.
The configuration of environment for
load tests include network configuration,
setting up server, and database set up, etc.
Load Testing: Defining testing strategy and
determining number of users
This step includes writing of test cases focusing
on the number of concurrent user requests,
synchronization of user requests, system
bottlenecks and stability issues.
The number of user may be determined by
approximating the percentage of users hitting
particular areas in the website.
The load test team may consult the requirement
specification document to collect the specific
targets of the user’s hitting the website.
Load Testing: Identifying potential metrics
Selection of appropriate metrics enables
the practitioner to determine the system
performance with respect to the
established quality benchmarks.
Metrics allow the tester to quantify the
results of the load tests.
Load Testing: Identifying potential metrics
S. Metric Description
No.
1 Web page views per It counts the number of web pages viewed per week.
week, Web page views
per hour, Web page
views per second
2 Web page hits per week, It counts the number of web pages hit per week.
Web page hits per hour,
Web page hits per
second

3 Number of concurrent It counts the number of simultaneous users accessing a


users web page within a specified time interval.
4 Response time It measures the total time it takes after sending the request
till the first response is received.
5 Minimum web page run It measures the minimum time taken by a web page to
time execute in seconds.
6 Maximum web page run It measures the maximum time taken by a web page to
time execute in seconds.
Choosing the right tool and executing
the load test
 To implement the specified testing strategy and perform
the established measurements, right load testing tool
must be chosen.
 The selection of tools depends on various factors
 such as nature and complexity of the web application,
technology used in developing the web application and
available resources (time, cost and skilled professionals)
for testing the web application.
 Tools:-Microsoft’s ACT, Neolys’ NeoLoad,
 Radview’s WebLoad, Red Gate’s ANTS profiler,
Yahoo’s Yslow, Webperformer’s Web
 Performance Load Tester and Empirix’s e-Test.
Choosing the right tool and executing
the load test
Execution of load test requires time, effort
and commitment in order to perform tests
and simulate an actual test environment.
The load tests may be executed multiple
times (repeatedly)
and the measures may be recorded for
future evaluations.
 The metrics corresponding to each change
and re-test must be recorded.
Interpreting the Results
The metrics collected by a monitoring
tool or manually must be analyzed to
check whether the system’s performance
meets the user expectation.
If the system’s performance does not meet
the specified targets, then corrective
action should be taken.
Stress Testing
 Stress testing involves execution of a web application
with more than maximum and varying loads for long
periods.
 Unlike performance and load testing, stress testing
evaluates the response of the system when the system
is given a load beyond its specified limits. It is also
 used to monitor and check the reliability of a web
application when available resources are on beyond
maximum usage.
 The behaviour of the system is monitored to determine
when the system under stress test fails and how does it
recover from the failure.
Stress Testing
Stress tests may test the web application
for the following:
(i) CPU and memory usage
(ii) Response time
(iii) Backend database
(iv) Different types of users
(v) Concurrent users
Performance testing checklist
Users
1.Have the maximum number of users
been identified for the web application?
2. Is complexity of the system
determined?
3.Are peak hours identified?
4. Is the duration of session of users
analyzed?
5. have the type of users been identified?
Performance testing checklist
Response Time
1. Is the response time calculated?
2. Is the maximum response time
determined?
3. Does the response time meet the
established threshold?
4. Are break points identified for planning
load test?
5. Are the causes of crash at the break points
identified ?
Performance testing checklist
Database
11. Is the maximum database capacity identified?
12. Are the past experiences with the database
documented?
13. Is load sharing and balancing facility
available?
14. Does the application read the database
content correctly?
15. Does the application write the database
content correctly?
Performance testing checklist
Tools
16.Are the testing tools identified?
17. Are the employees trained?
18. Is the load testing tool compatible
with the platform?
19. Is external support available for the
tool?
Performance testing checklist
General
 20. Are there any disk space limitations?
 21. Are people with required skill sets available?
 22. Has the time and number of iterations required
for testing been identified?
 23. Are rules for concurrency control being
followed?
 24. Is the maximum wait time before failure
determined?
 25. Are memory requirements and disk space
usage identified?
Security Testing
Security is the procedure used to protect
information from various threats.
The user wants implementation of a
safeguard to protect personal, sensitive and
financial information.
We want data to be accurate, reliable and
protected against unauthorized access.
Security involves various threats such as
unauthorized users, malicious users, message
sent to an unintended user, etc.
Security Threats
Security Testing
 The primary requirement of security includes:

 (i) Authentication: Is the information sent from an


authenticated user?
 (ii) Access Control: Is data protected from unauthorized users?
 (iii) Integrity: Does the user receive exactly what is sent?
 (iv) Delivery: Is the information delivered to the intended
user?
 (v) Reliability: What is the frequency of a failure? How much
time does the network take to recover from a failure? What
measures are taken to counter catastrophic failure?
 (vi) Non-repudiation: Is the receiver able to prove that the
data received came from a specific sender?
Security Testing
Virus threats are the most sophisticated types of
threats to web applications that may enter from the
network.
A virus is a program that modifies other programs
by attaching itself to the program, which may infect
the other programs when the host program executes.
The virus may perform any function such as
deleting files and programs.
The goal of testing the web application against virus
threats is to verify the methods of virus prevention,
detection and removal.
Security Testing
Virus testing ensures that:
(i) The antivirus software prevents the virus
from entering into the system.
(ii) The antivirus software efficiently detects an
infection, removes all traces of that
infection from the program and restores the
program to its original state.
(iii) Periodical updates and scans are conducted
to keep the system updated and prevent new
viruses from penetrating into the system.
Security Testing
Although the internet provides an
organization access to the outside world,
it also provides the intruders an
opportunity to access the organization’s –
Local Area Network (LAN).
Firewalls are an effective means of
protecting a network from intruders. It is
placed between the organization’s internal
network and the external network
Security Testing
It serves as a security wall between the
outside world and the organization’s
internal network.
 The aim of this wall is to protect the LAN
from the internet-based security threats and
it serves as a single point where all security
checks are imposed.
The firewall may be a single computer or a
set of computers may be combined to serve
as a firewall.
Working of firewall
Firewall testing
The idea of firewall testing is to break the system
by bypassing the security mechanisms to gain
access to the organization’s sensitive information.
This enables the tester to check the effectiveness
of the firewall. Firewall testing ensures that the
zones of risks are identified correctly, packet
filtering occurs according to the designed rules,
penetration within the boundaries established by
the firewall is not possible and events are timely
logged to keep track of an intruder.
Acceptance testing
Acceptance testing is formal testing based on
user requirements and function processing.
It determines whether the software is
conforming specified requirements and user
requirements or not.
It is conducted as a kind of Black Box testing
where the number of required users involved
testing the acceptance level of the system.
It is the fourth and last level of software
testing.
Acceptance testing
User acceptance testing (UAT) is a type of
testing, which is done by the customer before
accepting the final product.
Generally, UAT is done by the customer
(domain expert) for their satisfaction, and check
whether the application is working according to
given business scenarios, real-time scenarios.
It is done in the separate environment at the
customer place, which is known as the UAT
environment.
Alpha Testing
Alpha Testing is a type of software
testing performed to identify bugs before
releasing the software product to the real
users or public.
It is a type of acceptance testing.
The main objective is to refine the
software product by finding and fixing the
bugs that were not discovered through
previous tests.
Alpha Testing
This testing is referred to as an alpha
testing only because it is done early on,
near the end of the development of the
software, and before Beta Testing.
Alpha testing is typically performed by
in-house software engineers or QA staff.
It is the final testing stage before the
software is released into the real world.
Who is involved in Alpha testing?
Alpha testing has two phases,
The first phase of testing is done by in-house
developers.
They either use hardware-assisted debuggers or
debugger software.
The aim to catch bugs quickly.
Usually while alpha testing, a tester will come across to
plenty of bugs, crashes, missing features, and docs.
While the second phase of alpha testing is done by
software QA staff, for additional testing in an
environment. It involves both black box and
White Box Testing.
Advantage of Alpha testing
Better insight about the software’s
reliability at its early stages
Free up your team for other projects
Reduce delivery time to market
Early feedback helps to improve software
quality
Beta Testing
Beta testing is one of the final steps in
your software development lifecycle
(SDLC) before a product goes live.
Also referred to as user testing or
customer validation, beta testing aims to
ensure that end users are satisfied with a
software product before you make it
generally available (GA).
Alpha Vs Beta Testing
Alpha Testing Beta Testing
Alpha Testing is done by testers who Users and clients do it, and they
reside internally as employees of that are not the employees of any
company or organization. company or organization.

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.

You might also like