All articles

Test Design Techniques: Cover More With Fewer Test Cases

A single text field can hold more inputs than you could test in a lifetime. A card number field takes 16 digits, and if you tried every possible value you would be there past the heat death of the universe and still not be done. Exhaustive testing is impossible. It always has been, and no budget or tool is going to change that.

So you test smart instead of testing everything. A handful of well-chosen cases beats a thousand random ones, and test design techniques are how you choose that handful. They take a space of behaviour far too big to cover and shrink it to a few cases that still catch the bugs that matter.

Two questions run underneath every one of them. Does the feature do what it should? And does it do only that, and leave everything else alone? Most suites ask the first and barely ask the second, which is where a whole class of bugs walks straight through. More on that when we get to negative testing.

I’ll walk through the five techniques I reach for most, with a worked example for each, then the negative-testing habit that catches what they miss, and a single guide for picking the right one. None of this is academic. It’s what I teach when I train testers and what I do on real projects.

Equivalence partitioning: group inputs that behave the same

The idea is simple. Divide the possible inputs into groups where the system should treat every value in the group the same way. Test one value from each group. If that one passes, you assume the rest of the group passes too, because the code is doing the same thing with all of them.

Say you are testing a username field that must be between 6 and 15 characters. There are three groups, or partitions, the system should treat differently:

  • Too short: fewer than 6 characters. Invalid.
  • Valid: 6 to 15 characters. Valid.
  • Too long: more than 15 characters. Invalid.

You do not need to test a 7-character name and an 8-character name and a 9-character name. They all sit in the valid partition, and the code treats them identically. One value from each partition gives you three cases instead of ten or fifty, and it scales: the more inputs a field has, the more partitioning earns its keep.

The catch is that partitioning alone misses the place bugs love most. Off-by-one errors, a < that should be a <=, a length check that counts wrong, all of those hide right at the edge of a partition, and a value from the middle will sail straight past them. Which is exactly why you pair it with the next technique.

Boundary value analysis: test the edges, where bugs cluster

Defects cluster at boundaries. The minimum, the maximum, and one step either side of each. Boundary value analysis says: do not test the comfortable middle of a partition, test its edges.

Take the same 6-to-15-character username field. The boundaries are 6 and 15, so you test:

LengthBoundaryExpected
5one below the minimumInvalid
6the minimumValid
7one above the minimumValid
14one below the maximumValid
15the maximumValid
16one above the maximumInvalid

This is where you catch the developer who wrote “greater than 6” when the requirement said “6 or more.” A middle-of-the-range test never finds that. The boundary test finds it on the first run.

too shortVALID · 6 to 15too long567141516Test the six edge values, not the comfortable middle.8 through 13 all behave the same, one middle value already covered that

The nastiest boundary bug I have caught lived in cart math. I was testing the promotions engine on a retail platform, the kind of two-brand site that ships on a weekly train, and the discounts came in tiers: spend one amount and you get one rate, spend more and you get a better one. Every bug lived on the line. Right at the tier threshold the cart handed back the lower rate when the rule said the better one had already kicked in, an off-by-a-penny > where the requirement wanted >=. A shopper spending the exact threshold amount got less than they were promised, and nobody testing a value comfortably above or below it would ever see it. Now, on anything that turns on a threshold, I test the value on the line, one cent under, and one cent over, before I go anywhere near the middle.

Equivalence partitioning tells you the range behaves. Boundary value analysis tells you the edges behave. Run both and you know which one broke.

Use the two together, always. On their own, each leaves a gap. If you only test boundaries and something fails, you cannot tell whether just the edge broke or the whole partition is wrong. Run both and you know which.

Decision tables: when the output depends on a combination of conditions

Some behaviour does not come from one input. It comes from a combination of conditions, and the rules between them are where requirements quietly contradict each other. A decision table lays every combination out in a grid so none slips through.

Say Vendly, a made-up app I use for examples, offers free delivery, and the rule is: free delivery if the order is over $30, OR if the customer is a member. Two conditions, so four combinations:

Order over $30?Member?Free delivery?
NoNoNo
NoYesYes
YesNoYes
YesYesYes

Now the cases write themselves, one per row, and you can see at a glance that you have covered every combination. The real value shows up the moment someone adds a third condition, say a valid promo code also earns free delivery. Two conditions gave four rows. Three conditions double it to eight, and the table makes that explosion impossible to ignore:

Order over $30?Member?Valid promo code?Free delivery?
NoNoNoNo
NoNoYesYes
NoYesNoYes
NoYesYesYes
YesNoNoYes
YesNoYesYes
YesYesNoYes
YesYesYesYes

Laid out like this, the table forces the question nobody asked in refinement: what happens when a non-member under $30 uses an expired promo code (row one, but with the code invalid)? Is “no free delivery” really the intended answer, or does an expired code need its own message? That row is a test case, and nine times out of ten it is also a conversation the team needed to have. Each condition you add roughly doubles the rows, which is exactly why you reach for pairwise testing once the conditions are independent and the grid stops being readable.

State transition testing: when the order of events matters

Some bugs only appear because of how you got somewhere, not where you are. An account moves through states: active, then locked after failed logins, then active again after a reset. The same action can be valid in one state and forbidden in another. State transition testing designs cases around the states and the events that move between them.

