📖 2413MJET306B • Unit III • 7 Hrs

Unit III - Black-box Testing

Comprehensive University Exam Preparation Notes, Model Question Answers & Comparison Matrices

🔍
📑 Quick Jump Navigation

📌 Syllabus Topics Covered

7 Hrs Weightage

📖 Comprehensive Theoretical Notes

Exam-Oriented Theory

3.1 - 3.3 Black-Box Testing Fundamentals & Positive/Negative Testing

Black-Box Testing (Behavioral / Functional / Specification-Based Testing): A testing methodology where software functionality is tested without looking at internal code implementation, data structures, or server architecture. Tests are derived strictly from requirement specifications (SRS).

Testing Paradigms:

  • Requirement-Based Testing: Every functional requirement in the SRS is validated by mapping to corresponding test cases in the Requirement Traceability Matrix (RTM).
  • Positive Testing: Tests that the system behaves correctly when provided with valid input data (Happy Path, verifying expected functionality).
  • Negative Testing: Tests that the system handles invalid, unexpected, out-of-range, or malicious input gracefully without crashing, throwing user-friendly error messages.

3.4 Boundary Value Analysis (BVA) & 3.5 Equivalence Class Partitioning (ECP)

Equivalence Class Partitioning (ECP): Divides the input domain into disjoint subsets of data called Equivalence Classes such that all members of a class are assumed to be processed identically by the system:

  • Valid Equivalence Classes: Values that conform to valid specification rules.
  • Invalid Equivalence Classes: Values that violate specification constraints (too small, too large, incorrect data type, empty).
  • Rule: Select one representative test case from each equivalence class.

Boundary Value Analysis (BVA): Studies show that software bugs cluster around the extreme boundary edges of input ranges rather than the middle. For a range $[a, b]$:

  • Standard BVA (4 values): $a$ (Min), $a+1$ (Min+), $b-1$ (Max-), $b$ (Max), plus nominal middle value.
  • Robustness Testing (6 values): $a-1$ (Min-), $a$ (Min), $a+1$ (Min+), $b-1$ (Max-), $b$ (Max), $b+1$ (Max+).

3.5 - 3.8 Decision Tables, Error Guessing, Test Design, and Integration Testing

Cause-Effect Graphing & Decision Tables: Tabular representation mapping combinations of boolean input conditions (Causes / Inputs) to corresponding system actions (Effects / Outputs). Particularly effective for complex business logic rules (e.g., insurance premium calculations).

Error Guessing: An experience-based, intuitive testing technique where testers use historical knowledge of common developer mistakes to design targeted test cases (e.g., entering blank strings, divide-by-zero, SQL quotes, boundary integer overflow).

Integration Testing Approaches:

  • Top-Down Integration: High-level modules tested first; lower modules simulated using Stubs (dummy called programs).
  • Bottom-Up Integration: Low-level modules tested first; higher modules simulated using Drivers (dummy calling programs).
  • Sandwich / Hybrid Integration: Combines Top-Down and Bottom-Up simultaneously.
  • Big Bang Integration: All modules integrated and tested at once (causes chaotic debugging).

🔑 Key Concepts & Examination Keywords

Quick Terminology
Equivalence Partitioning (ECP)
A black-box technique partitioning inputs into equivalent classes where any value in a class produces identical testing outcomes.
Boundary Value Analysis (BVA)
A technique testing extreme boundary values (Min, Min+, Max-, Max) where software bugs occur most frequently.
Stub
A dummy program used in Top-Down integration testing that simulates the behavior of unwritten lower-level modules called by the module under test.
Driver
A dummy program used in Bottom-Up integration testing that calls the module under test and passes test data.

🎯 High-Yield Important Examination Questions

8–10 Descriptive Points Each

Q1. Explain Equivalence Class Partitioning (ECP) and Boundary Value Analysis (BVA) with mathematical definitions and practical numerical test suite derivations.

10 MarksECP & BVACore Techniques
📝 Detailed Examination Answer (10-Point Model):
  1. Philosophy of Input Domain Reduction: Exhaustive testing of infinite input domains is impossible; ECP and BVA reduce billions of input combinations into a small set of high-yield test cases.
  2. Equivalence Class Partitioning Concept: Divides input space into disjoint partitions where program behavior is assumed identical for all values within a single partition.
  3. Identification of Valid & Invalid Partitions: For an integer input 'Age between 18 and 60': Valid Partition $P_1 = [18, 60]$; Invalid Partitions $P_2 = [-\infty, 17]$ and $P_3 = [61, \infty]$.
  4. Selecting Test Cases from ECP: Test cases selected: Valid test (e.g., $Age = 35$), Invalid test 1 ($Age = 10$), Invalid test 2 ($Age = 75$), Invalid test 3 ($Age = "ABC"$).
  5. Boundary Value Analysis Rationale: Empirical testing shows defects cluster at the boundaries due to programmer relational operator errors ($<$ instead of $<=$).
  6. Standard BVA Values Selection: For range $[a, b]$, test: $a$ (Minimum), $a+1$ (Just above Min), Nominal (Middle), $b-1$ (Just below Max), and $b$ (Maximum).
  7. Robustness Testing BVA Extension: Adds out-of-bound tests: $a-1$ (Just below Min) and $b+1$ (Just above Max) to verify robust error handling.
  8. BVA Applied to Age Example [18, 60]: Robustness BVA test values: $17$ (Invalid Min-), $18$ (Valid Min), $19$ (Valid Min+), $35$ (Nominal), $59$ (Valid Max-), $60$ (Valid Max), $61$ (Invalid Max+).
  9. Multi-Variable BVA Test Case Count: For $n$ input variables, Standard BVA produces $4n + 1$ test cases; Robustness BVA produces $6n + 1$ test cases.
  10. Combined ECP-BVA Best Practice: Professional QA teams use ECP to identify partitions and BVA to select the precise values at partition edges.

Q2. Describe Decision Table Based Testing and Cause-Effect Graphing with a complete business logic scenario and truth table.

10 MarksDecision Tables & Cause-Effect
📝 Detailed Examination Answer (10-Point Model):
  1. Purpose of Decision Tables: A structured mathematical tool for modeling complex business logic rules containing multiple combinations of input conditions and resulting actions.
  2. Four Quadrants of a Decision Table: 1. Condition Stub (Upper Left), 2. Condition Entry (Upper Right), 3. Action Stub (Lower Left), 4. Action Entry (Lower Right).
  3. Calculating Total Combinatorial Rules: For $N$ binary conditions, the complete decision table contains $2^N$ distinct rule columns ensuring 100% combination coverage.
  4. Practical E-Commerce Discount Scenario: Conditions: $C_1$: Is Student? (Y/N), $C_2$: Order Amount > $100 (Y/N), $C_3$: Has Festive Coupon? (Y/N). Actions: Apply 20% Discount, Apply 10% Discount, Free Shipping.
  5. Constructing Truth Table Columns: Tabulate all 8 combinations ($2^3 = 8$) from YYY to NNN, specifying exact action outcomes for each column.
  6. Table Reduction & Don't-Care Conditions: Simplify rules using 'Don't Care' ($-$) entries when a condition does not affect the outcome, reducing redundant test cases.
  7. Cause-Effect Graphing Architecture: A formal graphical notation representing boolean logic relationships between inputs (Causes) and outputs (Effects) using Identity, NOT, OR, AND gates.
  8. Constraint Symbols in Cause-Effect Graphs: Applies constraints: Exclusive ($E$), Inclusive ($I$), One and only one ($O$), Requires ($R$), and Mask ($M$).
  9. Transforming Cause-Effect Graphs to Decision Tables: Cause-effect graph paths are systematically converted into decision table rule columns for executable test case generation.
  10. Industrial Strength of Technique: Guarantees that no edge-case business rule combination is overlooked in financial, insurance, and billing engines.

Q3. Compare Top-Down, Bottom-Up, Sandwich, and Big-Bang Integration Testing approaches. Explain the role of Stubs and Drivers.

