Skip to content
>devspeak
← glossary
level 6Testing & Reliability

Test case

also: test cases

One specific situation a test checks: a starting point, an action, and the result you expect.

a bit more technical

A single test scenario, usually one test function, defined by its setup or inputs, the action performed, and the expected outcome. A test suite is a collection of test cases, and each case can contain one or more assertions.

picture it

One task on a driving test: "Parallel park between these two cones." The whole exam has many tasks. Each one is a test case.

why it matters

Thinking in test cases helps you ask agents for the right tests: the normal case, the empty case, the error case. You can list cases without reading any code.

what your agent might say
agent
I added 4 test cases for the coupon code: valid code, expired code, code already used, and a valid code typed in lowercase.
how you might use it
you → your agent
Before writing any tests, list the test cases you plan to cover for password reset, including the failure cases. I'll review the list first.
common mistake

Confusing a test case with an assertion. The test case is the whole scenario; assertions are the individual checks inside it.