ActiveLockedSuspended3 failed loginspassword resetadmin suspends

Drawing the diagram is half the work, because it makes the missing transitions obvious. Can a suspended account be reset? Should three failed logins on an already-locked account do anything? Each arrow is a valid case, and each arrow that is missing on purpose is a negative case: try the event that should not be allowed and confirm the system refuses it. That second set is the one teams forget, and it is where the security-adjacent bugs live.

Pairwise testing: when the combinations explode

Sometimes you genuinely have many inputs at once. Suppose Vendly runs on 4 browsers, 3 device types, 3 plan tiers, and 2 currencies. Testing every combination is 4 × 3 × 3 × 2 = 72 cases. Few teams have time for 72, and most of those combinations are not telling you anything new.

Pairwise testing rests on a useful observation: most defects come from a single factor or the interaction of just two factors, not from some rare four-way combination. So instead of covering every full combination, you cover every pair of values at least once. That collapses 72 cases down to roughly a dozen while still exercising every two-way interaction. You do not work the combinations out by hand. Tools like PICT or AllPairs generate the set for you from the list of factors.

Be honest about the trade-off, though. Pairwise assumes the bug you are chasing is not a three-way interaction. Usually that holds. When it does not, and you know a specific triple is high-risk, add that combination back in by hand. The technique is a starting point, not a guarantee.

Negative testing: check what it should refuse, and what it should leave alone

Every technique so far asks one question: does the feature do what it should? There is a second question that catches just as many bugs, and most suites barely ask it. Does the feature do only what it should, and refuse everything else?

There are two halves to it. The first is the invalid input and the forbidden action: the 16-character username that must be rejected, the withdrawal larger than the balance, the password reset on a suspended account that should be refused. You already met this in the boundary table and in the missing arrows on the state diagram. Make it deliberate. For every rule, write the case that breaks the rule, and confirm the system says no clearly, without losing data or falling over.

The second half is the one teams forget, and it is the more dangerous of the two. We check that the thing we changed changed. We almost never check that nothing else did. Say an admin updates the billing address on Julia Pottinger’s account in Vendly. Nearly every tester confirms the new address saved. Far fewer check that no other customer’s address moved, that her plan tier, payment method, and invoice history are untouched, and that the audit log recorded one change and not fifty. The ugly version of this bug is an update that quietly writes to every record instead of one, and it sails straight through a suite that only checks the happy path. It is one of the oldest mistakes in testing, and AI brought it right back, because generated tests assert the happy path and almost never the absence of a side effect.

So for any test that changes data, design it in two parts: confirm the intended change happened, and confirm everything else stayed exactly as it was. On a manual test, a quick scan of the surrounding records is often enough. In an automated test, you can assert it precisely.

Which technique, when

You do not apply all five to everything. You read the feature and reach for the one that fits. Here is the quick guide I use.

What you are looking atReach for
A single input with ranges (length, amount, age)Equivalence partitioning + boundary value analysis, together
Output that depends on a combination of conditions or rulesDecision table
Behaviour that changes based on the sequence of events or statusState transition testing
Many independent inputs whose combinations explodePairwise testing
Behaviour that should be refused, or data that should stay untouchedNegative and side-effect testing
Behaviour nobody wrote down in the requirementsNone of these. Go exploratory.

That last row matters. These techniques are powerful precisely because they are systematic, and that is also their blind spot. They cover what the requirements describe. They will never find the bug nobody specified, the weird real-user behaviour, the data issue hiding behind a clean screen. For that you need exploratory testing, which is a different skill that runs alongside these, not instead of them.

Where AI helps, and where it does not

This is the kind of work where AI earns its place, as long as you know what to trust it with.

AI is genuinely good at the mechanical expansion. Hand it a field definition and it will draft the equivalence partitions and boundary values quickly, and it rarely forgets the “one above the maximum” case that a tired human skips at 4pm. Give it a set of conditions and it will lay out the decision table combinations without missing a row. Ask it to turn your factor list into a pairwise set and it will. This is exactly the repetitive, combinatorial work it should be doing, and it frees you for the part that matters.

What it cannot do is the judgment. It does not know that the promo-code row is the one your business actually argues about, or that the suspended-account reset is the high-risk path because of who your users are, or that this particular three-way combination is worth adding back even though pairwise dropped it. It does not know which boundary is load-bearing and which is trivia. So let it draft the cases, then you read them, cut the noise, add the risk it could not see, and own the result. The technique gives you the coverage. You give it the priorities, and you own what ships.

Start here

Pick one field in whatever you are testing right now. Partition its inputs, list its boundaries, and write the cases. You will likely find you had been testing three values that were all the same case and missing the one at the edge that actually breaks. The technique pays for itself on the first field you try it on.

When you want the full picture, from turning requirements into a plan all the way to prioritising and tracing your cases, these techniques are module six of my free Test Design & Strategy course. Work through it in order and you will not just know the techniques, you will know when to use which.

Found it useful? Share it.
Julia Pottinger

Written by

Julia Pottinger

Hi, I'm Julia. I've been in QA for over a decade. I spend my days testing software and my own time building apps and games, and I write here to share what I learn, the practical, honest lessons you can actually use.

Comments 0

Share your thoughts, ask questions, or add to the conversation.

Be kind and constructive. Stay on topic. No spam or self-promotion.
Loading comments…