ST Chap 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 57

UNIT - II

TYPES AND LEVELS OF TESTING


LEVELS OF TESTING
• There are mainly four testing levels are:
Unit testing / Module testing
• A testing technique using which individual
modules are tested to determine if there are any
issues by the developer himself.
• It is concerned with functional correctness of the
standalone modules.
• The main aim is to isolate each unit of the system
to identify, analyze and fix the defects.
• It focus on functionality and reliability of module.
• For unit testing we required DRIVERS & STUB.
Unit Testing

module
to be
tested
results

software interface
engineer
local data structures
boundary conditions
independent paths
error handling paths
test cases

5
Advantages
• Reduces Defects in the Newly developed
features or reduces bugs when changing the
existing functionality.
• Reduces Cost of Testing as defects are
captured in very early phase.
• Improves design and allows better
refactoring of code.
• Unit Tests, when integrated with build gives
the quality of the build as well.
• Stubs and drivers both are dummy modules and
are only created for test purposes. Stubs are
used in top down testing approach, when one
has the major module ready to test, but the sub
modules are still not ready yet.
Test Driver
• These are DUMMY code.
• Test Drivers are used during Bottom-up
integration testing in order to simulate the
behavior of the upper level modules that are
not yet integrated.

• Test Drivers are the modules that act as


temporary replacement for a calling module and
give the same output as that of the actual
product.

• Drivers are also used when the software needs


to interact with an external system and are
usually complex than stubs.
• The above diagrams clearly states that Modules 4, 5, 6
and 7 are unavailable for integration, whereas, above
modules are still under development that cannot be
integrated at this point of time. Hence, drivers are used
to test the modules. The order of Integration will be:
• 4,2
• 5,2
• 6,3
• 7,3
• 2,1
• 3,1
Testing Approach
• Firstly, the integration between the
modules 4,5,6 and 7

• Test the integration between the


module 4 and 5 with Driver 2

• Test the integration between the


module 6 and 7 with Driver 3
Stub
• Stubs are used during Top-down integration
testing, in order to simulate the behavior of the
lower-level modules that are not yet integrated.

• Stubs are the modules that act as temporary


replacement for a called module and give the
same output as that of the actual product.

• Stubs are also used when the software needs to


interact with an external system.
• The above diagram clearly states that Modules 1,
2 and 3 are available for integration, whereas,
below modules are still under development that
cannot be integrated at this point of time. Hence,
Stubs are used to test the modules. The order of
Integration will be:
• 1,2
• 1,3
• 2,Stub 1
• 2,Stub 2
• 3,Stub 3
• 3,Stub 4
• EX: For Example we have 3 modules login,
home, and user module.
• Login module is ready and need to test it, but
we call functions from home and user (which
is not ready). To test at a selective module we
write a short dummy piece of a code which
simulates home and user, which will return
values for Login, this piece of dummy code is
always called Stubs and it is used in a top
down integration.
Testing Approach

• Firstly, the integration between the modules


1,2 and 3

• Test the integration between the module 2


and stub 1,stub 2

• Test the integration between the module 3


and stub 3,stub 4
Integration Testing

• After completion of unit testing, the


