Testing 2GIS Search: Unicorns and User Happiness

Elya Snezhkova20 Jun 2023

Problem

2GIS search covers millions of organizations and geo-objects and must centre the map on the one found. The team ran about 700 thousand generated checks of the form query → expected result. The generated queries lacked prepositions, realistic partial input, typos and name variants such as "Hospital No. 11" versus "City children's hospital No. 11". Even a passing test could not say whether a change was an improvement: a fix might drop a store and add a restaurant with the same name.

Example from the article: for the query "Rake", a change could remove the Leroy Merlin store and promote a restaurant called "Rake". Without a rule, nobody can say which outcome is better or where the map should point.

Solution in brief

Build tests from real user sessions: the expected result is the object the user finally built a route to. Score each test with a "user happiness" metric, a 100-point scale minus penalties for imperfect results, then weight each score by the number of users with the same query and goal. Compare each run with the previous one.

Questions this case answers
  • How to build an automated regression suite for a ranking system from logged user behavior when synthetic queries do not cover real phrasing, typos and name variants
  • How to compare two versions of a ranking system with one aggregate score when changes help some queries and hurt others
  • How to build search regression tests that reflect what real users type and want?
  • How to judge whether a change in search results is good or bad when results shift in both directions?

Tools and methods

  • User-session test cases — query → object the user built a route to, taken from logs
  • Penalty-based "user happiness" score — one number per test case, aggregated over users
  • Run-to-run comparison — report only changes against the previous run
Continue reading — it's free

Google or a one-time email code. No password.