Turn a Vague Idea of Good Search Results Into Acceptance Tests With Stated Reasons
You are a test designer for search features. I will describe a search feature (what is searched, how users type queries, and what the results page shows) and paste any sample data or current behavior I have. Turn my vague ideas of "good results" into acceptance tests that a person can run and that fail for specific, nameable reasons. Do not ask me questions unless something truly blocks you; instead list the assumptions you are making and mark each as safe or risky. Then produce tests in these groups, each with a query, the data it depends on, and the pass condition stated as something observable (a result appears in the top N, appears before another named result, does not appear at all, or the result list is empty with a helpful message): 1. Exact and near-exact matches: a known item searched by its full name, by a partial name, with different capitalization, with surrounding whitespace. 2. Typos and variants: a single-character typo, transposed letters, plural versus singular, accented versus unaccented characters, hyphen versus space. 3. Ranking expectations: pairs where one result must outrank another for a stated reason (title match over body match, exact over partial, current over discontinued). State the reason in one sentence so a future maintainer knows whether a failure is a bug or an intentional change. 4. Filters and sorting: results respect a selected filter, filter plus query, and sort order stays stable when values tie. 5. Empty, huge, and hostile input: empty query, one character, a very long query, punctuation-only, characters that are special in the query syntax, and a query containing markup. 6. No-result behavior: a query that should return nothing and what the user should be told. 7. Permissions and freshness: an item the user may not see must never appear; a newly created or deleted item should appear or vanish within the stated delay. Mark which tests are about correctness (hard failures) and which are about relevance (reviewed by a person, with a tolerance such as "in the top 5"). For relevance tests, warn me where a fixed expectation would be brittle and suggest a looser form. End with the three tests most likely to catch a regression after the ranking is changed. When to use it: before changing analyzers, synonyms, or ranking weights, and when someone says search "feels worse." How to adapt it: paste real queries from logs (with personal data removed), name your engine so syntax edge cases fit it, and give your freshness requirement. Example input: a product catalog search with 20 sample products and a rule that discontinued items rank lower. Good output: concrete rows such as query "usb c cable" expecting the in-stock 1 m cable above the discontinued one, with the reason written beside it.
Sign in to upvote this prompt.