10 MarksIntegration Testing & Stubs/Drivers
📝 Detailed Examination Answer (10-Point Model):
  1. Definition and Goal of Integration Testing: Verifies interactions, data communication, and interface contracts between integrated software modules after unit testing.
  2. Big Bang Integration Approach: All developed modules are merged simultaneously in a single step; extremely difficult to isolate bug locations when crashes occur.
  3. Top-Down Integration Strategy: Begins testing from top-level control modules moving progressively downward through subroutine hierarchies; requires **Stubs** to simulate missing lower modules.
  4. Role and Nature of Stubs: A dummy subordinate program called by the module under test that accepts parameters and returns hardcoded mock values simulating lower-level operations.
  5. Top-Down Advantages & Disadvantages: Demonstrates major architectural workflow early to stakeholders; disadvantage: low-level complex database I/O is tested late.
  6. Bottom-Up Integration Strategy: Begins testing from lowest-level utility/database modules moving upward; requires **Drivers** to simulate missing calling modules.
  7. Role and Nature of Drivers: A dummy calling program that sets up test inputs, calls the module under test, and prints/evaluates returned outputs.
  8. Bottom-Up Advantages & Disadvantages: Tests critical low-level algorithms thoroughly; disadvantage: overall system control architecture is only verified at the end.
  9. Sandwich / Hybrid Integration Strategy: Combines Top-Down (for user interface and high-level logic) and Bottom-Up (for database and low-level processing) meeting at a middle target layer.
  10. Summary Recommendation for University Exams: Top-Down uses Stubs; Bottom-Up uses Drivers; Sandwich uses both; Big Bang avoids stubs/drivers but is high-risk.

⚖️ Comprehensive Comparison & Difference Tables

8+ Comparison Criteria

📊 Boundary Value Analysis (BVA) vs Equivalence Class Partitioning (ECP)

Comparison ParameterBoundary Value Analysis (BVA)Equivalence Class Partitioning (ECP)
Core Testing PhilosophyTests the extreme boundary edges of input ranges.Tests representative values selected from partitioned equivalence classes.
Defect TargetCatches boundary off-by-one errors ($<$ instead of $<=$).Catches functional logic errors across entire input categories.
Values SelectedSelects boundary values ($Min, Min+, Max-, Max$).Selects any representative nominal value inside each partition.
Input Data TypesApplicable only to ordered continuous numeric/date ranges.Applicable to all data types (numeric, text strings, enums, radio options).
Test Case CountGenerates $4n+1$ (or $6n+1$) test cases per variable.Generates 1 test case per valid/invalid partition.
Complementary RoleRefines value selection within partitions identified by ECP.Identifies high-level partitions for BVA boundary testing.
Example for Range [1, 100]Test values: $0, 1, 2, 50, 99, 100, 101$.Test values: $50$ (Valid), $-10$ (Invalid Low), $150$ (Invalid High).
EfficiencyHighest defect density yield per test case executed.Drastically reduces massive input sets into minimal test cases.

📊 Stub vs Driver in Integration Testing

Comparison ParameterStub (Called Mock)Driver (Calling Mock)
Integration MethodologyUsed in Top-Down Integration Testing.Used in Bottom-Up Integration Testing.
Simulation RoleSimulates an unwritten LOWER-LEVEL module called by the tested module.Simulates an unwritten HIGHER-LEVEL module that calls the tested module.
Invocation RelationshipThe module under test CALLS the Stub.The Driver CALLS the module under test.
Data Flow DirectionReceives parameters from tested module and returns canned dummy data.Supplies test data inputs to the tested module and captures outputs.
ComplexityCan be simple or complex depending on return logic.Typically simple main() harness passing fixed test vectors.
LifecycleReplaced when real lower-level subroutines are compiled.Discarded when real higher-level control modules are integrated.
AnalogyA mock backend database API returning static JSON.A JUnit test runner method invoking a business service method.
Development EffortHigher effort if stateful dummy behavior is required.Lower effort; simple test execution script.

⚡ Quick Pre-Exam Revision Summary

5-Minute Recap
💡 Core Takeaways & High-Yield Summary
  • Black-box testing derives test cases from SRS specifications without viewing internal source code.
  • Positive testing tests valid happy paths; Negative testing tests invalid out-of-range inputs.
  • ECP partitions inputs into valid/invalid classes; BVA tests boundary edges ($Min, Min+, Max-, Max$).
  • Robustness BVA adds $Min-1$ and $Max+1$ ($6n+1$ tests).
  • Decision tables map combinations of conditions to actions ($2^N$ rules).
  • Top-down integration uses Stubs (called dummy); Bottom-up uses Drivers (calling dummy).