units or modules are to be integrated
which gives raise to integration
testing.
• The purpose of integration testing is
to verify the functional, performance,
and reliability between the modules
that are integrated.
Bi-directional Integration Testing
Bi-directional Integration Testing
• It combines Top down and Bottom up integration testing
• bidirectional testing is also called as sandwich testing which is type of
integration testing. Have to test from top as well as bottom of the
program simultaneously.
• It testing all component they are not tested by Top down and Bottom up
integration.
• Bidirectional testing means testing the application both with the positive
and negative test
• STEPS IN ABOVE MODULE TESTING
• 1-2 AND BOTTOM UP
• 1-3
• 1-4
• 3-6
• 3-7
• 4-8
• 1-2-5
• 1-3-6-7
• Advantage of Big Bang Integration:
• Big Bang testing has the advantage that everything is
finished before integration testing starts.
• Disadvantages of Big Bang Integration:
• The major disadvantage is that in general it is very time
consuming
• It is very difficult to trace the cause of failures because of
this late integration.
• The chances of having critical failures are more because of
integrating all the components together at same time.
• If any bug is found then it is very difficult to detach all the
modules in order to find out the root cause of it.
• There is high probability of occurrence of the critical bugs
in the production environment
Acceptance Testing
• Acceptance testing, a testing technique
performed to determine whether or
not the software system has met the
requirement specifications.
• The main purpose of this test is to
evaluate the system's compliance with
the business requirements and verify if
it is has met the required criteria for
delivery to end users.
Acceptance Testing - In SDLC
Types of acceptance
• User acceptance- ease of use
• Operational acceptance- backup/
recovery, security
• Contract acceptance- contract done
initially
• Compliance acceptance-
government, legal or safety
regulations
Acceptance criteria are defined on the basis of
the following attributes
• Functional Correctness and Completeness
• Data Integrity
• Data Conversion
• Usability
• Performance
• Timeliness
• Confidentiality and Availability
• Installability and Upgradability
• Scalability
• Documentation
Approaches of acceptance testing

•Alpha testing
•Beta testing
Alpha and beta testing
• Pre-Alpha:- Software is a prototype. UI (user interface)
is complete. But not all features are completed. At this
stage software is not published.
• Alpha: Software is near its development and is
internally tested for bugs/issues
• Beta: Software is stable and is released to limited user
base. The goal is to get customer feedback on the
product and make changes in software accordingly
• Release Candidate (RC): Based on the feedback of Beta
Test, you make changes to the software and want to
test out the bug fixes. At this stage, you do not want to
make radical changes in functionality but just check for
bugs. RC is also put out to the public
• Release: All works, software is released to public.
• Alpha testing takes place at the developer's site by
the internal teams, before release to external
customers.
• This testing is performed without the involvement
of the development teams.
• Alpha testing is carried out in a lab environment
and usually the testers are internal employees of
the organization.
• Process of alpha testing
• In the first phase of alpha testing, the software is
tested by in-house developers during which the
goal is to catch bugs quickly.
• In the second phase of alpha testing, the software
is given to the software QA team for additional
testing.
• Beta testing also known as user testing takes
place at the end users site by the end users
to validate the usability, functionality,
compatibility, and reliability testing.
• Beta testing adds value to the software
development life cycle as it allows the "real"
customer an opportunity to provide inputs
into the design, functionality, and usability of
a product.
• These inputs are not only critical to the
success of the product but also an
investment into future products when the
gathered data is managed effectively.
Alpha Testing Beta Testing
Alpha testing performed by Testers who are Beta testing is performed by Clients or End
usually internal employees of the organization Users who are not employees of the
organization
Alpha Testing performed at developer's site Beta testing is performed at client location or
end user of the product
Reliability and Security Testing are not Reliability, Security, Robustness are checked
performed in-depth Alpha Testing during Beta Testing
Alpha testing involves both the white box and Beta Testing typically uses Black Box Testing
black box techniques
Alpha testing requires lab environment or Beta testing doesn't require any lab
testing environment environment or testing environment. Software
is made available to the public and is said to be
real time environment
Long execution cycle may be required for Alpha Only few weeks of execution are required for
testing Beta testing
Critical issues or fixes can be addressed by Most of the issues or feedback is collected from
developers immediately in Alpha testing Beta testing will be implemented in future
versions of the product
Alpha testing is to ensure the quality of the Beta testing also concentrates on quality of the
product before moving to Beta testing product, but gathers users input on the product
Alpha testing Beta testing
It is always performed by the developers at the It is always performed by the customers at
software development site. their own site.

Alpha Testing is not open to the market and Beta Testing is always open to the market and
public public.
It is always performed in Virtual Environment. It is performed in Real Time Environment.

