Site Search Optimization · Reference
What is data regression testing for search and browse?
Data regression testing records the products that should appear for a defined set of search and browse scenarios, re-runs those scenarios against production on a regular cadence, and alerts when the results diverge from what was recorded. It catches the class of failure nothing else catches: a change that breaks discovery without breaking anything, where the page loads, the product exists, and nobody can find it.
The failure this catches
Most catalog failures announce themselves. A feed job errors, a page 500s, a price shows as zero. Someone notices within hours.
Discovery failures do not announce themselves. A supplier ships an updated file where Stainless Steel arrives as Stainless steel , the facet splits into two values, and half the products drop out of the filter customers use most. Nothing errors. The products still exist, the pages still render, the PIM reports 100% attribute coverage, because the attribute is populated, only not with the value the facet was built on.
Or someone corrects a taxonomy node, and two hundred products silently leave the category page that was their main traffic source. Or a synonym is added to fix one query and wrecks the relevance of forty others. Or a boost rule intended for a seasonal push buries a bestseller.
These get discovered weeks later, usually by a merchant who happened to search for something, or by a traffic report nobody can explain. Data regression testing is the instrument that finds them the next morning.
Anatomy of a scenario
A scenario is a customer intent, expressed as something the site can execute, plus what should be true of the result.
Four parts:
- The intent, in plain language. “Customer looking for a dishwasher-safe stainless steel dog bowl under $30.” Write this down. It is what makes the test reviewable by someone who is not an engineer, and it is what tells you, a year from now, whether the expectation is still the right one.
- The executable form. A search query, a category URL, or a filter combination: whatever the customer would do.
- The assertions. What must be true of the results.
- Ownership and rationale. Who cares about this scenario and why it exists. Scenarios without a stated reason are the first to be deleted during a cleanup and the first to be missed afterward.
Assertions that survive contact with a live catalog
The temptation is to snapshot the exact result set and diff it. This produces a test that fails every day for reasons nobody cares about, and a test that always fails is a test nobody reads.
Assert on properties that should be stable even as the assortment changes:
- Must contain. These specific products appear somewhere in the results. The strongest and most durable assertion.
- Must not contain. These specific products, or any product matching a condition, do not appear. Catches relevance leakage, like the fastener that shows up in every search for “screw” regardless of intent.
- Position bound. This product appears within the first N results. Use for a handful of critical items, not broadly.
- Result count range. Between a floor and a ceiling. A category that returned 480 products yesterday and 12 today is broken, whatever the cause.
- Facet integrity. The expected facets appear, with a plausible number of values. This is the assertion that catches the split-value problem, and it is the one most people leave out.
- Zero-result guard. A defined set of high-intent queries must never return nothing.
Together these tolerate normal assortment change while catching the failures that matter. If a scenario fails every week for legitimate reasons, its assertions are too tight.
Where and when to run it
Run against production, not a staging environment. You are testing the data and configuration customers are hitting, and staging data is by definition not that.
Cadence:
- Daily as a baseline.
- After any bulk data load or full re-index, without exception. This is where the majority of real failures originate.
- After taxonomy changes, which reroute products in ways the person making the change rarely anticipates in full.
- After search configuration changes: synonyms, boost and bury rules, relevance weighting, field boosts. These have the widest blast radius per keystroke of anything in catalog operations.
Query the same API the site uses rather than scraping rendered pages. It is faster, more stable, and isolates the data question from front-end rendering. If your search runs on a hosted platform, its API is what you want.
Rule of thumb. Every configuration change to relevance should be followed by a regression run before anyone goes home. Search tuning is the one area where a five-minute change routinely costs a week of traffic.
Triage: intentional or anomaly
A failure is not automatically a bug. The first question is always whether someone meant to do this.
If someone retired a product, restructured a category or updated a rule on purpose, update the expectation and record what changed and why. That log is what makes the suite trustworthy over time; without it, expectations get updated to make red turn green and the tests slowly stop meaning anything.
If unintentional, the scenario has already narrowed the search. A single scenario failing points at product-level data. A cluster of scenarios in one category points at a taxonomy or attribute change. Scenarios failing across unrelated categories points at indexing or configuration. Facet assertions failing while membership passes points at value normalization, almost always a controlled vocabulary that stopped being controlled.
Most of what you find will be data, not code. That is why the suite belongs to the catalog team and not to engineering.
Keeping the suite from rotting
Two failure modes kill these programs.
Expectation drift. Every accepted change edits an expectation. After a year, half the expectations encode what the site did rather than what it should do. The defense is requiring a reason on every expectation update and reviewing the whole suite against real demand once or twice a year.
Scenario sprawl. Someone adds a scenario for every bug ever reported and the suite reaches four hundred entries, runs for an hour, and generates enough noise that nobody reads the output. Cap it. A scenario earns its place by covering revenue, a category, or a known-fragile mechanism. Everything else gets retired.
Where it sits relative to everything else
Regression testing is the outermost check, and it works on outcomes rather than on records. Creation governance stops malformed data entering. Defect reporting finds conditions that should never be true. Completeness scoring grades how much of the required data is present.
None of those can tell you that a correct, complete, valid product stopped being findable. Only running the customer’s actual scenario can, which is why it belongs at the end of the chain and why a catalog that depends on search and browse for discovery should not run without it.
Common questions
How is this different from normal QA?
QA tests code before release. This tests outcomes in production continuously, because the thing that breaks discovery is usually not a release. It is a data change, a supplier feed, a synonym edit, or a merchandising rule someone added on a Tuesday.
How many scenarios do we need?
Thirty to fifty covers most catalogs if they are chosen well: your highest-revenue queries, one per major category, your known-fragile filters, and any scenario that has broken before. Hundreds of thin scenarios are worth less than thirty that reflect real demand.
What do we assert, given results change legitimately all the time?
Assert on membership and bounds rather than exact ordering. Specific products must be present, specific products must be absent, result count must stay within a range, and critical products must appear within the first page. Exact-rank assertions produce constant false alarms.
How often should it run?
Daily for most catalogs, and immediately after any bulk data load, index rebuild, taxonomy change or search configuration change. The failures you care about cluster tightly around those events.
A test failed. Now what?
Decide first whether the change was intentional. Someone may have deliberately recategorized a product or retired it. If intentional, update the expectation and record why. If not, you have found either a data anomaly or a code bug, and the scenario tells you where to look.
Is this worth it for a small catalog?
Only if search and browse are how customers find things and the assortment changes regularly. A few thousand SKUs with stable data and a heavily curated navigation will not repay the maintenance. Ten scenarios covering your top categories is a reasonable minimum viable version.