Module 09 Software Testing
Module 09 Software Testing
Software Testing
Introduction
Today, we will explore the fundamental concepts of software testing, its importance, and
various testing methods and techniques used in the industry. Software testing ensures that a
software product functions correctly and meets all specified requirements and business needs.
What is Software Testing?
Software testing involves executing a software product to verify that it produces the desired
outcomes and fulfills all requirements. The process aims to identify defects and bugs so they
can be recorded, analyzed, and corrected. In simple terms, software testing compares the actual
behavior of the product with the expected behavior.
Key Points:
Objective: Ensure desired outcomes and requirements are met.
Defects & Bugs: Identify and correct issues.
Quality Assurance: Provide a concrete view of the product's quality.
Rationale for Testing
Testing is a critical component of software quality assurance. It ensures that the system works as
expected and provides stakeholders with confidence in the software product. Testing also helps
reveal risks associated with the product's implementation.
Key Points:
Confidence: Build stakeholder trust in the product.
Risk Identification: Highlight potential issues before deployment.
Controlled Environment: Dry-run the software to detect defects in a simulated setting.
Artifact Level Testing
The primary artifacts in software testing are the software programs or code. Testing is typically
performed by writing and executing test cases derived from use cases.
Key Points:
Test Cases: Documents describing testing activities, pre- and post-conditions, and expected
outcomes.
Use Cases: Describe user tasks that become inputs for test cases.
Major Activities in Software Testing
There are three main activities in software testing:
1. Test Planning & Preparation
Set testing goals, select methodologies, and prepare test cases and procedures.
2. Test Execution
Implement the testing strategy and measure product behavior.
3. Analysis & Follow-up
Analyze results to identify failures, take corrective actions, and ensure defect resolution.
Functional Testing
Functional testing verifies that the software functions conform to the specified requirements. It
focuses on the external behavior of the software rather than the internal implementation.
Key Points:
Verification: Ensure software functions correctly as per requirements.
Focus: External behavior and functionality.
Structural Testing
Structural testing, or white box testing, focuses on the internal implementation details of the
software product. It ensures that the programming structures and data structures are correctly
implemented.
Key Points:
Internal Focus: Verify code, data structures, and interconnections.
Code View: Test at statement, module, or sub-system level.
Black Box Testing
Black box testing, synonymous with functional testing, involves running the software to observe
any discrepancies between expected and actual performance.
Key Points:
Ad-hoc Testing: Execute the software to detect differences in performance.
Specification Checklist: Use to verify functionality and features with sample input and expected
output.
Example 1: Black Box Testing
Testing an arithmetic operation feature:
Explore supported values (floating point, integers, boundaries).
Test classic errors like division by zero.
Use different input methods (mouse, keyboard).
Example 2: Black Box Testing
Testing a Date Class with a `DaysInMonth(month, Year)` method:
Check for leap years.
Test with different years and months.
Use invalid values for edge cases.
White Box Testing
White box testing ensures correct internal implementations such as code, data structures, and
relationships. Developers perform this test using debugging tools to verify specific statements
and paths.
Key Points:
Code Coverage: Test specific code statements and paths.
Developer Involvement: Requires extensive knowledge of the code.
Example 1: White Box Testing
Testing at the statement and branch level:
Example function: `calculate (int a, int b, int c) ` with conditional branches.
Example 2: White Box Testing
Path coverage testing:
Example function: `main()` with multiple decision points.
Reviews in Testing
Reviews involve static testing methods where software artifacts are manually examined without
execution to detect defects early.
Key Points:
Early Defect Detection: Identify issues early to improve quality.
Informal Testing: Usually performed by experienced personnel.
Inspection
Inspection is a formal type of review led by a trained facilitator. It evaluates compliance with
rules, principles, or best practices, and logs identified defects.
Key Points:
Formal Activity: Led by a moderator.
Documentation: Defects are logged in a defect logging sheet.
Example of Inspection
Questions asked during code inspection:
Are there any warning messages?
Are unneeded procedures present?
Can reusable components replace any code?
Test Check List
Test checklists are steps to be executed every time testing is performed, ensuring readiness for
formal QA tests.
Key Points:
Standard Steps: List of activities before and during the test.
Readiness: Ensures system is ready for QA tests.
Example 1: Test Check List
Web testing checklist for data security:
Filter data inputs.
Define and enforce data access privileges.
Test data backup and restore processes.
Example 2: Test Check List
Web testing checklist for performance:
Identify database capacity.
Define system architecture.
Ensure load balancing is available.
Conclusion
Software testing is a comprehensive process that ensures software products meet the desired
outcomes and requirements while identifying and correcting defects. It involves various testing
methods and techniques, each focusing on different aspects of the software, from functionality
to internal structure. Regular reviews and inspections further enhance software quality by
catching defects early and ensuring compliance with best practices.