It is always performed within the organization. It is always performed outside the organization.

It comes under the category of both White Box It is only a kind of Black Box Testing.
Testing and Black Box Testing.

It is always performed at the developer’s It is always performed at the user’s premises in


premises in the absence of the users. the absence of the development team.

Environment controlled by developers Uncontrolled environment

Software applications intended for specific Software products intended for market
customer requirements
SPECIAL TESTING

• REGRESSION TESTING
• GUI TESTING
Regression testing
• Regression testing is the process
of testing changes to computer programs to make
sure that the older programming still works with
the new changes.
• Regression testing is nothing but 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 old code
still works once the new code changes are done.
Need of regression testing
• Change in requirements and code is
modified according to the requirement
• New feature is added to the software
• Defect fixing
• Performance issue fix
Regression testing techniques
Regression testing techniques
• Retest All
– This is one of the methods for regression testing in which 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
– Instead of re-executing the entire test suite, it is better to select
part of test suite to be run
– Test cases selected can be categorized as 1) Reusable Test Cases
2) Obsolete Test Cases.
– Re-usable Test cases can be used in succeeding regression cycles.
– Obsolete Test Cases can't be used in succeeding regression cycles.
• Prioritization (process of deciding the relative importance)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.
Selecting test cases for regression testing
• Test cases which have frequent defects
• Functionalities which are more visible to the users
• Test cases which verify core features of the product
• Test cases of Functionalities which has undergone
more and recent changes
• All Integration Test Cases
• All Complex Test Cases
• Boundary value test cases
• Sample of Successful test cases
• Sample of Failure test cases
Regression Testing Tools
• Quick Test Professional (QTP):HP Quick Test
Professional is automated software designed to
automate functional and regression test cases. It
uses VbScript language for automation. It is a Data
driven , Keyword based tool.
• Rational Functional Tester (RFT):IBM's rational
functional tester is a java tool used to automate the
test cases of software applications. This is primarily
used for automating regression test cases and it also
integrates with Rational Test Manager.
• Selenium: This is an open source tool used for
automating web applications. Selenium can be used
for browser based regression testing.
GUI Testing
• GUI testing is a testing technique in which the
application's user interface is tested whether
the application performs as expected with
respect to user interface behavior.
• GUI Testing includes the application behavior
towards keyboard and mouse movements and
how different GUI objects such as toolbars,
buttons, menu bars, dialog boxes, edit fields,
lists, behavior to the user input.
GUI Testing Guidelines
• Check Screen Validations: Is the general screen
background the correct color? screen font?
edit boxes….
• Verify All Navigations
• Check usability Conditions
• Verify Data Integrity
• Verify the object states
• Verify the date Field and Numeric Field
Formats
• Can be performed manually or automated.
GUI Automation Tools
Web Application Testing
• Web Testing: Basic Steps
• If you want to make the app right, you need to go
through 6 basic steps of the testing phase. Let’s take a
look at every one of them!

• Step 1: Functionality Testing. What is a web application?


...
• Step 2: Usability Testing. When thinking about how
to test a website, the second step should be
usability testing. ...
• Step 3: Interface Testing. ...
• Step 4: Compatibility Testing. ...
• Step 5: Performance Testing. ...
• Step 6: Security Testing.
Step 1: Functionality Testing
• The first step of the testing phase is to make sure that the web
application is functionally correct. Functionality testing checks the
database connection, all links in the web pages, cookies, forms used for
submitting and/or getting info from the user etc.

• It should be done early in the developing stages to speed up the whole


app-building process and it reduces risks toward the end of the cycle. It
boils down to performing a set of tasks that can be performed both
automatically with the use of a software program or manually with a
human tester.
• Once you get the results of those tasks, you simply compare them with
the expected output. It has to be done multiple times with different
data input. If the level of accuracy is the same every time, the app is
considered functionally correct.

• Of course, no one is expecting every single little bug to be fixed every


