CtrlK
BlogDocsLog inGet started
Tessl Logo

testland/state-transition-test-design

Derives human-readable manual test cases from stateful behavior: identify states, events, transitions, and guard conditions, draw the state table including invalid (empty-cell) transitions, choose a coverage level (all states, valid transitions / 0-switch, transition pairs / 1-switch per Chow, all transitions including invalid ones), then derive one test case per coverage item as an event sequence with per-step expected states (ISTQB CTFL v4.0 section 4.2.4). A deep single-technique walkthrough rather than a broad multi-lens case matrix; the output is manual step/expected cases rather than parameterized test code, and it covers how cases are derived rather than how a case record is structured. Use for lifecycle entities (accounts, orders, subscriptions), workflows, and UI wizards where the response to an event depends on the current state.

78

0.81x
Quality

93%

Does it follow best practices?

Impact

77%

0.81x

Average score across 10 eval scenarios

SecuritybySnyk

Passed

No findings from the security scan

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-5/

Gift cards are paying for things they should not

Problem Description

Our gift cards are printed in batches and sit on the rack by the tills until somebody buys one, at which point the cashier activates it and loads the value onto it. From then on the customer spends it at any till: the terminal deducts the amount from the balance, and if the card does not have enough on it the terminal declines the whole transaction - we do not part-pay and we do not let a card go negative. A card spent down to nothing is still a valid card and can be topped up again at any till, and a refund for something bought with a card goes back onto the card it was paid with.

If a customer reports a card lost or stolen, the contact centre suspends it. Suspension is reversible - people find them again - and while a card is suspended the point of the exercise is that it buys nothing. A customer who does not find it gets the balance moved onto a replacement card, which voids the old one. Finance can also void a card outright, for fraud or for a batch recall, and a voided card is dead permanently.

Two incidents opened this work. A card was taken off the rack before anybody bought it and spent at a till in the same shop; it had never been activated and it had no purchase behind it. And a card that had been reported stolen and suspended on the Tuesday was accepted at a self-checkout on the Wednesday.

The current test pack has six cases: buy and activate a card, spend some of it, spend the rest of it, top it up, suspend it, void it. They all pass.

Output Specification

Produce docs/gift-card-tests.md containing:

  1. The model the cases come from: for each situation a card can be in, what each of the eight things that can happen to it does, including any case where the same thing happening produces different results depending on the balance.
  2. Numbered manual test cases with steps and per-step expected results. Every case states the card's starting situation and starting balance, and every step states the balance and the situation afterwards.

Card printing, the loyalty scheme, and the terminal's own hardware are out of scope. Do not write code - these run against a till in the training store.

Input Files

Extract the following files before beginning.

=============== FILE: docs/gift-card-rules.md ===============

Gift card rules - card services

Situations a card can be in

SituationTill displayContact centre display
Issued"Card not active"Not sold
ActiveBalanceActive, balance, last used
Depleted"Zero balance"Active, zero balance
Suspended"Card blocked"Suspended on by
Voided"Card invalid"Voided on , reason

Things that can happen to a card

EventWhere
activateTill, when the card is sold
redeemTill or self-checkout, for a purchase
reloadTill, adding value
refund-to-cardTill, returning goods paid for with the card
suspendContact centre
unsuspendContact centre
voidFinance, or automatically when a balance is moved off
transfer-balanceContact centre, moving the balance to a replacement

Eight events. Nothing else changes a card.

Rules

  • Cards on the rack are printed and inert until a cashier activates them.
  • Redeeming for less than the balance leaves the card in play with less on it.
  • Redeeming for exactly the balance empties it.
  • Redeeming for more than the balance is declined in full; nothing is deducted and nothing is part-paid.
  • A card with nothing on it is still a valid card: it can be topped up, and a refund can put money back on it.
  • A suspended card buys nothing until the contact centre lifts the suspension.
  • Moving a balance onto a replacement card voids the card it came from.
  • Voided is permanent. Nothing brings a voided card back.

SKILL.md

tile.json