@Ariel Shaqed (Scolnicov)@Itai Admi thoughts about how to test this?
08/09/2023, 7:57 AM
Count number of
vs number of incremental
Ariel Shaqed (Scolnicov)
08/09/2023, 8:17 AM
Also unit tests should examine cases where SeekGE goes to the very last element of the window, and also right after the very last element of the window.
In the past I've had success with testing an iterator by seeking to each element (n seeks) and also before, after, and in between all elements (n+1 seeks), and reading from there to the end of the block. It sounds like a lot but actually when you count up it comes out at a few hundreds of thousands of elements inspected, even for large numbers of objects). In this case the unit test would simulate say reads of 20 elements out of a list of 1000 elements, seek to each element and before and after each element, and read all elements from there to the end. This way the computer does the hard work and we have a chance of covering all test cases.
I think I did such a test for gills, the "fastest possible SSTable" prototype code), and probably also elsewhere.