time, but testing websites frequently gives us a better chance to
develop apps that are as functional as possible.
Step 2: Usability Testing
• When thinking about how to test a website, the second step
should be usability testing. This type of testing combines
the previously mentioned functionality testing with the
overall user experience.

• It is not the same thing as the User Acceptance testing


since the focuses are entirely different and so are the
stages of the app development during which these tests are
performed.

• Usability testing can be done by getting external testers


that simulate your expected user base, or internally by the
developers themselves. If you want to perform external
testing but don’t know where to find suitable testers, apps
like Apple’s TestFlight might help you.
Usability testing can be broken down to 4 stages:

• Developing the testing strategy in a way that


all functions of the app are examined
including the navigation and content
• Recruiting the internal or external test
participants
• Running the test with the team of experts
• Analyzing results and improving your app
accordingly
Step 3: Interface Testing
• This web page test checks whether or not all
interaction between the app server and the
web server run smoothly.
• Not only the communication process needs to
be tested, but the displaying of error
messages as well. Also, this test is used to
determine whether the interruptions by the
server and/or by the user are handled
properly.
Step 4: Compatibility Testing
• In the era of portable devices and all kinds of screens, the
compatibility testing is important to ensure that your web app
displays as it should on all device types.

• The developers need to run the browser compatibility test to


check if the app is displayed correctly in different browsers.
Another test to run is the mobile browser compatibility which,
as the name suggests, is supposed to confirm that the app
displays correctly across mobile browsers.

• Different operating systems display certain app elements


differently. This is why it is important to run the compatibility
tests with as many operating systems as possible, especially the
most popular ones such as Windows, Mac, Linux, as well as with
different popular browsers such as Chrome, Internet Explorer,
Safari, Firefox etc.
Step 5: Performance Testing
• Once you know your app is functional and responsive, you need to
check its performance under a heavy load. Performance testing
includes testing under different internet speeds as well as under
normal and peak loads.
• Even in a wider context it might be a good idea to test your overall
web server performance on a basic level, through a website speed
automated test, as page speed influences user experience a lot,
and affects your public website’s SEO. This article gives a good
insight into how a basic speed test can be performed with free tools,
and how to use the data for preparing an optimization plan. It’s not
actually a proper in-depth performance and stress testing, but a
good starting point.
• Stress testing is useful to determine the breaking point of the app; it
involves putting the app under increasing amounts of stress until it
stops functioning. After all, you need to discover your app’s breaking
point before the users do.
• Also, keep in mind that you need to determine how your app
recovers from crashes. If the recovery isn’t smooth, you need to
work on its improvement.
Step 6: Security Testing
• Once the web application is developed, it has to
be tested for security. This type of testing
includes all kinds of processes to determine the
app’s weak points and improve them as much as
possible.

• Normally, a serious of fabricated malicious


attacks are used to test how the app responds
and performs under these circumstances. If
security shortfalls are detected, it is important to
find the best way possible to overcome them.
Here are the basic steps of security testing:
• Understanding the security goals and planning the test by
considering the security needs of each of them
• Identifying the app’s security needs
• Gathering the info about the elements used to develop the app
including the OS, hardware, technology etc.
• Identifying and listing all potential threats and vulnerabilities
• Preparing the threat profile based on the listed vulnerabilities
and risks
• Preparing the test plan
• Automated testing on top of the manual testing
• Preparing the Security tests case document
• Carrying out the Security test cases execution, fixing identified
defects, retesting
• Creating a detailed report on the security testing, including the
solved issues and the risks that still persist
Best Web Application Testing Tools

• Zephyr
• Zephyr is currently the most popular web application
testing tool – and for all the right reasons. Here are its
key features:

• 1 click Integration
with JIRA, Confluence, Jenkins, Bamboo, and more
• Cloud, Server, and Data Center Deployment Options
• Advanced Analytics and DevOps Dashboards
• No Annual Commitment Required

You might also like