0% found this document useful (0 votes)
2 views17 pages

Software Testing - Unit 2

The document provides an overview of various types and levels of software testing, including Unit Testing, Integration Testing, System Testing, Acceptance Testing, and Special Testing. It explains the definitions, purposes, and real-time examples for each testing type, highlighting the importance of detecting defects and ensuring software quality. Additionally, it covers specific testing techniques such as Performance Testing, Security Testing, and GUI Testing, among others.

Uploaded by

sachin gade
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views17 pages

Software Testing - Unit 2

The document provides an overview of various types and levels of software testing, including Unit Testing, Integration Testing, System Testing, Acceptance Testing, and Special Testing. It explains the definitions, purposes, and real-time examples for each testing type, highlighting the importance of detecting defects and ensuring software quality. Additionally, it covers specific testing techniques such as Performance Testing, Security Testing, and GUI Testing, among others.

Uploaded by

sachin gade
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Unit – II: Types and Levels of Testing

2.1 Unit Testing


Definition
Unit Testing is the process of testing individual components or modules of a software program
to verify that each unit performs correctly.
Explanation
Unit testing is the first level of software testing in the software development process. In this
testing method, the smallest testable parts of a program, called units or modules, are tested
individually.
A unit may be:
• A function
• A method
• A class
• A module
The main purpose of unit testing is to ensure that each unit of the software works correctly
before integrating it with other modules.
Unit testing is usually performed by software developers using testing frameworks or manual
test cases.
Benefits of unit testing:
• Detects errors at an early stage
• Simplifies debugging
• Improves code quality
• Reduces development cost
Real-Time Example
Consider a banking application.
Different modules may include:
• Login module
• Balance calculation module
• Money transfer module
In unit testing, each module is tested independently. For example, the balance calculation
function is tested separately to ensure that it correctly calculates the account balance.
Driver
Definition
A Driver is a temporary program used to test a software module by calling the module and
providing test inputs.
Explanation
During unit testing, sometimes the module being tested depends on another module that has
not yet been developed. In such cases, a driver program is created to simulate the behaviour
of the missing module.
The driver program calls the unit under test, provides input data, and displays the output.
Drivers are mainly used in bottom-up integration testing.
Functions of a driver:
• Calls the module under test
• Supplies test data
• Displays results
Real-Time Example
Suppose a developer creates a function to calculate student percentage.
Before the complete system is developed, a driver program can be written to call the
percentage function and provide sample marks as input.
This helps verify whether the percentage calculation module works correctly.

Stub
Definition
A Stub is a temporary program that replaces a lower-level module and provides predefined
responses during testing.
Explanation
A stub is used when the module required by the unit under test is not yet developed. Instead of
using the real module, a stub simulates its behaviour and returns predefined results.
Stubs are mainly used in top-down integration testing.
Functions of a stub:
• Simulates the behaviour of a missing module
• Returns dummy or predefined outputs
• Helps test higher-level modules
Real-Time Example
Consider an online shopping system.
The order processing module depends on the payment module.
If the payment module is not yet developed, a stub program can be created that simply returns
a message such as:
“Payment Successful”
This allows testing of the order processing module even though the real payment system is not
available.

Difference Between Driver and Stub

Aspect Driver Stub

Purpose Calls the module under test Replaces a called module

Used In Bottom-up testing Top-down testing

Function Provides input and controls testing Simulates missing module

Example Program calling a function Dummy function returning value


2.2 Integration Testing
Definition
Integration Testing is a testing level in which individual software modules are combined and
tested together to verify their interaction and data communication.
Explanation
After Unit Testing, individual modules of the software are integrated to form a larger system.
Integration testing checks whether these modules work correctly when they are combined.
The main objective of integration testing is to detect defects related to:
• Data communication between modules
• Interface mismatches
• Incorrect function calls
• Data format differences
Integration testing ensures that modules interact properly and exchange information
correctly.
Different strategies are used for integrating modules during testing, such as:
• Top-Down Integration Testing
• Bottom-Up Integration Testing
• Bi-Directional (Sandwich) Integration Testing
Real-Time Example
Consider an online banking system consisting of:
• Login module
• Account balance module
• Fund transfer module
After testing each module separately, integration testing checks whether:
• The login module successfully allows access to the account module.
• The fund transfer module correctly updates the balance module.
Top-Down Integration Testing
Definition
Top-Down Integration Testing is a strategy in which testing begins with the top-level modules
and gradually integrates lower-level modules.
Explanation
In this approach, testing starts from the main control module of the system and moves
downward to the lower-level modules.
If lower modules are not yet developed, stubs are used to simulate their behavior.
Steps in Top-Down Integration:
1. Start testing from the main module.
2. Integrate and test the next lower-level modules.
3. Replace stubs with actual modules as they are developed.
Advantages:
• Early testing of high-level logic
• Early prototype of the system
Disadvantages:
• Lower-level modules may not be tested thoroughly initially.
Real-Time Example
In a college management system, testing begins with the main dashboard module, then
gradually integrates modules such as:
• Student information module
• Fee payment module
• Result module
If the fee module is not ready, a stub is used temporarily.
Bottom-Up Integration Testing
Definition
Bottom-Up Integration Testing is a strategy in which testing begins with lower-level modules
and gradually integrates higher-level modules.
Explanation
In this method, the lowest modules are tested first, and then they are integrated to form higher-
level modules.
If higher modules are not available, drivers are used to simulate their behavior.
Steps in Bottom-Up Integration:
1. Test lower-level modules individually.
2. Combine them to form higher-level modules.
3. Replace drivers with actual modules when available.
Advantages:
• Thorough testing of lower-level modules
• Easier fault detection
Disadvantages:
• High-level logic cannot be tested early.
Real-Time Example
In a library management system, lower modules such as:
• Book database module
• Student record module
are tested first. Later these modules are integrated with the main library management system.
Bi-Directional Integration Testing
Definition
Bi-Directional Integration Testing is a strategy that combines both Top-Down and Bottom-
Up integration approaches.
Explanation
In this method, integration testing begins simultaneously from both the top level and bottom
level modules, and testing progresses toward the middle layer.
This method is also called Sandwich Testing or Hybrid Integration Testing.
Features of this approach:
• Combines advantages of both top-down and bottom-up testing
• Allows parallel testing of modules
• Reduces testing time
Both stubs and drivers may be used during testing.
Real-Time Example
Consider a hospital management system.
Top-level modules tested first:
• User interface module
Bottom-level modules tested simultaneously:
• Patient database module
• Billing database module
Later, both levels are integrated with the middle-level service modules.

Comparison of Integration Testing Strategies

Aspect Top-Down Bottom-Up Bi-Directional

Testing Start From top modules From bottom modules From both directions

Temporary Modules Uses stubs Uses drivers Uses both

Testing Flow Downward Upward Middle integration

Advantage Early high-level testing Strong low-level testing Balanced testing


2.3 System Testing
Definition
System Testing is the process of testing the complete integrated software system to verify
that it meets the specified requirements and works correctly as a whole.
Explanation
System testing is performed after integration testing and before acceptance testing. In this
stage, the entire system is tested as a complete unit to ensure that all modules work together
correctly.
The main objective of system testing is to verify that the software system satisfies the
functional and non-functional requirements defined in the Software Requirement
Specification (SRS).
System testing checks different aspects of the system such as:
• Functional correctness – Whether all system functions work correctly
• Performance – Whether the system performs efficiently under different loads
• Security – Whether the system protects data from unauthorized access
• Usability – Whether the system is easy for users to operate
• Reliability – Whether the system works consistently without failure
System testing is usually performed by a separate testing team in an environment similar to
the real operating environment.
The purpose of system testing is to ensure that the entire software product behaves according
to user expectations before it is delivered to the customer.

Types of System Testing


Some common types of system testing include:
• Performance Testing – Checks system speed and responsiveness.
• Security Testing – Verifies protection of data and system access.
• Stress Testing – Tests system behavior under heavy load.
• Usability Testing – Checks user-friendliness of the system.
• Recovery Testing – Checks how the system recovers after failure.

Real-Time Example
Consider an online shopping system with modules such as:
• User registration module
• Product search module
• Shopping cart module
• Payment module
• Order confirmation module
After all modules are integrated, system testing checks whether:
1. Users can register and log in successfully.
2. Products can be searched and added to the cart.
3. Payment is processed correctly.
4. Order confirmation message is generated.
5. The entire system works smoothly from start to end.
If the complete workflow works correctly, the system passes system testing.

Advantages of System Testing


• Verifies the complete functionality of the system
• Detects defects in interactions between modules
• Ensures the system meets customer requirements
• Improves overall software quality and reliability
2.4 Acceptance Testing
Definition
Acceptance Testing is the process of testing the software system to verify whether it satisfies
the customer’s requirements and is ready for delivery or deployment.
Explanation
Acceptance testing is the final level of testing performed after system testing. The main
objective is to ensure that the developed software meets the business requirements and user
expectations.
This testing is usually performed by customers, end-users, or client representatives instead
of developers.
During acceptance testing, the system is evaluated in a realistic environment to check whether
it performs all required functions correctly.
If the software successfully passes acceptance testing, the customer accepts the system and
approves it for production use.
Acceptance testing helps to:
• Verify that the software meets customer requirements
• Confirm that the system works in a real environment
• Ensure the software is ready for release
• Increase customer satisfaction
Acceptance testing is mainly divided into two types:
• Alpha Testing
• Beta Testing

Alpha Testing
Definition
Alpha Testing is a type of acceptance testing performed by the development team or internal
testers at the developer’s site before releasing the software to external users.
Explanation
Alpha testing is conducted in a controlled environment by developers and testers to identify
defects before the product is released to customers.
This testing helps find issues related to:
• System functionality
• Performance problems
• Minor bugs or errors
The main goal of alpha testing is to ensure that the software is stable enough for external
testing.
It is usually performed near the end of the development phase.

Real-Time Example
Suppose a company develops a new mobile banking application.
Before releasing it to the public, the company’s internal testing team checks:
• Login functionality
• Balance inquiry
• Fund transfer
• Transaction history
This internal testing process is called Alpha Testing.

Beta Testing
Definition
Beta Testing is a type of acceptance testing performed by actual users or customers in a real
environment before the final release of the software.
Explanation
Beta testing is conducted after alpha testing. In this stage, the software is released to a limited
group of external users to test it in real-world conditions.
Users operate the system and report any bugs or usability issues to the development team.
Beta testing helps identify:
• Real-world usability problems
• Unexpected user behavior
• Performance issues in actual environments
After fixing issues discovered during beta testing, the software is released as the final product.

Real-Time Example
Before launching a new social media application, the company releases a beta version to a
limited number of users.
Users test the application and provide feedback about:
• App performance
• User interface issues
• Bugs or crashes
Based on this feedback, developers fix the problems before the official release.

Difference Between Alpha Testing and Beta Testing

Aspect Alpha Testing Beta Testing

Performed By Developers or internal testers Actual users or customers

Location Developer’s environment Real user environment

Purpose Detect defects before external release Collect feedback from real users

Stage Before beta testing After alpha testing

Participants Internal team Limited group of users


2.5 Special Testing
Special Testing refers to various testing techniques used to evaluate specific characteristics of
a software system such as performance, security, user interface, and reliability.

Performance Testing
Definition
Performance Testing is the process of testing the speed, responsiveness, and stability of a
software system under different workloads.
Explanation
Performance testing checks how efficiently the software system performs when many users
access the system simultaneously.
It helps determine whether the system can handle large volumes of data and multiple user
requests without slowing down or crashing.
Performance testing mainly evaluates:
• System response time
• Processing speed
• System stability
• Resource utilization
Two important types of performance testing are Load Testing and Stress Testing.
Real-Time Example
An online ticket booking system may experience heavy traffic when tickets open for booking.
Performance testing checks whether the system can handle thousands of users at the same time.

Load Testing
Definition
Load Testing is a type of performance testing that evaluates how the system behaves under a
normal or expected number of users.
Explanation
Load testing determines whether the system performs correctly when many users access it
simultaneously.
The system is tested with a large number of users or transactions to check if it maintains
acceptable performance levels.
Real-Time Example
Testing an online shopping website to see if it works properly when 10,000 users access the
site simultaneously.

Stress Testing
Definition
Stress Testing is a type of performance testing that evaluates the system’s behavior under
extreme or heavy workload conditions.
Explanation
Stress testing determines the maximum limit of the system by increasing the number of users
beyond normal capacity.
It helps identify the point at which the system fails or crashes.
Real-Time Example
Testing a banking system by simulating hundreds of thousands of transactions to observe
how the system behaves under extreme load.

Regression Testing
Definition
Regression Testing is the process of re-testing the software after modifications to ensure that
previously working features still function correctly.
Explanation
Whenever developers fix bugs or add new features, regression testing ensures that these
changes do not affect existing functionality.
It verifies that new code changes do not introduce new defects in previously tested modules.
Real-Time Example
If a developer fixes a bug in the login module, regression testing ensures that other modules
such as registration and password reset still work properly.
Security Testing
Definition
Security Testing is the process of testing a software system to identify vulnerabilities and
ensure protection against unauthorized access.
Explanation
Security testing verifies that the system protects sensitive information and prevents
unauthorized users from accessing the system.
It focuses on:
• Authentication
• Authorization
• Data confidentiality
• Data integrity
Real-Time Example
Testing whether a banking application prevents unauthorized users from accessing another
person's account.

Client-Server Testing
Definition
Client-Server Testing is the process of testing the interaction between the client application and
the server.
Explanation
In a client-server architecture, the client sends requests and the server processes those
requests and sends responses.
Client-server testing verifies:
• Communication between client and server
• Data transfer accuracy
• Server response time
Real-Time Example
Testing whether a web browser (client) correctly retrieves data from a web server when a
user requests a webpage.
GUI Testing
Definition
GUI Testing is the process of testing the graphical interface of a software application to ensure
that it functions correctly and is user-friendly.
Explanation
GUI testing focuses on verifying the visual elements of the application such as:
• Buttons
• Text boxes
• Menus
• Icons
• Layout and alignment
It ensures that the user interface is intuitive and operates correctly.
Real-Time Example
Testing whether the submit button on a registration form works correctly and whether all
fields are properly displayed.

Database Testing
Definition
Database Testing is the process of verifying the correctness, integrity, and consistency of data
stored in the database.
Explanation
Database testing ensures that the data stored in the database is accurate and that database
operations such as insert, update, delete, and retrieve work correctly.
It also verifies relationships between database tables.
Real-Time Example
When a user registers on a website, database testing verifies whether the user details are
correctly stored in the database.
Sanity Testing
Definition
Sanity Testing is a type of testing performed to check whether a specific functionality works
correctly after minor changes in the software.
Explanation
Sanity testing is performed after receiving a new software build to verify that the particular
module affected by code changes works properly.
It is a quick and focused testing process.
Real-Time Example
If a developer fixes a bug in the payment module, testers perform sanity testing to verify
whether the payment process works correctly.

Smoke Testing
Definition
Smoke Testing is a preliminary testing process performed to check whether the basic functions
of the software work correctly.
Explanation
Smoke testing verifies the core functionalities of the system before performing detailed
testing.
If the basic functions fail, the software build is rejected and returned to developers.
Real-Time Example
When a new version of an online banking application is released, testers first check basic
functions such as:
• Application launch
• Login functionality
• Main menu operation
If these functions work correctly, further testing continues.

You might also like