Unit 2 Levels of Testing and Special Tests
Unit 2 Levels of Testing and Special Tests
Software Testing
Levels Of Testing And
Special Tests
Levels Of Testing
Unit Testing
Unit Testing is a level of software testing where individual units/
components of a software are tested. The purpose is to
validate that each unit of the software performs as designed.
Unit Testing is the first level of testing and is performed prior
to Integration Testing.
A unit is the smallest testable part of software. It usually has
one or a few inputs and usually a single output.
It is executed by the Developer.
Unit Testing is performed by using the White Box
Testing method
Example: - A function, method, Loop or statement in program
is working fine.
Drivers
Drivers are used in bottom-up integration testing approach.
It can simulate the behavior of upper-level module that is not
integrated yet.
Drivers modules act as the temporary replacement of module and
act as the actual products.
Drivers are also used for interact with external system and usually
complex than stubs.
Driver: Calls the Module to be tested.
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.
Stubs
Stubs are used in top down integration testing.
It can simulate the behavior of lower-level module that are not
integrated.
They are act as a temporary replacement of module and provide
same output as actual product.
When needs to intact with external system then also stubs are used.
Stub: Is called by the Module under Test.
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.
Stub Driver
Type Dummy codes Dummy codes
To allow testing of the upper levels To allow testing of the lower levels of
Purpose of the code, when the lower levels of the code, when the upper levels of
the code are not yet developed. the code are not yet developed.
Benefits
Unit testing increases confidence in changing/
maintaining code. If good unit tests are written and if
they are run every time any code is changed, we will be
able to promptly catch any defects introduced due to
the change.
Codes are more reusable.
Development is faster.
The cost of fixing a defect detected during unit testing is
lesser in comparison to that of defects detected at
higher levels.
Debugging is easy.
Integration Testing
Integration Testing is a level of software testing where individual units are
combined and tested as a group.
In integration Testing, individual software modules are integrated logically
and tested as a group.
Integration testing tests integration or interfaces between components,
interactions to different parts of the system such as an operating system, file
system and hardware or interfaces between systems.
As displayed in the image below when two different modules ‘Module A’
and ‘Module B’ are integrated then the integration testing is done.
Integration Testing Approaches
Big Bang integration testing
In Big Bang integration testing all components or modules are integrated
simultaneously, after which everything is tested as a whole. As per the
below image all the modules from ‘Module 1’ to ‘Module 6’ are integrated
simultaneously then the testing is carried out.
Pros And Cons
Convenient for small systems.
Disadvantages:
Disadvantages:
•Needs many Stubs.
•Modules at lower level are tested
inadequately.
Unit Testing Integration Testing
Unit testing is a type of testing to check if the small Integration testing is a type of testing to check if different
piece of code is doing what it is suppose to do. pieces of the modules are working together.
Unit testing checks a single component of an The behavior of integration modules is considered in the
application. Integration testing.
The scope of Unit testing is narrow, it covers the Unit or
The scope of Integration testing is wide, it covers the whole
small piece of code under test. Therefore while writing a
application under test and it requires much more effort to
unit test shorter codes are used that target just a single
put together.
class.
Unit tests should have no dependencies on code Integration testing is dependent on other outside systems
outside the unit tested. like databases, hardware allocated for them etc.
This is first type of testing is to be carried out in Software This type of testing is carried out after Unit testing and
testing life cycle and generally executed by developer. before System testing and executed by the testing team.
Integration testing is further divided into different types as
Unit testing is not further sub divided into different types. follows:
Top-down Integration, Bottom-Up Integration and so on.
Unit testing is starts with the module specification. Integration testing is starts with the interface specification.
The detailed visibility of the code is comes under Unit The visibility of the integration structure is comes under
testing. Integration testing.
Unit testing mainly focus on the testing the functionality
Integration testing is to be carried out to discover the the
of individual units only and does not uncover the issues
issues arise when different modules are interacting with
arises when different modules are interacting with each
each other to build overall system.
other.
The goal of Integration testing is to test the combined
The goal of Unit testing is to test the each unit separately
modules together and ensure that every combined
and ensure that each unit is working as expected.
modules are working as expected.
Integration testing is comes under both Black box and
Unit testing comes under White box testing type.
White box type of testing.
System Testing
The process of testing of an integrated hardware and
software system to verify that the system meets its specified
requirements.
It is performed when integration testing is completed.
It is mainly a black box type testing. This testing evaluates
working of the system from a user point of view, with the help
of specification document. It does not require any internal
knowledge of system like design or structure of the code.
It contains functional and non-functional areas of
application/product.
System testing is performed in the context of a System
Requirement Specification (SRS) and/or a Functional
Requirement Specifications (FRS). It is the final test to verify
that the product to be delivered meets the specifications
mentioned in the requirement document. It should investigate
both functional and non-functional requirements.
It mainly focuses on following:
▪ External interfaces
▪ complex functionalities
▪ Security
▪ Recovery
▪ Performance
▪ Operator and user’s smooth interaction with system
▪ Documentation
▪ Usability
▪ Load / Stress
Recovery Testing
Recovery testing is a type of non-functional testing technique
performed in order to determine how quickly the system can
recover after it has gone through system crash or hardware
failure.
Recovery testing is the forced failure of the software to verify if
the recovery is successful.
For example: When an application is receiving data from a
network, unplug the connecting cable. After some time, plug
the cable back in and analyze the application’s ability to
continue receiving data from the point at which the network
connection was broken.
Example: Restart the system while a browser has a definite
number of sessions and check whether the browser is able to
recover all of them or not.
Security Testing
Security testing is a testing technique to determine if an
information system protects data and maintains
functionality as intended
It also aims at verifying 6 basic principles as listed below:
❑ Confidentiality
❑ Integrity
❑ Authentication
❑ Authorization
❑ Availability
❑ Non-repudiation
❑Confidentiality
❑Integrity
❑Authentication
This might involve confirming the identity of a person, tracing the
origins of an artifact, ensuring that a product is what its
packaging and labeling claims to be, or assuring that a
computer program is a trusted one
❑ Authorization
The process of determining that a requester is allowed to receive a
service or perform an operation.
Access control is an example of authorization.
❑ Availability
Assuring information and communications services will be ready for
use when expected.
Information must be kept available to authorized persons when
they need it.
❑ Non-repudiation (acknowledgment)
In reference to digital security, non-repudiation means to ensure
that a transferred message has been sent and received by the
parties claiming to have sent and received the message. Non-
repudiation is a way to guarantee that the sender of a message
cannot later deny having sent the message and that the recipient
cannot deny having received the message.
Example :
❖A Student Management System is insecure if
‘Admission’ branch can edit the data of
‘Exam’ branch
❖An ERP system is not secure if DEO (data
entry operator) can generate ‘Reports’
❖ An online Shopping Mall has no security if
customer’s Credit Card Detail is not
encrypted
❖A custom software possess inadequate
security if an SQL query retrieves actual
passwords of its users
Performance Testing
Performance Testing is a type of testing to ensure software
applications will perform well under their expected workload.
A software application's performance like its response time,
reliability, resource usage and scalability do matter.
The goal of Performance Testing is not to find bugs but to
eliminate performance bottlenecks.
The focus of Performance Testing is checking a software
program's
➢ Speed - Determines whether the application responds quickly
➢ Scalability - Determines maximum user load the software
application can handle.
➢ Stability - Determines if the application is stable under varying
loads
Performance Testing Process
1) Identify your testing environment –
Do proper requirement study & analyzing test goals and its
objectives. Also determine the testing scope along with test
Initiation Checklist. Identify the logical and physical production
architecture for performance testing, identify the software,
hardware and networks configurations required for kick off the
performance testing. Compare the both test and production
environments while identifying the testing environment. Get
resolve the environment-related concerns if any, analyze that
whether additional tools are required for performance testing.
This step also helps to identify the probable challenges tester
may face while performance testing.
2) Identify the performance acceptance criteria –
Identify the desired performance characteristics of the
application like Response time, Throughput and Resource
utilization.
3) Plan & design performance tests –
Planning and designing performance tests involves identifying key
usage scenarios, determining appropriate variability across users,
identifying and generating test data, and specifying the metrics
to be collected. Ultimately, these items will provide the
foundation for workloads and workload profiles. The output of this
stage is prerequisites for Test execution are ready, all required
resources, tools & test data are ready.
4) Configuring the test environment –
Prepare with conceptual strategy, available tools, designed tests
along with testing environment before execution. The output of
this stage is configured load-generation environment and
resource-monitoring tools.
5) Implement test design –
According to test planning and design create your performance
tests.
6) Execute the tests –
Collect and analyze the data.
Problem Investigation like bottlenecks (memory, disk, processor,
process, cache, network, etc.) resource usage like (memory, CPU,
network, etc.,)
Generate the Performance analysis reports containing all
performance attributes of the application.
Based on the analysis prepare recommendation report.
Repeat the above test for the new build received from client after
fixing the bugs and implementing the recommendations
7) Analyze Results, Report, and Retest
Consolidate, analyze and share test results.
Based on the test report re-prioritize the test & re-execute the same.
If any specific test result within the specified metric limit & all results
are between the thresholds limits then testing of same scenario on
particular configuration is completed.
Test objectives frequently include the
following:
Response time. For example, the product catalog must
be displayed in less than 3 seconds.
Load testing
Stress testing
Load Testing
Load Testing is type of performance testing to check system with
constantly increasing the load on the system until the time load
is reaches to its threshold value.
Here Increasing load means increasing number of concurrent
users, transactions & check the behavior of application under
test.
It is normally carried out underneath controlled environment in
order to distinguish between two different systems.
The main purpose of load testing is to monitor the response time
and staying power of application when system is performing well
under heavy load.
The successfully executed load testing is only if the specified test
cases are executed without any error in allocated time.
Simple examples of load testing:
Testing printer by sending large job.
Editing a very large document for testing of word
processor
Continuously reading and writing data into hard disk.
Running multiple applications simultaneously on server.
Testing of mail server by accessing thousands of
mailboxes
In case of zero-volume testing & system fed with zero
load.
Stress Testing
Stress Testing is performance testing type to check the stability
of software when hardware resources are not sufficient like
CPU, memory, disk space etc.
It is performed to find the upper limit capacity of the system
and also to determine how the system performs if the current
load goes well above the expected maximum.
Main parameters to focus during Stress testing are “Response
Time” and “Throughput”.
Stress testing is Negative testing where we load the software
with large number of concurrent users/processes which cannot
be handled by the systems hardware resources. This testing is
also known as Fatigue testing
Usability Testing
In usability testing basically the testers tests the ease with which
the user interfaces can be used.
It tests that whether the application or the product built is user-
friendly or not.
Usability Testing is a black box testing technique.
Usability testing also reveals whether users feel comfortable with
your application or Web site according to different parameters –
the flow, navigation and layout, speed and content – especially
in comparison to prior or similar applications.
Usability Testing tests the following features of the software.
— How easy it is to use the software.
— How easy it is to learn the software.
— How convenient is the software to end user.
Usability testing includes the following
five components:
Learnability: How easy is it for users to accomplish basic tasks the
first time they encounter the design?
Efficiency: How fast can experienced users accomplish tasks?
Memorability: When users return to the design after a period of
not using it, does the user remember enough to use it effectively
the next time, or does the user have to start over again learning
everything?
Errors: How many errors do users make, how severe are these
errors and how easily can they recover from the errors?
Satisfaction: How much does the user like using the system?
Benefits of usability testing to the end
user or the customer:
Better quality software
Performed at developer's site - testing environment. Performed in real environment, and hence activities
Hence, the activities can be controlled cannot be controlled
Only functionality, usability are tested. Reliability and Functionality, Usability, Reliability, Security testing are all
Security testing are not usually performed in-depth given equal importance to be performed
White box and / or Black box testing techniques are Only Black box testing techniques are involved
involved
Build released for Alpha Testing is called Alpha Release Build released for Beta Testing is called Beta Release
System Testing is performed before Alpha Testing Alpha Testing is performed before Beta Testing
Issues / Bugs are logged into the identified tool directly and Issues / Bugs are collected from real users in the form of
are fixed by developer at high priority suggestions / feedbacks and are considered as
improvements for future releases.
Helps to identify the different views of product usage as Helps to understand the possible success rate of the
different business streams are involved product based on real user’s feedback / suggestions.
Alpha Testing Beta Testing
Test Goals
When
Usually after System testing phase or when the Usually after Alpha Testing and product is 90% -
product is 70% - 90% complete 95% complete
Features are almost freezed and no scope for Features are freezed and no enhancements
major enhancements accepted
Build should be stable for technical user Build should be stable for real users
Alpha Testing Beta Testing
Test Duration
Many test cycles conducted Only 1 or 2 test cycles conducted
Each test cycle lasts for 1 - 2 weeks Each test cycle lasts for 4 - 6 weeks
Duration also depends on the number of issues found Test cycles may increase based on real user's
and number of new features added feedback / suggestion
Stake Holders
Engineers (in-house developers), Quality Assurance Product Management, Quality Management, and User
Team, and Product Management Team Experience teams
Participants
Technical Experts, Specialized Testers with good End users to whom the product is designed
domain knowledge (new or who were already part of
System Testing phase), Subject Matter Expertise
Customers and / or End Users can participate in Alpha Customers also usually participate in Beta Testing
Testing in some cases
Alpha Testing Beta Testing
Expectations
Acceptable number of bugs that were missed in earlier Major completed product with very less amount of bugs
testing activities and crashes
Incomplete features and documentation Almost completed features and documentation
Entry Criteria
• Alpha Tests designed and reviewed for Business • Beta Tests like what to test and procedures
requirements documented for Product usage
• Traceability matrix should be achieved for all the • No need of Traceability matrix
between alpha tests and requirements • Identified end users and customer team up
• Testing team with knowledge about the domain and • End user environment setup
product • Tool set up should be ready to capture the feedback /
• Environment setup and build for execution suggestions
• Tool set up should be ready for bug logging and test • Alpha Testing should be signed off
management
System testing should be signed-off (ideally)
Exit Criteria
• All the alpha tests should be executed and all the • All the cycles should be completed
cycles should be completed • Critical / Major issues should be fixed and retested
• Critical / Major issues should be fixed and retested • Effective review of feedback provided by participants
• Effective review of feedback provided by participants should be completed
should be completed • Beta Test summary report
• Alpha Test Summary report • Beta Testing should be signed off
• Alpha testing should be signed off
Alpha Testing Beta Testing
Pros
• Helps to uncover bugs that were not found during • Product testing is not controllable and user may test
previous testing activities any available feature in any way - corner areas are well
• Better view of product usage and reliability tested in this case
• Analyze possible risks during and after launch of the • Helps to uncover bugs that were not found during
product previous testing activities (including alpha)
• Helps to be prepared for future customer support • Better view of product usage, reliability, and security
• Helps to build customer faith on the product • Analyze the real user's perspective and opinion on the
• Maintenance Cost reduction as the bugs are identified product
and fixed before Beta / Production launch • Feedback / suggestions from real users helps in
• Easy Test Management improvising the product in future
• Helps to increase customer satisfaction on the product
Cons
• Not all the functionality of the product is expected to be • Scope defined may or may not be followed by
tested participants
• Only Business requirements are scoped • Documentation is more and time consuming - required
for using bug logging tool (if required), using tool to
collect feedback / suggestion, test procedure
(installation / uninstallation, user guides)
• Not all the participants assure to give quality testing
• Not all the feedback are effective - time taken to
review feedback is high
• Test Management is too difficult
Smoke Testing
Smoke testing is the surface level testing to certify that build provided by
development to QA is ready to accept for further testing.
In smoke testing we only checks the major functionality of the software.
Smoke testing is also known by the name BAT (Build Acceptance Test)
because it establishes the acceptance criteria for QA to accept and reject
a build for further testing. So apart from smoke testing it is also very important
for software people to know about build.
A build is called as the version of software, typically one that is still in testing
stage.
Smoke testing is performed by developers before releasing the build to the
testing team and after releasing the build to the testing team it is performed
by testers whether to accept the build for further testing or not.
If the build clears the Smoke test, then it is accepted by QA for further testing,
however if the build fails the Smoke test, then it’s rejected and QA reverts
back to previously accepted build.
Smoke Testing Example
So now the bug is reported by the testing team to the developer team to fix it.
When the developing team fixes the bug and passed it to testing team than the
testing team checks the other modules of the application means checks that fix
bug does not affect the functionality of the other modules but keep one point
always in mind that testing team only checks the extreme functionality of the
modules, do not go deep to test the details because of the short time so this is
the sanity testing.
Smoke Testing Sanity Testing
Smoke Testing is performed to ascertain that Sanity Testing is done to check the new
the critical functionalities of the program is functionality / bugs have been fixed
working fine
The objective of this testing is to verify the The objective of the testing is to verify the
"stability" of the system in order to proceed "rationality" of the system in order to proceed
with more rigorous testing with more rigorous testing
This testing is performed by the developers or Sanity testing is usually performed by testers
testers
Smoke testing is usually documented or Sanity testing is usually not documented and
scripted is unscripted
Smoke testing is like General Health Check Sanity Testing is like specialized health check
Up up
A Tutorial on
Software Testing
Following are most important tools used for both functional and regression
testing:
Selenium: This is an open source tool used for automating web applications.
Selenium can be used for browser based regression testing.
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.
GUI Testing
4. Database Testing:
Database is one critical component of your web application and stress
must be laid to test it thoroughly. Testing activities will include-
Test if any errors are shown while executing queries
Data Integrity is maintained while creating, updating or deleting data in
database.
Check response time of queries and fine tune them if necessary.
Test data retrieved from your database is shown accurately in your web
application
Testing Web Applications
5. Compatibility testing.
Compatibility tests ensures that your web application displays correctly
across different devices. This would include-
Browser Compatibility Test: Same website in different browsers will
display differently. You need to test if your web application is being
displayed correctly across browsers, JavaScript, AJAX and
authentication is working fine. You may also check for Mobile Browser
Compatibility.
The rendering of web elements like buttons, text fields etc. changes with
change in Operating System. Make sure your website works fine for
various combination of Operating systems such as Windows, Linux, Mac
and Browsers such as Firefox, Internet Explorer, Safari etc.
Testing Web Applications
6. Performance Testing:
This will ensure your site works under all loads. Software Testing activities
will include but not limited to -
Website application response times at different connection speeds
Load test your web application to determine its behavior under normal
and peak loads
Stress test your web site to determine its break point when pushed to
beyond normal loads at peak time.
Test if a crash occurs due to peak load, how does the site recover from
such an event
Make sure optimization techniques like gzip compression, browser and
server side cache enabled to reduce load times
Testing Web Applications
7. Security testing:
Security Testing is vital for e-commerce website that store sensitive
customer information like credit cards. Testing Activities will include-
Test unauthorized access to secure pages should not be permitted
Restricted files should not be downloadable without appropriate access
Check sessions are automatically killed after prolonged user inactivity
On use of SSL certificates, website should re-direct to encrypted SSL
pages.
Testing Web Applications
8. Crowd Testing:
You will select a large number of people (crowd) to execute tests which
otherwise would have been executed a select group of people in the
company. Crowdsourced testing is an interesting and upcoming
concept and helps unravel many a unnoticed defects.
Timing Diagram
Communication Diagram