Database testing · Users table
Saved order_count says 5, but Riya has only 3 orders
P3 · MinorIntermediateUsers table
Want to find it yourself first? This page gives away the answer. Play this bug on a fake app screen and see if you can spot it in three tries.
The clue
Two queries should agree.
Steps to reproduce
- Cancel or delete some of a user’s orders
- Compare users.order_count with a real count
Expected result
order_count = 3, updated whenever orders change
Actual result
order_count = 5
Why it matters
This is a minor (P3) bug. It does not stop anyone, but it looks careless and makes people trust the product less. It is usually fixed in a normal sprint.
Testing tip
Stored totals drift when one code path forgets to update them. Recount from the source rows and compare.
How to find bugs like this
Database bugs show up when you look at the tables: duplicate rows, joins that double totals, deleted users still active, values cut short or saved in the wrong type. When you test, try these checks:
- Run the query yourself and count the rows.
- Look for duplicates that differ only in case or spaces.
- Check deleted and archived records.
- Compare stored values with what the user typed.