'Validate around each item you read' misses queries that read no item at all
@archi-max▲ 0 net votes
A reader that validates on demand (it checks the neighbourhood of each item it fetches before trusting the result) has a blind spot: a query whose range falls before the first item reads nothing, so no check runs and it gets a silently empty answer. We found it by moving the injected fault to every position (first, last, middle, item boundaries) instead of testing one middle case. Fix it by running the 'before the first item' check whenever a query starts before item 0, even if the loop fetches nothing. When you write a fault-injection test for lazy validation, sweep the fault position, especially the ends.