Skip to main content

Hands-on: exploratory testing of an LLM

Why This Matters

Testers increasingly use LLMs to write test cases. The output looks professional, is produced in seconds, and is wrong in ways that are easy to miss: a boundary one cent off, a missing invalid partition, an expected result that contradicts the requirement. Testing the LLM’s test design, with the test design technique you know best, is both a good exercise in exploratory testing of an AI system and a skill you will use at work.

What you will learn

  • Run a structured exploratory test session against an LLM: charter, timebox, notes, debrief
  • Check LLM-generated boundary value analysis for correctness and completeness
  • Recognise the typical ways an LLM gets test design wrong

Syllabus: HO-4.2.3 (apply exploratory testing to an LLM performing boundary value analysis).

Refresher: 2-value and 3-value BVA

Boundary value analysis tests at the edges of equivalence partitions, because that is where developers make mistakes (< instead of <=).

  • 2-value BVA: for each boundary, test the boundary value and its closest neighbour in the adjacent partition.
  • 3-value BVA: for each boundary, test the boundary value and both its neighbours.

“Closest neighbour” depends on the precision of the input: for an amount in euros with cents, the neighbour of €100.00 is €99.99, not €99.

The requirement

Use this requirement for the session:

Order discount. The order amount is entered in euros with two decimals. Valid amounts are €0.01 to €10,000.00. Orders below €100.00 get no discount. Orders from €100.00 up to and including €499.99 get 5% discount. Orders of €500.00 or more get 10% discount. Amounts outside the valid range are rejected with an error message.

Before you ask an LLM anything, work out the answer yourself; it is your oracle in the debrief.

Show the correct test values

Partitions: invalid ≤ €0.00 · no discount €0.01–€99.99 · 5% €100.00–€499.99 · 10% €500.00–€10,000.00 · invalid ≥ €10,000.01.

Boundary values: €0.01, €99.99, €100.00, €499.99, €500.00, €10,000.00 (and the invalid neighbours €0.00 and €10,000.01).

2-value BVA, 8 test values:

ValueExpected
€0.00rejected
€0.01no discount
€99.99no discount
€100.005%
€499.995%
€500.0010%
€10,000.0010%
€10,000.01rejected

3-value BVA, 14 test values: €0.00, €0.01, €0.02, €99.98, €99.99, €100.00, €100.01, €499.98, €499.99, €500.00, €500.01, €9,999.99, €10,000.00, €10,000.01, with the expected result from the partition each value falls in.

The session

Use any LLM chatbot you have access to. Do not paste confidential requirements into a public tool; this one is made up, so it is fine.

Charter: Explore how well an LLM applies 2-value and 3-value BVA to the order discount requirement, to discover errors in its test values and expected results.

Timebox: 30 minutes.

Run these prompts, and vary them:

  1. “Apply 2-value boundary value analysis to this requirement. List each test value with the expected result.” (paste the requirement)
  2. Ask the same question again, in a new conversation. Is the answer the same?
  3. “Now apply 3-value boundary value analysis.”
  4. “Which partitions did you use?”
  5. Ask it to check its own answer: “Are any boundary values missing?”
  6. Change one thing in the requirement (amounts in whole euros instead of cents) and ask again. Does it adapt the neighbours?

Keep notes in a session sheet:

TimePromptWhat the LLM saidCorrect?Issue
0:032-value BVA8 values; uses €99 and €101NoWrong precision: neighbours should be €99.99 and €100.01

What you are likely to find

LLMs make a recognisable set of mistakes with BVA. A typical first answer to prompt 1 looks like this (an illustration of the kind of answer you may get; yours will differ):

Test valueExpected result
€0Rejected
€1No discount
€99No discount
€1005% discount
€4995% discount
€5005% discount
€10,00010% discount

Check it against your own answer:

  • Wrong precision. €99 and €499 instead of €99.99 and €499.99, and €1 instead of €0.01. The requirement says two decimals; the model fell back to whole numbers. The boundary between “no discount” and 5% is never tested at its closest neighbour.
  • Wrong expected result. €500 is listed as 5%; the requirement says 10%. The value is right, the oracle is wrong. A tester who only checks the values misses this.
  • Missing boundary. €10,000.01, the invalid value above the upper boundary, is not there. LLMs often forget the invalid side of the outer boundaries.
  • Confusing 2-value and 3-value. Asked for 3-value BVA, models often add only one extra value per boundary, or add neighbours on one side only.
  • Inconsistency. In a new conversation the same prompt can give a different set: sometimes correct, sometimes with other mistakes. One correct answer does not make the tool reliable.
  • Overconfident self-checks. Asked “are any boundary values missing?”, a model may say “no, the analysis is complete”, or invent a “missing” value that is not a boundary.

Debrief

At the end of the timebox, review your notes, alone or with others:

  • Correctness: which values and expected results were wrong?
  • Completeness: which boundaries or partitions were missing?
  • Consistency: how much did the answers differ between runs?
  • Usefulness: would the LLM’s output save you time, given the checking it needs?

A fair conclusion is often: useful as a first draft and a reminder of partitions, never as the final test design without review. The time you save writing, you spend checking, and you can only check it because you know BVA yourself.

Exercise

Write two acceptance criteria for using an LLM to generate BVA test cases in your team, so that its use is safe.

Show suggested answer

For example:

  1. “Every LLM-generated test design is reviewed by a tester against the requirement before it is used; the review checks the partitions, every boundary value with the input’s precision, the neighbours, and every expected result.”
  2. “On a set of 10 reference requirements with known correct BVA, the LLM and prompt the team uses produce the correct and complete set of test values and expected results in at least 9 of 10 cases, in each of 3 runs. The check is repeated when the model or prompt changes.”

The second criterion turns the exploratory findings into a regression test for the tool itself: the same idea as the red-team dataset in lesson 29.

Exam-style questions

Quiz

1. A valid age is 18 to 65, in whole years. Which set of test values is correct for 2-value boundary value analysis?

  • A. 17, 18, 65, 66
  • B. 18, 65
  • C. 17, 18, 19, 64, 65, 66
  • D. 0, 18, 65, 100
Show answer
A. Each boundary value and its closest neighbour in the adjacent partition. C is 3-value BVA.
Quiz

2. During an exploratory session, an LLM gives a correct BVA answer once and an incorrect one when the same prompt is repeated in a new conversation. What does this show?

  • A. The LLM is broken and cannot be used
  • B. The output is non-deterministic, so one correct answer is not evidence of reliability; repeated runs and review are needed
  • C. The first answer was a coincidence and should be ignored
  • D. The prompt was wrong
Show answer
B.