Test design techniques

What are test design techniques?

  • They are strategies that help to write better test cases.
  • The benefits of using test design techniques is an opportunity to create fewer tests while ensuring broad requirements coverage.
  • Don't try to use every technique on every feature. Use BVA for your forms, State Transition for your order statuses, and Exploratory testing to find the weird stuff that documentation forgot to mention.

Detailed test cases

💥The MOST comprehensive testing checklist and practices

Black box techniques

Equivalence Partitioning (EP)

The Concept: Grouping data into "buckets" that the system should treat the same way. If one value in the bucket works, they all should. We can just pick several numbers from each price range and assume that the rest of alike inputs will show the same results.

  • Example: A field accepts age from 18 to 60.
    • Partition 1 (Invalid): 0 to 17.
    • Partition 2 (Valid): 18 to 60.
    • Partition 3 (Invalid): 61+.
  • Test Cases: Pick one from each (e.g., 10, 30, 75).
image
image

Boundary Value Analysis (BVA)

The Concept: Bugs love to hide at the edges. We test the exact boundaries.

  • Example: The same age field (18-60).
  • Test Cases: 17 (Just below), 18 (Min), 19 (Just above), 59 (Just below), 60 (Max), 61 (Just above).
image

State Transition Testing

The Concept: Testing how the system moves from one state to another (the "Life Cycle"). Sequence of input conditions cause state changes in the Application.

  • Example: An ATM PIN entry.
    • State 1: Wait for PIN.
    • Action: Enter wrong PIN (1st time) -> State 2: Try again.
    • Action: Enter wrong PIN (3rd time) -> State 3: Card Blocked.
image

Decision Table Testing

The Concept: Used for complex business logic involving multiple conditions.

  • Example: A "Discount" logic. Condition 1: Is a student? Condition 2: Has a coupon?
  • Test Table:
    • Student (Yes) + Coupon (Yes) = 30% off.
    • Student (Yes) + Coupon (No) = 10% off.
    • Student (No) + Coupon (Yes) = 20% off.
    • Student (No) + Coupon (No) = No discount.
image

Pairwise Testing

Based on mathematical algorithms, namely combinatorics.

Experience-based techniques

Error Guessing

Anticipating where developers usually make mistakes based on past experience.

Examples:

  • "I bet if I click the Submit button 10 times really fast, it will create 10 orders." (This is a classic race condition guess).
  • Enter blank space into the text fields.
  • Null pointer exception.
  • Enter invalid parameters.
  • Divide by zero.
  • Use maximum limit of files to be uploaded.
  • Check buttons without entering values.

Use Case Testing

Testing based on how a user actually interacts with the system to achieve a goal. Example: "User buys a book." (Search -> Add to cart -> Checkout -> Payment Success).

Exploratory Testing

Simultaneous learning, test design, and execution. You don't have a script; you follow your nose.

  • Example: "What happens if I start a checkout, open a new tab, change the items in my cart, and then go back to the first tab to pay?"

White Box Techniques (structural)

These look at the internal "plumbing" of the code.

Statement Coverage

The Concept: Ensuring every single line of code is executed at least once.

Decision/Branch Coverage

The Concept: Testing every "Yes" and "No" path of every IF statement in the code.

SuperMade with Super