All insights
Learning

Positive and Negative Testing: The Cases That Actually Find Bugs

Positive cases prove a feature was built. Negative cases prove it was built carefully. Here is how to write both, with a payments example.

Sep 4, 20264 min read
Positive and Negative Testing: The Cases That Actually Find Bugs — Tesbo

A tester on a payments team spends Monday morning writing cases for the new refund button. By Wednesday the suite is green, the demo goes fine, and everyone moves on. Then a customer enters a refund amount larger than the original charge and the system happily processes it. Nobody wrote that case, because nobody wrote a single negative one. This happens on a normal week at a normal company, not as a dramatic failure but as a quiet gap in what got tested.

This post answers the question plainly: what counts as a positive case, what counts as a negative one, and how many of each you actually need.

What positive and negative testing mean

A positive test case checks that the system does what it should when given valid, expected input. Enter a correct card number, a valid amount, and the refund goes through. That is a positive case.

A negative test case checks that the system behaves correctly when given input it should reject. Enter a refund amount larger than the charge, or letters where a number belongs, and the system should refuse it cleanly, not crash or silently accept it.

There is no correct ratio between the two. Teams ask for a percentage and there is not one to give. But a suite that is 90% positive cases is not really testing the feature. It is describing the feature: confirming it does the happy thing when asked nicely, and saying nothing about what happens when it is not.

A worked example: the refund amount field

Take a single field on that refund form: the amount. Here is what positive and negative cases look like side by side for that one field.

  • Positive: enter an amount equal to the original charge; refund processes and the balance updates.
  • Positive: enter an amount less than the original charge; partial refund processes correctly.
  • Negative: enter an amount greater than the original charge; system rejects with a clear message.
  • Negative: enter a negative number; system rejects rather than crediting the customer twice.
  • Negative: leave the field blank and submit; system blocks submission instead of defaulting to zero.

Five cases, one field. That is the density a careful suite needs, not because every field deserves five cases, but because this one carries money.

The four kinds of negative case worth writing

Most negative cases fall into one of four buckets. Knowing the buckets makes it faster to write a complete set instead of guessing.

  • Wrong type: a number field gets letters, a date field gets a string.
  • Out of range: a quantity field gets a negative number, a percentage field gets 150.
  • Missing: a required field is left empty and the form is submitted anyway.
  • Not allowed: an action is attempted by a user who lacks permission for it, like a support agent trying to issue a refund larger than their approval limit.

Working through those four for any input field gets you most of the way to a complete negative set without needing to imagine every possible bad input from scratch.

Where this gets more serious: the API layer

Everything above holds for a UI form. At the API layer the stakes are different, because the API has no form validation in front of it stopping a malformed request before it reaches your code. A negative case at the API layer is testing the actual boundary of your system, not a convenience layer someone added on top of it.

We have written a much deeper, more concrete treatment of negative testing at the API layer, covering the exact payload shapes worth trying and the status codes each should return. If the field level examples above made sense and you write or review API tests, that post is the next stop, not this one.

How this connects to happy path and edge case testing

Positive and negative testing is the foundational split. Two more terms sit next to it and are worth knowing the difference from:

  • Happy path testing is a narrower idea: the single, cleanest positive case, written as documentation of what the feature is meant to do.
  • Edge case testing is the far end of negative testing: the unusual, boundary conditions that are rare but expensive if missed.

Read those two next if this post raised more questions than it answered.

Questions people ask

How many negative cases should one field get?

Enough to cover the four categories that apply to it: wrong type, out of range, missing, and not allowed. Not every field needs all four; a free text comment field has no meaningful range to violate.

Is a 50/50 split between positive and negative cases a good target?

No fixed ratio is correct for every feature. A payments field earns more negative cases than a cosmetic label field. Judge by what the field risks getting wrong, not by a percentage.

Should negative cases live in the same test suite as positive ones?

Yes. Keeping them together, field by field, makes it obvious during review which inputs were never tried.

What is the difference between a negative case and an edge case?

A negative case checks that invalid input is rejected. An edge case is a boundary condition, valid or invalid, that is unusual enough to be easy to miss.

Keep going

Try Tesbo, or get the next useful idea

Start building your testing workflow now, or get one practical email a month.

Get started

One email a month

What we shipped, what we learned, and the occasional infographic worth pinning. Unsubscribe in one click.