Software Testing
Introduction
Section titled “Introduction”-
Software Testing: The process of executing a program== with the ==intent of finding errors.
- Ensures software meets requirements, is defect-free, reliable, and fit for use.
- Conducted at different levels of SDLC.
Objectives of Testing
Section titled “Objectives of Testing”-
Detect defects before delivery.
- Ensure requirements are met.
-
Increase reliability and quality.
- Validate functionality, performance, and security.
- Reduce maintenance cost.
- Build user confidence.
Principles of Testing
Section titled “Principles of Testing”- Testing shows presence of defects, not absence.
-
Exhaustive testing is impossible.
- Testing should start early (shift-left).
- Defects cluster in few modules.
- Pesticide paradox: repeated tests lose effectiveness.
-
Testing is context dependent.
-
Absence of errors fallacy: bug-free but useless software still fails.
Software Testing Life Cycle (STLC)
Section titled “Software Testing Life Cycle (STLC)”- Requirement Analysis – Identify testable requirements.
- Test Planning – Define scope, objectives, resources, risks.
- Test Case Development – Write test cases, test scripts, test data.
- Environment Setup – Hardware, software, network readiness.
- Test Execution – Run test cases, log defects.
- Test Closure – Deliver reports, metrics, lessons learned.
Levels of Testing ⭐
Section titled “Levels of Testing ⭐”- Unit Testing ⭐
-
Tests individual components (functions, classes).
- Usually automated.
- Done by developers.
-
- Integration Testing ⭐
-
Tests interaction between integrated modules.
- Approaches:
- Big-Bang Integration
- Top-Down
- Bottom-Up
- Sandwich/Hybrid
-
- System Testing
-
Tests complete system as a whole.
- Validates functional + non-functional requirements.
-
- Acceptance Testing
-
Done by client/user.
- Confirms system meets business needs.
- Types:
-
Alpha Testing (internal users). ⭐
-
Beta Testing (external users). ⭐
-
-
Types of Testing
Section titled “Types of Testing”Functional Testing
- Validates software functions as per requirements.
- Examples: Unit testing, integration, system, UAT, regression, smoke, sanity.
Non-Functional Testing
- Checks performance, scalability, security, usability, reliability.
- Examples: Load testing, stress testing, volume testing, compatibility, recovery testing.
Maintenance Testing
- After deployment, when software is modified.
- Regression Testing – ensures old functionality works after changes.
- Re-testing – validates fixes of specific defects.
Two Testing Approaches ⭐
Section titled “Two Testing Approaches ⭐”-
White Box Testing (Structural) ⭐
-
Internal logic tested.
- Techniques:
- Statement Coverage
- Branch Coverage
- Path Coverage
- Loop Testing
-
-
Black Box Testing (Functional) ⭐
-
Ignores internal code, focuses on inputs/outputs.
- Techniques:
- Equivalence Partitioning
-
Boundary Value Analysis
-
Decision Table Testing
- State Transition Testing
-
- Grey Box Testing ⭐
- Combines white + black box.
- Tester has partial knowledge of system.
Test Documentation
Section titled “Test Documentation”- Test Plan – strategy, objectives, resources.
- Test Case Specification – input, expected output, actual output.
- Test Data – sample inputs for testing.
- Test Execution Report – results of test runs.
- Defect Report – bug ID, description, severity, status.
- Test Summary Report – overall testing status, coverage, pass/fail ratio.
Automated vs Manual Testing
Section titled “Automated vs Manual Testing”- Manual Testing: Executed by human testers, good for exploratory/ad-hoc testing.
- Automated Testing: Uses tools/scripts for regression, load, performance tests.
- Tools: Selenium, JUnit, TestNG, QTP, LoadRunner, JMeter.
Defect Lifecycle (Bug Life Cycle)
Section titled “Defect Lifecycle (Bug Life Cycle)”- New → Assigned → Open → Fixed → Retest → Verified → Closed.
- If not fixed: can be Reopened, Deferred, or Rejected.
Metrics in Testing
Section titled “Metrics in Testing”- Defect Density = Defects / Size of software.
- Test Coverage = (Executed tests / Total tests) × 100.
- Defect Removal Efficiency (DRE) = (Defects removed / Total defects) × 100.
- MTTF (Mean Time to Failure).
Standards for Testing
Section titled “Standards for Testing”- IEEE 829 – Test documentation.
- ISO/IEC/IEEE 29119 – Software testing standards.
- ISO/IEC 9126 – Software quality metrics.
Challenges in Testing
Section titled “Challenges in Testing”- Limited time and resources.
- Changing requirements.
- Test environment issues.
- Maintaining automation scripts.
- Communication gaps with stakeholders.
Best Practices
Section titled “Best Practices”- Start testing early.
- Maintain traceability matrix (requirements ↔ test cases).
- Prioritize test cases by risk and criticality.
- Use automation for regression and performance tests.
- Regular reviews of test cases and plans.
- Continuous testing in DevOps/Agile.