Software Testing
Software Testing
This chapter introduces Software Testing, covering faults, errors, failures, objectives,
principles, debugging, verification & validation, testing metrics, and the testing life cycle.
Below are structured notes, a mind map, and key revision points for effective learning.
🔹 Key Terminologies:
Term Definition Example
Fault (Bug/Defect) A result of an error in the code. The incorrect logic leads to a
crash.
✔ Example:
If a developer mistakenly writes + instead of -, this is an error.
This mistake introduces incorrect calculations, leading to a fault.
When a user gets an incorrect output, it's a failure.
✔ Example:
A tester finds a login page bug.
A developer then debugs and fixes the issue.
Defect Detection Rate Bugs found per test cycle. Found 50 defects in 5
cycles.
Test Execution Time Time taken to run all tests. 2 hours to run all test
cases.
✔ Example:
If defect density is high, the software needs improvement before release.
✔ Example:
Verification: Checking code structure before execution.
Validation: Testing if users can easily navigate a website.
7️⃣ Software Testing Life Cycle (STLC)
🔹 STLC Phases:
1️⃣ Requirement Analysis – Understand what to test.
2️⃣ Test Planning – Create test strategy and test cases.
3️⃣ Test Case Development – Write test cases & test scripts.
4️⃣ Test Environment Setup – Prepare software & hardware for testing.
5️⃣ Test Execution – Run test cases and report defects.
6️⃣ Test Closure – Document testing results & learnings.
✔ Example:
In an e-commerce website, the STLC process ensures that checkout, payment, and order
tracking work perfectly.
6️⃣ Differences Between White Box Testing & Black Box Testing
Aspect White Box Testing (WBT) Black Box Testing (BBT)
✔ Example:
Performance Testing: Checking if a website loads within 3 seconds under 1,000 users.
✔ Example:
WhatsApp Beta: Users test new features before public rollout.
✔ Example:
Google Chrome provides a high-contrast mode for better visibility.
✔ Example:
Checking if a website works properly on Chrome, Firefox, Edge, & Safari.
✔ Example:
A banking app should be secure, fast, and compatible across devices.
✔ Example:
A login page should not allow brute-force attacks.
✔ Example:
Bug Reporting in a Banking App
Issue: Funds deducted twice during payment.
Steps to Reproduce: Click "Pay" twice.
Expected Result: Only one transaction should be processed.
✔ Example:
Traditional Testing: Testing a complete mobile app after months of development.
Agile Testing: Testing each feature as it's developed in 2-week sprints.
3️⃣ Agile Principles and Values
🔹 Agile follows 4 core values from the Agile Manifesto:
1️⃣ Individuals & interactions over processes & tools.
2️⃣ Working software over comprehensive documentation.
3️⃣ Customer collaboration over contract negotiation.
4️⃣ Responding to change over following a plan.
🔹 Agile Testing follows 12 principles, including:
✔ Continuous feedback
✔ Simplicity & efficiency
✔ Collaboration between teams
✔ Frequent releases
✔ Example:
If a feature request changes, Agile teams adapt quickly rather than sticking to an
outdated plan.
Q1 (Technology-facing, Unit & Component Tests JUnit for Java unit testing
Automated)
✔ Example:
Quadrant 1: Writing unit tests for a login function.
Quadrant 4: Testing how a website performs under heavy traffic.
5️⃣ Automated Tests in Agile
🔹 Agile Testing relies on automation for faster feedback & efficiency.
🔹 Common types of automated tests:
✔ Unit Tests – Validate individual components.
✔ Regression Tests – Ensure new changes don't break features.
✔ Performance Tests – Check response time & load capacity.
✔ Security Tests – Detect vulnerabilities.
🔹 Popular Automation Tools:
🔹 Selenium – Web automation
🔹 JUnit – Java unit testing
🔹 JMeter – Performance testing
🔹 Appium – Mobile testing
✔ Example:
Running automated Selenium tests after every code update.