Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-96987

Clarify main class responsibilities in QueryTester

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 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?)

            Assignee:
            daniel.segel@mongodb.com Daniel Segel
            Reporter:
            jess.balint@mongodb.com Jess Balint
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: