5 Software Testing
5 Software Testing
1. Testing Fundamentals
Testing is the process of evaluating a software product to
identify any discrepancies between the actual and expected
output. The primary goals of testing include validating
functionality, detecting and fixing bugs, ensuring usability,
and enhancing performance.
Key Types of Testing
1. Manual Testing:
o Conducted by a human without automation,
manual testing involves exploring the software,
interacting with features, and finding issues that
may be hard for automation to detect.
2. Automated Testing:
o Automated testing uses scripts and tools to run
tests, particularly useful for repetitive tasks,
regression tests, and large-scale testing processes.
3. Black-Box Testing:
o Focuses on testing the software's functionality
without knowledge of its internal workings. Testers
only know the input and expected output.
4. White-Box Testing:
o Involves testing the internal structures or workings
of an application. Testers examine paths, branches,
and statements within the code to check for logical
correctness.
3. Functional Testing
Functional testing focuses on verifying that each function of
the software operates in conformance with the requirements
specification. It ensures that software behaves as expected
under normal and edge conditions.
Types of Functional Testing
1. Smoke Testing:
o Performed to verify that the critical functionalities
of the application are working correctly. It acts as a
“build verification test.”
2. Sanity Testing:
o Conducted to check specific functionality after
changes or bug fixes. Sanity testing ensures the
changes work as intended.
3. Regression Testing:
o Ensures that new changes do not adversely affect
existing functionalities. Automated regression
testing is common in large projects.
4. User Acceptance Testing (UAT):
o The final phase of testing where actual users test
the software in real-world scenarios to validate it
meets their needs.
4. Structural Testing
Structural testing (or white-box testing) focuses on the code’s
internal structure, aiming to cover as much code as possible
and identify logic errors within the code itself.
Structural Testing Techniques
1. Statement Coverage:
o Ensures each statement in the code is executed at
least once.
2. Branch Coverage:
o Tests every possible branch (if-else conditions) to
verify both true and false outcomes.
3. Path Coverage:
o Covers all possible paths from start to finish in the
code.
4. Data Flow Testing:
o Analyzes the flow of data within the code,
identifying issues with variable usage.
5. Test Plan
A test plan is a document detailing the scope, approach,
resources, and schedule of intended testing activities. It
outlines objectives, test criteria, deliverables, and
responsibilities.
Key Components of a Test Plan
1. Test Objectives:
o Defines the purpose of testing and what it aims to
accomplish.
2. Scope:
o Specifies what will and will not be tested.
3. Test Schedule:
o A timeline of testing activities, including start and
end dates, milestones, and deadlines.
4. Resources and Responsibilities:
o Identifies who will be responsible for each testing
activity and what resources (tools, environments)
are required.
5. Test Criteria:
o Entry Criteria: Conditions that must be met before
testing can begin.
o Exit Criteria: Conditions that must be met before
testing is considered complete.
6. Deliverables:
o List of documents, test cases, and reports to be
produced during and after testing.
6. Activities During Testing
Testing activities ensure a structured and systematic
approach to software testing, covering the entire process
from preparation to completion.
Major Testing Activities
1. Requirement Analysis:
o Understanding the requirements and preparing test
cases aligned with those requirements.
2. Test Case Development:
o Designing test cases and preparing test data based
on requirements.
3. Environment Setup:
o Preparing the hardware and software environments
where tests will be executed.
4. Test Execution:
o Running test cases, logging results, and reporting
any failures or issues.
5. Defect Tracking and Reporting:
o Logging defects in an issue-tracking system,
categorizing them by severity, and assigning them
for fixing.
6. Test Closure:
o Summarizing the testing activities, preparing
reports, and analyzing lessons learned for future
improvements.
7. Unit Testing
Unit testing is the process of testing individual components
of a software application in isolation to ensure each part
works correctly. Typically, unit tests are written by developers
and focus on specific functions or methods.
Unit Testing Importance
• Catches bugs early in development.
• Ensures each part functions independently.
• Simplifies debugging by isolating errors to specific units.
9. Software Maintenance
Software maintenance is the process of updating, modifying,
and fixing software post-deployment. This ensures the
software continues to function as required over time.
Types of Software Maintenance
1. Corrective Maintenance:
o Fixes identified bugs and issues after deployment.
2. Adaptive Maintenance:
o Modifies software to accommodate changes in the
environment, like operating system updates.
3. Perfective Maintenance:
o Enhances performance, usability, or functionality in
response to user feedback or new requirements.
4. Preventive Maintenance:
o Addresses potential issues before they manifest,
improving software stability.