testing/simulator/ROADMAP.md
This document describes the current roadmap for the simulator. There are 5 crucial aspects in the development of the simulator:
COVERAGE.md file that describes how each feature of Turso is
covered by the simulator testing.For detailed information about how much of the input space we currently cover, please
check the COVERAGE.md file. Currently, most of SQLite query language
is either not supported or partial, and functions aren't supported.
Actionable items:
doublecheck or differential, we do not
need the shadowing. So we should separate the generation into shadowable/not shadowable paths, and generate
based on the current oracle.differential or doublecheck, they do make sense, because even in the case of errors the database
state should be equivalent with SQLite. It would make sense to deliberately break working queries to construct possibly
invalid inputs for testing unhappy paths.EXPLAIN PLANs to decide if a database state isn't diverse
enough for constructing interesting DQLs and instead starts to generate DMLs. We can use a similar approach.There are a number of properties currently implemented. We implement existing properties from literature (mainly SQLancer), as well as bespoke properties that is specific and niche. We also have a number of properties that rely on fault injection, which is a unique feature of the simulator.
SQLancer has a number of properties implemented for testing various database systems. We have ported some of them to the simulator, and we plan to port more in the future. The current list of ported properties is as follows:
INSERT VALUES ...; SELECT ...:: We can currently test inserting some literal values and reading them back.INSERT SELECT ...; SELECT ...;: We cannot test using the result of another SELECT for picking the inserted values.SELECT * from t WHERE p is equivalent to
SELECT p from t by asserting that the number of returned rows in the first one is equal to the number of TRUE values in the second one.p OR (NOT P) OR (p IS NULL) should always be TRUE.UNION ALL is equivalent toThese properties are invariants that check the consistency between Turso and the shadow state.
property oracle tests the properties presented above by generating random SQL statements and assertions that follow them.differential oracle tests Turso against SQLite.doublecheck oracle tests Turso against itself for checking determinism across runs.property oracle actually poses limitations compared to differential
and doublecheck oracles, in those oracles we have much more freedom to generate random inputs. We must leverage this freedom.INSERT statementsx AND y into x or y)At the moment, we collect no data from the simulator, which makes it hard to make future decisions. Some examples are: