Lesson 8 of 17 · 19 min read

Black Box Techniques II: Decision Table, State Transition, Use Case & Error Guessing

Design tests for business rules, state changes and user flows using decision tables, state transition, use case testing and error guessing.

Learning objectives

  • Build and simplify a decision table for combinations of conditions
  • Model a feature as states and transitions and derive valid and invalid tests
  • Derive test cases from a use case's main, alternate and exception flows
  • Apply error guessing using a checklist of common defect areas

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 / ActionsR1R2R3R4R5R6R7R8
C1: PIN correct?YYYYNNNN
C2: Sufficient balance?YYNNYYNN
C3: Within daily limit?YNYNYNYN
Payment successfulX
"Daily limit exceeded"X
"Insufficient balance"XX
"Incorrect UPI PIN"XXXX

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 / ActionsRule 1Rule 2Rule 3Rule 4
PIN correct?YYYN
Sufficient balance?YYN–
Within daily limit?YN––
Expected resultPayment successfulDaily limit exceededInsufficient balanceIncorrect 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 stateEvent: correct PINEvent: wrong PIN
Attempt 1Payment SuccessAttempt 2
Attempt 2Payment SuccessAttempt 3
Attempt 3Payment SuccessBlocked
BlockedRemain Blocked (invalid transition)Remain Blocked (invalid transition)

Test cases derived from the model:

  1. Correct PIN on the first attempt leads to payment success.
  2. Wrong, then correct leads to payment success.
  3. Wrong, wrong, then correct leads to payment success.
  4. Three wrong attempts lead to Blocked with a clear message.
  5. In the Blocked state, entering the correct PIN must not process the payment (invalid transition).
  6. 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.

Use case: Book a train ticket

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 IDFlowScenarioExpected result
UC-01MainBook a confirmed ticket with successful UPI paymentBooking confirmed, PNR generated, e-ticket sent
UC-02Alternate A1Book when only waitlist is availableWaitlisted ticket issued with waitlist number
UC-03Exception E1Payment fails after amount is debitedBooking not confirmed, refund initiated, message shown
UC-04Exception E2Session expires while entering passengersUser 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:

AreaWhat to try
Input fieldsBlank input, only spaces, leading or trailing spaces, emojis, very long text, special characters
NumbersZero, negative values, decimals, very large numbers
Dates29 February, 31st in a 30-day month, past dates for future bookings, time zone edges
PaymentsDouble-tapping "Pay", pressing back during payment, network loss after debit
SessionsUsing the app in two tabs, session timeout, logout then browser back
FilesWrong format, zero-byte file, file larger than the limit
Build your own defect checklist

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.

Key takeaways

  • Decision tables cover combinations of conditions; each rule becomes a test case
  • Collapse rules with don't-care values only when the requirement supports it
  • State transition testing covers valid transitions and invalid ones
  • Use case testing derives tests from main, alternate and exception flows
  • Error guessing uses experience and checklists to target likely defects
✓ You're subscribed! Job alerts arrive daily at 9 AM.
Scroll to Top