Equivalence partitioning and boundary value analysis work well for individual input fields. Real applications, however, also contain business rules that depend on combinations of conditions, features whose behaviour depends on history, and complete user journeys. In this lesson you will learn four more black box techniques to handle these situations, each with a worked example you can reuse in interviews.
Decision Table Testing
A decision table (also called a cause-effect table) lists combinations of conditions (inputs) and the resulting actions (outputs). Each column is a rule, which becomes at least one test case. For n conditions with Yes/No values, there are 2^n combinations: 2 conditions give 4 rules, 3 give 8 and 4 give 16.
Requirement: "A UPI payment succeeds only if the PIN is correct, the account has sufficient balance and the amount is within the daily limit. The system checks the PIN first, then the balance, then the limit, and shows the first error it finds."
Step 1: Full decision table (3 conditions = 8 rules)
| Conditions / Actions | R1 | R2 | R3 | R4 | R5 | R6 | R7 | R8 |
|---|---|---|---|---|---|---|---|---|
| C1: PIN correct? | Y | Y | Y | Y | N | N | N | N |
| C2: Sufficient balance? | Y | Y | N | N | Y | Y | N | N |
| C3: Within daily limit? | Y | N | Y | N | Y | N | Y | N |
| Payment successful | X | |||||||
| "Daily limit exceeded" | X | |||||||
| "Insufficient balance" | X | X | ||||||
| "Incorrect UPI PIN" | X | X | X | X |
Step 2: Collapsed decision table
When a condition does not affect the outcome, it is marked "–" (don't care) and rules can be merged. R5 to R8 all give "Incorrect UPI PIN", and R3 and R4 both give "Insufficient balance".
| Conditions / Actions | Rule 1 | Rule 2 | Rule 3 | Rule 4 |
|---|---|---|---|---|
| PIN correct? | Y | Y | Y | N |
| Sufficient balance? | Y | Y | N | – |
| Within daily limit? | Y | N | – | – |
| Expected result | Payment successful | Daily limit exceeded | Insufficient balance | Incorrect UPI PIN |
Eight combinations became four focused test cases, without losing coverage of any distinct behaviour. Collapse rules only when the requirement clearly states the order of checks; otherwise test all combinations.
State Transition Testing
Some systems behave differently depending on what happened earlier. State transition testing models the system as states, events that cause transitions between states, and the resulting outputs.
Requirement: "The user gets three attempts to enter the correct UPI PIN. After three consecutive wrong attempts, UPI PIN entry is blocked for 24 hours."
[Attempt 1] --wrong--> [Attempt 2] --wrong--> [Attempt 3] --wrong--> [Blocked]
| | |
correct correct correct
| | |
+----------------------+----------------------+--> [Payment Success]| Current state | Event: correct PIN | Event: wrong PIN |
|---|---|---|
| Attempt 1 | Payment Success | Attempt 2 |
| Attempt 2 | Payment Success | Attempt 3 |
| Attempt 3 | Payment Success | Blocked |
| Blocked | Remain Blocked (invalid transition) | Remain Blocked (invalid transition) |
Test cases derived from the model:
- Correct PIN on the first attempt leads to payment success.
- Wrong, then correct leads to payment success.
- Wrong, wrong, then correct leads to payment success.
- Three wrong attempts lead to Blocked with a clear message.
- In the Blocked state, entering the correct PIN must not process the payment (invalid transition).
- After a successful payment, the next payment starts again at Attempt 1 (counter reset).
Other common examples include order status (Placed, Packed, Shipped, Delivered, Returned) and train ticket status (Waitlisted, RAC, Confirmed, Cancelled). Always test invalid transitions too: for example, a Delivered order should not move back to Packed.
Use Case Testing
A use case describes how an actor (user or external system) interacts with the system to achieve a goal. Use case testing derives tests from the main flow, alternate flows and exception flows, which makes it ideal for end-to-end and UAT scenarios.
Actor: Registered passenger. Precondition: User is logged in. Main flow: 1) Search trains by source, destination and date; 2) Select train and class; 3) Enter passenger details; 4) Review fare; 5) Pay via UPI; 6) System confirms booking and sends e-ticket. Alternate flow A1: No confirmed seats, so the system offers a waitlisted ticket. Exception flow E1: Payment fails, so the booking is not confirmed and any debited amount is refunded. Exception flow E2: Session times out during passenger entry.
| Test ID | Flow | Scenario | Expected result |
|---|---|---|---|
| UC-01 | Main | Book a confirmed ticket with successful UPI payment | Booking confirmed, PNR generated, e-ticket sent |
| UC-02 | Alternate A1 | Book when only waitlist is available | Waitlisted ticket issued with waitlist number |
| UC-03 | Exception E1 | Payment fails after amount is debited | Booking not confirmed, refund initiated, message shown |
| UC-04 | Exception E2 | Session expires while entering passengers | User redirected to login, no partial booking created |
Error Guessing
Error guessing is an experience-based technique where the tester anticipates likely mistakes based on past defects, domain knowledge and intuition. It complements formal techniques rather than replacing them. A useful checklist:
| Area | What to try |
|---|---|
| Input fields | Blank input, only spaces, leading or trailing spaces, emojis, very long text, special characters |
| Numbers | Zero, negative values, decimals, very large numbers |
| Dates | 29 February, 31st in a 30-day month, past dates for future bookings, time zone edges |
| Payments | Double-tapping "Pay", pressing back during payment, network loss after debit |
| Sessions | Using the app in two tabs, session timeout, logout then browser back |
| Files | Wrong format, zero-byte file, file larger than the limit |
Keep a personal list of bugs you find in every project. Over time this becomes your most valuable error guessing tool, and it gives you strong real examples for interviews.