Software testing is the process of evaluating software to identify defects and verify that it satisfies specified functional and non-functional requirements. Testing improves software quality by detecting failures before the product reaches users. It cannot prove that software is completely error-free; it only demonstrates the presence of defects under tested conditions.
Verification vs Validation
| Verification | Validation |
|---|---|
| Checks whether the software is built according to specifications. | Checks whether the software satisfies user and business requirements. |
| Process-oriented. | Product-oriented. |
| Static activity. | Dynamic activity. |
| Does not require executing the software. | Requires executing the software. |
| Performed using reviews, inspections, walkthroughs, and static analysis. | Performed using different levels of testing. |
Example
Requirement: Password must contain at least 8 characters.
- Reviewing the requirement document to ensure this rule exists is Verification.
- Running the application and testing passwords of different lengths is Validation.
Software Testing Principles
1. Testing Shows Presence of Defects
Testing identifies defects but cannot guarantee their absence.
2. Exhaustive Testing Is Impossible
Testing every possible input, path, and condition is impossible except for very small programs. Testing focuses on representative and high-risk cases.
3. Early Testing Saves Cost
Finding defects during requirement analysis or design is much cheaper than fixing them after deployment.
4. Defect Clustering
Most defects are usually concentrated in a small number of modules.
5. Pesticide Paradox
Running the same test cases repeatedly eventually finds fewer new defects. Test cases must be updated regularly.
6. Testing Depends on Context
Testing strategies differ for banking software, gaming applications, healthcare systems, and embedded systems.
7. Absence of Errors Fallacy
Even if software has no defects, it is still a failure if it does not meet user requirements.
Software Testing Life Cycle (STLC)
Requirement Analysis
- Study functional and non-functional requirements.
- Identify testable features.
- Prepare Requirement Traceability Matrix (RTM).
Test Planning
- Define testing scope.
- Select testing techniques.
- Estimate cost and schedule.
- Choose testing tools.
- Allocate resources.
Deliverable: Test Plan.
Test Case Development
- Write test cases.
- Prepare test data.
- Review and update test cases.
Environment Setup
- Configure hardware and software.
- Install required tools.
- Prepare databases and servers.
Test Execution
- Execute test cases.
- Record Pass/Fail status.
- Report defects.
Defect Reporting and Tracking
Each defect contains:
- Defect ID
- Description
- Steps to reproduce
- Expected result
- Actual result
- Severity
- Priority
- Status
Common defect statuses:
New → Assigned → Open → Fixed → Retest → Closed
If not fixed:
Reopened
Test Closure
- Verify completion of testing.
- Prepare summary report.
- Document lessons learned.
- Archive test artifacts.
Levels of Testing
Testing progresses from the smallest software component to the complete system.
Unit Testing
Tests individual units such as functions, methods, or classes.
Performed by:
- Developers
Purpose:
- Verify each unit works correctly in isolation.
Common tools:
- JUnit
- NUnit
- pytest
- TestNG
Example
calculateSalary()
sortArray()
loginValidator()
Advantages
- Detects bugs early.
- Simplifies debugging.
- Supports code refactoring.
Integration Testing
Tests interaction between multiple modules.
Performed by:
- Developers
- QA Engineers
Purpose
Ensure integrated modules communicate correctly.
Example
Frontend → API → Database
Testing verifies:
- Correct request format
- Correct response
- Proper error handling
Integration Strategies
Big Bang
All modules integrated simultaneously.
Advantages
- Simple for small projects.
Disadvantages
- Difficult debugging.
- Defects are hard to isolate.
Top-Down
Testing starts from top-level modules.
Uses:
- Stubs
Advantages
- High-level logic tested early.
Disadvantages
- Lower modules tested later.
Bottom-Up
Testing starts from low-level modules.
Uses:
- Drivers
Advantages
- Core utilities tested early.
Disadvantages
- User interface tested late.
Sandwich (Hybrid)
Combination of Top-Down and Bottom-Up.
Suitable for large systems.
System Testing
Tests the complete integrated application.
Performed by:
- QA Team
Purpose
Verify the entire system against functional and non-functional requirements.
Examples
- User registration
- Login
- Shopping cart
- Payment
- Order confirmation
Everything is tested together.
Acceptance Testing
Final testing before release.
Performed by:
- Customer
- Client
- Business users
- QA
Purpose
Ensure the software satisfies business requirements.
Types
User Acceptance Testing (UAT)
Conducted by end users.
Business Acceptance Testing (BAT)
Checks business workflows.
Operational Acceptance Testing (OAT)
Checks backup, recovery, maintenance, and deployment readiness.
Contract Acceptance Testing
Ensures contractual requirements are satisfied.
Regulatory Acceptance Testing
Ensures compliance with legal and industry standards.
Black Box Testing
Tests software without knowledge of internal implementation.
Focus
Input → Output
Tester knows only requirements.
Techniques
- Equivalence Partitioning
- Boundary Value Analysis
- Decision Table Testing
- State Transition Testing
- Error Guessing
Advantages
- No programming knowledge required.
- Tests software from the user’s perspective.
- Effective for functional testing.
Disadvantages
- Limited code coverage.
- Internal logic cannot be verified.
White Box Testing
Tests internal program structure.
Tester has full knowledge of source code.
Focus
- Statements
- Branches
- Loops
- Conditions
- Paths
Performed mainly by developers.
Advantages
- High code coverage.
- Detects logical errors.
- Finds unreachable code.
Disadvantages
- Requires programming knowledge.
- Time-consuming.
Gray Box Testing
Combination of Black Box and White Box testing.
Tester has partial knowledge of system design.
Commonly used for:
- Integration testing
- Database testing
- API testing
Test Case Design Techniques
Equivalence Partitioning (EP)
Input values are divided into groups that should behave similarly.
One value from each partition is sufficient.
Example
Age: 1–120
Partitions
- Age < 1 → Invalid
- Age 1–120 → Valid
- Age > 120 → Invalid
Sample tests
- -5
- 25
- 130
Boundary Value Analysis (BVA)
Defects often occur at boundaries.
Test values immediately below, at, and above boundaries.
Example
Valid range
1–120
Test cases
- 0
- 1
- 2
- 119
- 120
- 121
Decision Table Testing
Used when output depends on multiple conditions.
Example
| Premium User | Subscription Active | Access |
|---|---|---|
| Yes | Yes | Allow |
| Yes | No | Deny |
| No | Yes | Deny |
| No | No | Deny |
Useful for banking, insurance, discounts, and business rules.
State Transition Testing
Used when behavior depends on the current state.
Example
Logged Out
│
Login
│
Logged In
│
Session Timeout
│
Logged Out
Test both valid and invalid transitions.
Error Guessing
Relies on tester experience.
Common guesses
- Empty input
- Very long strings
- Special characters
- Duplicate entries
- Null values
- Invalid dates
Functional Testing
Checks whether each feature works according to requirements.
Examples
- Login
- Registration
- Search
- Payment
- Logout
Non-Functional Testing
Evaluates quality attributes of the software.
Performance Testing
Measures speed and efficiency.
Includes
Load Testing
Expected number of users.
Stress Testing
Beyond expected limits.
Spike Testing
Sudden increase in traffic.
Endurance Testing
Long-duration execution.
Volume Testing
Large amount of data.
Metrics
- Response time
- Throughput
- CPU usage
- Memory usage
Security Testing
Checks protection against attacks.
Common vulnerabilities
- SQL Injection
- Cross-Site Scripting (XSS)
- Cross-Site Request Forgery (CSRF)
- Authentication bypass
- Authorization issues
- Session hijacking
Usability Testing
Evaluates how easily users interact with the application.
Checks
- Navigation
- Learnability
- Accessibility
- User satisfaction
Compatibility Testing
Verifies software works across:
- Browsers
- Operating systems
- Devices
- Screen sizes
Reliability Testing
Ensures stable operation over time without unexpected failures.
Recovery Testing
Verifies the system can recover after failures.
Examples
- Power failure
- Server crash
- Database failure
- Network interruption
Regression Testing
Regression testing verifies that new code changes have not affected existing functionality.
Performed
- After bug fixes
- After enhancements
- After refactoring
- Before every release
Usually automated because it is repetitive.
Smoke Testing
A quick test of critical functionality after a new build.
Purpose
Determine whether the build is stable enough for detailed testing.
Examples
- Application launches
- Login works
- Main pages load
If smoke testing fails, detailed testing is stopped.
Sanity Testing
Performed after small code changes or bug fixes.
Purpose
Verify only the affected functionality.
Narrow and focused compared to smoke testing.
Alpha Testing
Performed at the developer’s site before product release.
Performed by
- Internal QA
- Developers
Environment
Controlled
Purpose
Find defects before external users receive the product.
Beta Testing
Performed after Alpha testing.
Conducted by real users in their own environment.
Purpose
Collect real-world feedback.
Identify environment-specific issues.
Improve usability before public release.
Manual Testing
Testing performed without automation tools.
Suitable for
- Exploratory testing
- UI testing
- Usability testing
- Ad-hoc testing
Advantages
- Flexible
- Human observation
- Better user experience evaluation
Disadvantages
- Slow
- Repetitive
- Prone to human error
Automation Testing
Testing performed using software tools and scripts.
Common tools
- Selenium
- Cypress
- Playwright
- JUnit
- TestNG
- pytest
Suitable for
- Regression testing
- Smoke testing
- Performance testing
- Continuous Integration (CI/CD)
Advantages
- Fast execution
- High accuracy
- Repeatable
- Supports continuous delivery
Disadvantages
- Initial setup cost
- Requires maintenance
- Requires programming knowledge
Manual vs Automation Testing
| Aspect | Manual Testing | Automation Testing |
|---|---|---|
| Human involvement | Required | Minimal |
| Speed | Slow | Fast |
| Accuracy | Lower | Higher |
| Cost | Low initially | High initially |
| Reusability | Limited | High |
| Best suited for | Exploratory, usability | Regression, repetitive testing, CI/CD |
Severity vs Priority
| Severity | Priority |
|---|---|
| Measures impact of a defect on the system. | Measures urgency of fixing the defect. |
| Set by QA. | Set by Project Manager or Product Owner. |
| Technical impact. | Business impact. |
Examples
High Severity, Low Priority
Typo causing application crash in an unused feature.
Low Severity, High Priority
Misspelled company name on the home page before product launch.
Common Placement Interview Questions
What is software testing?
Software testing is the process of executing and evaluating software to identify defects and verify that it satisfies specified requirements.
What is the difference between verification and validation?
Verification checks whether the software is built according to specifications without execution. Validation checks whether the software satisfies user requirements by executing the software.
What is the difference between smoke and sanity testing?
Smoke testing verifies whether the overall build is stable. Sanity testing verifies that specific changes or bug fixes work correctly.
What is regression testing?
Regression testing ensures that recent code changes have not introduced defects into existing functionality.
What is the difference between Alpha and Beta testing?
Alpha testing is performed internally in a controlled environment before release. Beta testing is performed by real users in their own environment to collect practical feedback.
Why is Boundary Value Analysis effective?
Most software defects occur at input boundaries. Testing values at, just below, and just above boundaries increases the probability of finding defects.
What is the difference between Black Box and White Box testing?
Black Box testing verifies functionality based on inputs and outputs without code knowledge. White Box testing verifies internal code structure, logic, branches, and execution paths.
What are Stubs and Drivers?
- Stub: Temporary module used to simulate a lower-level component during Top-Down Integration Testing.
- Driver: Temporary module used to simulate a higher-level component during Bottom-Up Integration Testing.
Premium Content
Unlock Software Testing Fundamentals and all premium lessons with a subscription.
From ₹199.99/year — See plans