Testing
SDLC (Software Development Life Cycle)
What is SDLC?
Definition: SDLC is a structured process used to plan, develop, test, deploy, and maintain software efficiently.
Purpose: To deliver high-quality software within time and budget.
Focus: It provides a framework for project planning, scheduling, and execution.
Why SDLC is Important?
Ensures clear process & documentation.
Reduces development risks & costs.
Improves software quality & reliability.
Helps in meeting customer expectations.
When is SDLC Used?
For any software development project, from small apps to enterprise systems.
When organizations want predictability, structured workflow, and risk management.
How SDLC Works?
- By dividing the development process into defined stages, each with specific goals, deliverables, and reviews.
SDLC Stages (7 Phases)
1. Requirement Analysis
What: Gathering and analyzing user needs.
Why: To ensure the software solves the actual business problem.
When: At the very start of the project.
How:
Conduct interviews, surveys, meetings.
Create Software Requirement Specification (SRS).
2. Planning
What: Defining the scope, resources, budget, and timeline.
Why: To create a roadmap for development.
When: After requirements are finalized.
How:
Create project plan.
Allocate resources.
Risk analysis.
3. Design
What: Creating architecture and design of the system.
Why: To plan how software will look and function.
When: Before coding starts.
How:
High-Level Design (HLD): System architecture, database design.
Low-Level Design (LLD): Detailed component design, interfaces.
4. Development (Coding)
What: Writing the actual source code.
Why: To convert design into a working product.
When: After design approval.
How:
Developers write code using programming languages.
Follow coding standards & version control (Git).
5. Testing
What: Verifying the software for defects.
Why: To ensure quality and bug-free delivery.
When: After development or alongside (in Agile).
How:
Unit testing, Integration testing, System testing, UAT.
Tools: Selenium, JUnit, TestNG.
6. Deployment
What: Releasing software to users.
Why: To make the product accessible for actual use.
When: After successful testing.
How:
Deploy to production (manual/automated CI/CD).
Initial release → Feedback collection.
7. Maintenance
What: Ongoing support, updates, bug fixes.
Why: To keep the software up-to-date and reliable.
When: After deployment (lifelong stage).
How:
- Regular updates, performance monitoring, patching.
SDLC Models
1. Waterfall Model
What: Linear sequential model — each phase completed before next starts.
When: Projects with well-defined requirements.
Pros: Easy to manage, clear documentation.
Cons: Hard to go back and change, no flexibility.
Best for: Small, simple projects.
2. Agile Model
What: Iterative & incremental model — delivers software in small sprints.
When: Projects with evolving requirements.
Pros: Flexible, customer feedback-driven, faster delivery.
Cons: Needs strong team collaboration.
Best for: Startups, evolving projects.
3. V-Model (Verification & Validation)
What: Each development phase has a corresponding testing phase.
When: Safety-critical projects (healthcare, aerospace).
Pros: High quality & strict validation.
Cons: Expensive & time-consuming.
Best for: Projects where failures are costly.
4. Iterative Model
What: Builds software in cycles (prototype → refine → repeat).
When: Requirements not fully known initially.
Pros: Early working model, flexible.
Cons: Can lead to scope creep.
Best for: Complex projects with unclear requirements.
5. Spiral Model
What: Combines iterative & risk analysis — continuous risk assessment in each phase.
When: High-risk, large-scale projects.
Pros: Risk control, flexible.
Cons: Costly & complex.
Best for: Critical projects with high uncertainty.
6. Big Bang Model
What: No formal plan — code first, refine later.
When: Very small or experimental projects.
Pros: Minimal planning, quick start.
Cons: High failure risk, no clear roadmap.
Best for: Student projects, proof of concepts.
SDLC Diagram
Requirement → Planning → Design → Development → Testing → Deployment → Maintenance
\============================================================================
What is Software Testing?
Definition: The process of verifying and validating that a software application meets the specified requirements and is free of defects.
Goal: Ensure software is reliable, functional, secure, and provides a good user experience.
Why is Testing Important?
Detects defects early.
Prevents costly failures in production.
Improves quality and customer satisfaction.
Ensures compliance with requirements.
When is Testing Done?
During development (Unit, Integration).
Before release (System, UAT).
After release (Maintenance, Regression).
How is Testing Done?
Using Manual Testing or Automation Testing (Selenium, JUnit, TestNG).
By following a test plan, test cases, or user stories.
Types of Software Testing
1. Manual Testing
What: Testing without automation tools.
When: For exploratory, usability, or ad-hoc testing.
Example: Manually checking login form behavior.
2. Automation Testing
What: Uses scripts/tools to perform testing automatically.
When: For repetitive or regression testing.
Tools: Selenium, TestNG, JUnit.
Example: Automating login test in an e-commerce site.
Testing Techniques (How to Test?)
A. Static Testing (Without Execution)
What: Reviewing documents, code, or design without running the software.
Techniques:
Reviews
Walkthroughs
Inspections
Example: Reviewing SRS for missing requirements.
B. Dynamic Testing (With Execution)
What: Executing the code to find defects.
Example: Running the application to verify the login button works.
C. Black Box Testing
What: Tests functionality without knowing internal code.
Techniques:
Equivalence Partitioning (EP) – Divide inputs into valid/invalid classes.
Boundary Value Analysis (BVA) – Test edge values.
Decision Table Testing – Based on conditions & actions.
State Transition Testing – Test system behavior in different states.
Example:
EP: Test login with valid & invalid credentials.
BVA: Test password length at 7, 8, 9 (if min=8).
D. White Box Testing
What: Tests internal logic & code structure.
Techniques:
Statement Coverage
Branch Coverage
Path Coverage
Example: Verify each "if/else" condition executes at least once.
E. Grey Box Testing
What: Combines both black box and white box.
Example: Test database queries with partial code knowledge.
Levels of Testing (When to Test?)
1. Unit Testing
What: Tests individual modules/components.
Tool: JUnit, TestNG.
Example: Testing a “calculateDiscount()” function.
2. Integration Testing
What: Tests data flow between modules.
Example: Testing login → dashboard flow.
3. System Testing
What: Tests the entire system as a whole.
Example: End-to-end e-commerce checkout flow.
4. Acceptance Testing (UAT)
What: Performed by end-users to verify business requirements.
Example: Client tests order placement before go-live.
Types of Testing (Based on Purpose)
Functional Testing
Tests what the system does.
Example: Verify user can add items to cart.
Non-Functional Testing
Tests performance, security, usability.
Types:
Performance Testing
Load Testing
Stress Testing
Security Testing
Usability Testing
Compatibility Testing
Example: Test website speed with 1000 users.
Regression Testing
Verify old features still work after changes.
Example: After adding "wishlist" feature, test "add to cart" still works.
Smoke Testing
Quick check if major functions work (build verification).
Example: Verify login, add-to-cart, checkout work after new deployment.
Sanity Testing
Focused testing on new functionality.
Example: Only test “wishlist” feature after its release.
Alpha & Beta Testing
Alpha: Done by internal teams.
Beta: Done by end-users before final release.
Exploratory Testing
Unscripted testing based on tester’s intuition.
Example: Randomly trying to break an application.
Ad-hoc Testing
Informal, no documentation.
Example: Clicking random buttons to find hidden errors.
Real-Time Example – E-commerce Website Testing
Unit Testing: Test discount calculation.
Integration Testing: Login → Payment gateway.
System Testing: Place order end-to-end.
Performance Testing: 10,000 users at once.
Security Testing: Test SQL injection in login form.
Regression Testing: After adding coupon system, recheck checkout.
User Acceptance Testing: Client verifies full workflow.