Skip to main content
Using AI for Edge-Case and Boundary Discovery

AI-Assisted Test Case Design

Using AI for Edge-Case and Boundary Discovery

Reading12 min read

Using AI for Edge-Case and Boundary Discovery

Experienced testers develop an instinct for "what could go wrong here" — empty inputs, maximum lengths, race conditions, unusual locales. That instinct takes years to build. AI can act as a fast-forward button on it, systematically walking through categories of edge cases you might otherwise reach for only after enough painful production incidents.

Boundary Value Analysis, Automated

Classic boundary value analysis says: test just below, at, and just above every limit. For a field that accepts 1-50 characters, that means testing 0, 1, 2, 49, 50, and 51 characters. Doing this by hand for every field in a form is tedious — it's exactly the kind of exhaustive, mechanical enumeration an AI assistant handles well when you give it the constraint.

List boundary value test cases for a "quantity" field in a checkout
form. Constraints: integer, minimum 1, maximum 99, required.
Include the exact boundary values to test and the expected result
for each.

Categories Worth Explicitly Prompting For

A generic "find edge cases" prompt tends to circle the same few ideas. Naming categories gets much better coverage:

  • Boundary values — min/max, off-by-one, empty, null
  • Format and encoding — unicode, emoji, right-to-left text, SQL-special characters, very long strings
  • Timing and concurrency — two users editing the same record, a request that arrives during a deploy, timezone edge cases around midnight/DST
  • State-dependent bugs — an action performed twice quickly (double-submit), an action on an already-deleted resource
  • Locale and internationalization — date formats, currency symbols, address formats that don't fit a US-shaped form

A Worked Example

For a "delete comment" feature, a good AI-assisted edge-case pass surfaces things like: deleting a comment that has replies, deleting the same comment twice in two open tabs, deleting a comment right as another user is editing it, and deleting a comment as a user whose permissions were just revoked. None of these are exotic — they're exactly the class of bug that slips into production because nobody thought to write them down.

Where This Technique Has Limits

AI-suggested edge cases are generic patterns applied to your description of a feature — it has no idea about your actual database constraints, your actual concurrency model, or bugs your team has hit before. Use it to widen the net, then filter through what you know about your system that the model doesn't.

💬 Discussion

Think of a production bug you've encountered that turned out to be an edge case. Would a systematic AI-assisted edge-case pass, prompted with the categories above, have likely caught it before release?

Q
Knowledge Check
1 / 3

What is the main benefit of naming specific categories (boundary values, timing/concurrency, locale, etc.) in your edge-case prompt instead of just asking for "edge cases"?

Next Lesson

Exercise — Turn a User Story into a Test Case Set

Generating Test Cases from Requirements with AI