Lecture 3: Software Testing
Overview
This lecture provides a comprehensive introduction to software testing principles and practices. Software testing ensures that applications function correctly, meet specified requirements, and deliver a high-quality user experience. We'll explore various testing methodologies, from unit testing to acceptance testing, and examine both manual and automated approaches.
Lecture Material (PDF)
Unit Testing Material (PDF)
Core Testing Types
Different testing levels target specific aspects of software quality. Understanding when and how to apply each type is essential for comprehensive testing coverage.
Unit Testing
Tests individual components of the software to ensure they work in isolation. Focuses on the smallest testable parts like functions or methods.
Integration Testing
Ensures that different modules or services work together as expected. Tests the interfaces and interactions between integrated components.
System Testing
Verifies that the complete software system meets the specified requirements. Tests the entire application as a whole in an environment similar to production.
Acceptance Testing
Ensures the software meets business needs and is ready for release. Validates that the system satisfies user requirements and business objectives.
Testing Methodologies & Approaches
Different testing approaches provide unique perspectives on software quality. Combining these methods creates a comprehensive testing strategy.
Static Testing
Involves reviewing documents and code without executing the software. Includes code reviews, walkthroughs, and inspections to identify defects early.
Dynamic Testing
Involves executing code and checking the output for expected results. Validates actual behavior against expected outcomes during runtime.
White Box Testing
The tester has knowledge of the internal code and tests the logic directly. Examines internal structures, paths, conditions, and loops within the code.
Black Box Testing
Tests functionality without knowing the internal workings of the software. Focuses on inputs and outputs without concern for internal implementation.
Manual Testing
Human testers manually execute tests and review the results. Provides flexibility and intuition but can be time-consuming and prone to human error.
Automated Testing
Uses software tools to run tests automatically, improving efficiency. Enables rapid execution of repetitive tests and continuous integration workflows.
Testing Lifecycle & Components
Effective testing requires proper planning, execution, and tracking. These components form the foundation of a structured testing process.
Test Plans
A test plan outlines the testing strategy, scope, and resources needed for testing. Defines objectives, schedule, responsibilities, and deliverables.
Test Cases
Test cases define the inputs, execution conditions, and expected results for a test. Provide step-by-step instructions to validate specific functionality.
Test Scripts
A set of instructions that are executed during testing, especially in automated tests. Can be written in programming languages or testing frameworks.
Test Data
Data used during testing to check the system's behavior under various conditions. Includes valid, invalid, boundary, and edge case data.
Test Metrics
Metrics like pass/fail rates help measure the effectiveness of testing. Track defect density, code coverage, and test execution progress.
Bug Tracking
Tracking and managing bugs is critical to fixing defects in a timely manner. Documents issues, assigns priorities, and monitors resolution status.
Regression Testing
Ensures that new code changes do not break existing functionality. Re-runs previous tests after modifications to verify stability.
Review Techniques
Reviews help identify errors early and improve software quality. Includes peer reviews, inspections, and technical walkthroughs.
Specialized Testing Areas
Beyond functional testing, specialized approaches target specific quality attributes like performance, security, and user experience.
Performance Testing
Tests how the system performs under high load or stress conditions. Identifies bottlenecks and ensures acceptable response times.
Load Testing
Measures the system's ability to handle expected user loads. Simulates concurrent users to verify scalability and resource utilization.
Stress Testing
Puts the system under extreme conditions to test its limits. Determines breaking points and how the system recovers from failures.
Security Testing
Identifies vulnerabilities and ensures that the system is secure against attacks. Tests for common vulnerabilities like SQL injection and cross-site scripting.
Usability Testing
Ensures the software is user-friendly and meets the needs of its users. Evaluates user interface design, navigation, and overall user experience.
Labs & Practical Exercises
Apply your knowledge of software testing through hands-on lab exercises. These labs will help you write effective tests and implement automated testing strategies.
Lab Answers
Check your solutions and compare with provided answers.
Tools & Further Reading
Enhance your understanding of software testing with these curated resources, including articles, tutorials, and tools.
VLE Page
Course management and resources.