-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
QueryTester is currently organized around the Test (test.cpp) and QueryFile (test_file.cpp) classes. These two classes are responsible for parsing, execution, normalization, serialization and generating readable test results. The design can be improved by reorganizing these two classes. The primary goal is to separate the concerns mentioned.
- The Test class is stripped of any behavior and only holds a query, expected result and some metadata (eg, testNum). It will become immutable.
- QueryFile contains parsing, execution, serialization and data structure which will be split as follows:
- TestGroup is introduced to represent a group of tests loaded from a single file. It will contain a set/vector of Test instances and metadata (filename, etc). It will be responsible for the data structure portion of QueryFile.
- TestFileParser is introduced to encapsulate parsing logic. It will accept a file, some mode/options, and produce a TestGroup.
- TestExecutor is introduced to orchestrate the execution of tests (can/should this just be a function?). It will execute the tests in the group and produce a TestResult.
- TestResult is introduced to represent the result of executing a TestGroup.
- TestResultSerializer is introduced to handle the serialization of a TestResult to a string.
- TestResultPresenter is introduced to write the "actual" results file and execute the git diff command.
- (Do we need any design consideration for normalization?)