UNIT 02 - Levels of Testing
UNIT 02 - Levels of Testing
Levels of Testing
1. Unit Testing
Unit testing involves the testing of each unit or an individual component of the software
application. It is the first level of functional testing. The aim behind unit testing is to validate
unit components with its performance.
A unit is a single testable part of a software system and tested during the development phase
of the application software.
The purpose of unit testing is to test the correctness of isolated code. A unit component is an
individual function or code of the application. White box testing approach used for unit
testing and usually done by the developers.
Whenever the application is ready and given to the Test engineer, he/she will start checking
every component of the module or module of the application independently or one by one,
and this process is known as Unit testing or components testing.
Advantages
o Unit testing uses module approach due to that any part can be tested without waiting
for completion of another parts testing.
o The developing team focuses on the provided functionality of the unit and how
functionality should look in unit test suits to understand the unit API.
o Unit testing allows the developer to refactor code after a number of days and ensure
the module still working without any defect.
In the Software Testing process, the Stubs and Drivers are those components that are used
as a short-term alternative for a module.
In Software Testing, the words stub and drivers described as a replica of the modules that
operate as an alternative to the new or missing modules.
Stubs are mainly used in top-down integration testing; on the other hand, drivers are
mainly used in bottom-up integration testing individually and designed the enhance the
testing process.
Let us see an example of stubs and drivers, which help us to enhance our knowledge of stubs
and drivers.
Suppose we have one web application that contains four different modules, such as:
o Module-P
o Module-Q
o Module-R
o Module-S
And all the modules, as mentioned earlier, are responsible for some individual activities or
functionality, as we can observe in the following table:
Once Module-P is developed, it will go through the testing process. But, to perform and
validate the testing methods regarding Module-P, they need Module-Q, which is not yet
developed entirely and still in the developing process.
And it is not possible to test Module-P on the lack of Module-Q. Thus, in such scenarios, we
will take the help of Stubs and Drivers in the software testing process.
The Stubs and drivers will replicate all the basic functionality and features displayed by the
real Module-Q. And subsequently, it is being combined with Module-P in order to execute
the testing process effectively.
Once Module-P is developed, it will go through the testing process. But, to perform and
validate the testing methods regarding Module-P, they need Module-Q, which is not yet
developed entirely and still in the developing process.
And it is not possible to test Module-P on the lack of Module-Q. Thus, in such scenarios, we
will take the help of Stubs and Drivers in the software testing process.
The Stubs and drivers will replicate all the basic functionality and features displayed by the
real Module-Q. And subsequently, it is being combined with Module-P in order to execute
the testing process effectively.
Stubs are similar to the modules of While drivers are used to invoking
3. the software, that are under the component that needs to be
development process. tested.
Stubs are taken into use to test the Whereas the drivers are used if the
5. feature and functionality of the main module of the software isn’t
modules. developed for testing.
The stubs are taken into concern if The drivers are taken into concern
testing of upper-levels of the if testing of lower-levels of the
6. modules are done and the lower- modules are done and the upper-
levels of the modules are under levels of the modules are under
developing process. developing process.
S.No. Stubs Drivers
Integration testing
Integration testing is the second level of the software testing process comes after unit testing.
In this testing, units or individual components of the software are tested in a group. The focus
of the integration testing level is to expose defects at the time of interaction between
integrated components or units.
Once all the components or modules are working independently, then we need to check the
data flow between the dependent modules is known as integration testing.
o This testing technique deals with how higher-level modules are tested with lower-level
modules until all the modules have been tested successfully.
o In the top-down method, we will also make sure that the module we are adding is
the child of the previous one, like Child C, is a child of Child B.
n the bottom-up method, we will ensure that the modules we are adding are the parent of
the previous one as we observe in the following image:
The below facts explain the critical differences between top-down and bottom-up
integration testing, which will allow test engineers to create an informed decision regarding
which type of integration testing approach they want to select for the different testing
processes.
Difference between Top Down Integration Testing and Bottom Up Integration
Testing :
As shown in fig, assume that the software components become available in the order
mentioned by the component numbers. The individual components 1, 2, 3, 4 and 5
are tested separately and bi-directional integration performed initially with the use
of stubs and drivers.
Drivers are used to provide upstream connectivity while stubs provide downstream
connectivity .A driver is a function which redirects the requests to some other
components and stubs simulate the behavior of missing components.
After the functionality of these integrated components is tested, the drivers and stubs
are discarded. Once components 6, 7 and 8 become available, the integration
methodology then focus only on those components, as there are the components
which need focus and are new. This approach is also called “Sandwich Integration”.
Advantages:
1. Sandwich approach is useful for very large projects having several subprojects.
2. Both Top-down and Bottom-up approach starts at a time as per development
schedule.
3. Units are tested and brought together to make a system Integration is done
downwards.
Disadvantages:
1. It require very high cost for testing because one part has Top-down approach while
another part has bottom-up approach.
2. It cannot be used for smaller system with huge interdependence between different
modules. It makes sense when the individual subsystem is as good as complete
system.
doing performance testing on the application, we will concentrate on the various factors
like Response time, Load, and Stability of the application.
Load Testing
Load testing is testing where we check an application's performance by applying some load,
which is either less than or equal to the desired load.
load means that when N-number of users using the application simultaneously or sending
the request to the server at a time.
Load testing will help to detect the maximum operating capacity of an application and
any blockages or bottlenecks.
It governs how the software application performs while being accessed by several users at
the same time.
The load testing is mainly used to test the Client/Server's performance and applications
that are web-based.
In other words, we can say the load testing is used to find whether the organization used for
compering the application is necessary or not, and the performance of the application is
maintained when it is at the maximum of its user load.
Generally, load testing is used to signify how many concurrent users handle the application
and the application's scale in terms of hardware, network capacity etc.
Stress Testing
used to checks the behavior of an application by applying a load greater than the desired
load.
Stress Testing is testing used to check the accessibility and robustness of software beyond
usual functional limits. It mainly considers for critical software but it can also be used for all
types of software applications.
The stress testing includes the testing beyond standard operational size, repeatedly to
a breaking point, to get the outputs.
It highlights the error handling and robustness under a heavy load instead of correct behavior
under regular conditions.
In other words, we can say that Stress testing is used to verify the constancy and
dependability of the system and also make sure that the system would not crash under
disaster circumstances.
To analyses how the system works under extreme conditions, we perform stress
testing outside the normal load.
Security Testing
Security testing is an integral part of software testing, which is used to discover the
weaknesses, risks, or threats in the software application and also help us to stop the nasty
attack from the outsiders and make sure the security of our software applications.
The primary objective of security testing is to find all the potential ambiguities and
vulnerabilities of the application so that the software does not stop working. If we perform
security testing, then it helps us to identify all the possible security threats and also help the
programmer to fix those errors.
It is a testing procedure, which is used to define that the data will be safe and also continue
the working process of the software.
In this, the data must be retained by an official person, and they also guarantee that the data
and statement services will be ready to use whenever we need it.
Integrity
In this, we will secure those data which have been changed by the unofficial person. The
primary objective of integrity is to permit the receiver to control the data that is given by
the system.
The integrity systems regularly use some of the similar fundamental approaches as
confidentiality structures. Still, they generally include the data for the communication to
create the source of an algorithmic check rather than encrypting all of the communication.
And also verify that correct data is conveyed from one application to another.
Authorization
It is the process of defining that a client is permitted to perform an action and also receive the
services. The example of authorization is Access control.
Confidentiality
It is a security process that protracts the leak of the data from the outsider's because it is the
only way where we can make sure the security of our data.
Authentication
The authentication process comprises confirming the individuality of a person, tracing the
source of a product that is necessary to allow access to the private information or the system.
Non- repudiation
It is used as a reference to the digital security, and it a way of assurance that the sender of a
message cannot disagree with having sent the message and that the recipient cannot
repudiate having received the message.
The non-repudiation is used to ensure that a conveyed message has been sent and received
by the person who claims to have sent and received the message.
Client-server testing is a testing approach designed to verify the accurate and secure
exchange of data between the client and server, guaranteeing that requests and responses
are synchronized correctly.
This testing also involves assessing the system’s performance, scalability, and resource
utilization to confirm its ability to handle various loads and user interactions without
compromising performance. Moreover, client-server testing includes functional testing to
ensure that the application’s features and functionalities operate as expected on both the
client and server sides.
Test Scenario 1: Simulate a user registration process on a web application. Verify that user
data entered via the client-side form is correctly transmitted to the server, stored in the
database, and retrievable upon subsequent logins.
Components Tested: Client, Web Server, Database.
Functionality Validation: Confirm that the client and server components work together to
deliver the intended features and functionalities without errors or inconsistencies.
Data Integrity and Security: Ensuring that data exchanged between the client and server is
accurate, secure, and protected from unauthorized access or manipulation.
Fault Tolerance and Reliability: Testing the system’s ability to handle adverse conditions,
such as network failures or server crashes, and recover gracefully without data loss or service
disruption.
Compatibility: Verifying that the client software is compatible with different server
configurations, versions, and environments, ensuring a seamless user experience.
Scalability and Load Handling: Determining how well the system scales to accommodate a
growing number of clients and transactions while maintaining performance and stability.
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.
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.
In this, we concentrate only on those features and scenarios which are regularly used by the
customer or mostly user scenarios for the business or those scenarios which are used daily
by the end-user or the customer.
However, the software has passed through three testing levels (Unit Testing, Integration
Testing, System Testing) But still there are some minor errors which can be identified when
the system is used by the end user in the actual scenario.
Requirement Analysis:
In this step, the testing team analyzes requirement document to find out the objective of the
developed software. Test planning accomplished by using requirement document, Process
Flow Diagrams, System Requirements Specification, Business Use Cases, Business
Requirements Document and Project Charter.
Alpha Testing
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.
Alpha testing is simulated or real operational testing at an in-house site. It comes after the
unit testing, integration testing, etc. Alpha testing used after all the testing are executed.
particular lab environment and simulation of the actual environment required for this
testing.
o One of the benefits of alpha testing is it reduces the delivery time of the project.
o It provides a complete test plan and test cases.
o Free the team member for another project.
o Every feedback helps to improve software quality.
o It provides a better observation of the software's reliability and accountability.
Beta Testing
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. This testing
performs at the end of the software testing life cycle. This type of testing can be considered
as external user acceptance testing. 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
o Beta testing used in a real environment at the user's site. Beta testing helps in
providing the actual position of the quality.
o Testing performed by the client, stakeholder, and end-user.
o Beta testing always is done after the alpha testing, and before releasing it into the
market.
o Beta testing is black-box testing.
o Beta testing performs in the absence of tester and the presence of real users
o Beta testing is performed after alpha testing and before the release of the final product.
o Beta testing generally is done for testing software products like utilities, operating
systems, and applications, etc.
1) Closed beta version: Closed beta version, also known as a private beta, it is released to a
group of selected and invited people. Those people will test the software and evaluate their
features and specifications. This beta version represents the software which is capable of
delivering value, but it is not ready to be used by everyone. Because it shows the issues like
lack of documentation or missing vital features.
2) Open beta version: Open beta is also known as a public beta. The open beta opened to
the public. Any user as a tester can assess the beta version to provide the relevant
feedback and reviews. Open beta version improves the quality of the final release. This
version helps to find the various undetected errors and issues
1. In this type of testing, a software engineer has no control over the process of the
testing, as the users in the real-world environment perform it.
2. This testing can be a time-consuming process and can delay the final release of the
product.
3. Beta testing does not test the functionality of the software in depth as software still in
development.
4. It is a waste of time and money to work on the feedback of the users who do not use
the software themselves properly.
Regression Testing
Regression testing is a black box testing techniques. It is used to authenticate a code change
in the software does not impact the existing functionality of the product. Regression testing
is making sure that the product works fine with new functionality, bug fixes, or any change in
the existing feature.
Regression testing is a type of software testing. Test cases are re-executed to check the
previous functionality of the application is working fine, and the new changes have not
produced any bugs.
Regression testing can be performed on a new build when there is a significant change in the
original functionality. It ensures that the code still works even when the changes are
occurring. Regression means Re-test those parts of the application, which are unchanged.
It ensures that any change in a product does not affect the existing module of the product.
Verify that the bugs fixed and the newly added features not created any problem in the
previous working version of the Software.
When can we perform Regression Testing?
A website has a login functionality which allows users to log in only with Email. Now
providing a new feature to do login using Facebook.
Example:
Remember password removed from the login page which is applicable previously.
The need for regression testing comes when software maintenance includes enhancements,
error corrections, optimization, and deletion of existing features. These modifications may
affect system functionality. Regression Testing becomes necessary in this case.
1. Re-test All:
Re-Test is one of the approaches to do regression testing. In this approach, all the test case
suits should be re-executed. Here we can define re-test as when a test fails, and we determine
the cause of the failure is a software fault. The fault is reported, we can expect a new version
of the software in which defect fixed. In this case, we will need to execute the test again to
confirm that the fault fixed. This is known as re-testing. Some will refer to this as confirmation
testing.
o In this technique, a selected test-case suit will execute rather than an entire test-case
suit.
o The selected test case suits divided in two cases
1. Reusable Test cases.
2. Obsolete Test cases.
o Reusable test cases can use in succeeding regression cycle.
o Obsolete test cases can't use in succeeding regression cycle.
Prioritize the test case depending on business impact, critical and frequently functionality
used. Selection of test cases will reduce the regression test suite.
Disadvantages
o Regression Testing should be done for small changes in the code because even a slight
change in the code can create issues in the existing functionality.
o If in case automation is not used in the project for testing, it will time consuming and
tedious task to execute the test again and again.
GUI Testing
It is one of the unique types of software testing that is frequently used to check the
Graphical user interface features for the application or the software.
GUI testing is used to assesses a design of elements or features like:
o Text boxes
o Font size
o Font color
o Buttons
o Menus
o Links
o Layout
o Labels
o Text Formatting
o Lists
o Captions
o Icons
o Content
The primary goal of the GUI testing is to validate the features of the software, or the
application performs as per the given requirement/specifications.
o The GUI testing is used to execute the tests in matching or allocate on a Selenium Grid
with fixed Selenium Web Driver.
o The execution of GUI testing will allow us to test the feature of an application from a
user's point of view.
o As a result of Graphical user interface testing, we can get the customize test report.
o It also produces a consistent object documentation, at the same time for web elements
along with the dynamic IDs.
o Sometimes the internal performance of the system works correctly, but the user
interface doesn't; that's why GUI testing is an excellent approach in order to test other
types of applications as well.
The Graphical User Interface testing divided into two different types, which are as discussed
below:
Analog Recording
The first type of Graphical user interface testing is Analog Recording. With the help of analog
recording, people will always be connected with the GUI testing tools.
Essentially, the GUI testing tools are used to encapsulates the precise keyboard presses,
mouse clicks, and other user activities and then stores them in a file for playback. Let see
one example to understand the basic functionality of Analog Recording.
Example
The analog recording might record that a user left-clicked at position X = 700 pixels, Y = 600
pixels, or entered the word "Sign-in" in a box and then pressed the ENTER key on their
keyboard.
Object-based Recording
Another GUI testing type is Object-based recording. In this, the testing tool can connect
programmatically to that application, which needs to be tested and observe each of the
specific user interface modules, such as a text box, button, and hyperlink, as a distinct
object.
o Click
o Enter text
o Read the state(whether it is enabled or disabled)