Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the TestSuiteParser.java class #189

Open
dakaa16 opened this issue May 3, 2022 · 0 comments
Open

Refactor the TestSuiteParser.java class #189

dakaa16 opened this issue May 3, 2022 · 0 comments
Labels
good first issue Good for newcomers infrastructure Development infrastructure and tooling

Comments

@dakaa16
Copy link
Collaborator

dakaa16 commented May 3, 2022

Currently the TestSuiteParser has too much responsibility. This results in the class being a cluttered mess.
The class should have the single responsibility: 'Parse testsuites'. It should not directly create mocks or generate code - a level of abstraction should exist for this.
A way to do this would be something akin to:

  • A class for holding the testsuite state
  • A reader-class that returns tokens and updates the testsuite state
  • Keyword actions are triggered by specific states
  • Keyword actions could be of type Consumer<T>, to minimize duplication of code
  • Keyword actions should actually be utilized
  • A class or maybe multiple classes should generate cobol code
  • All of the above is used by TestSuiteParser.getParsedTestSuiteLines, that ties everything together with a simple loop and a switch statement, that triggers keyword actions (with an argument), based on the current state

The above list is a step towards having the TestSuiteParser have a single responsibility. Further steps is required. View the list as a way to get started.

@dakaa16 dakaa16 added good first issue Good for newcomers infrastructure Development infrastructure and tooling labels May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers infrastructure Development infrastructure and tooling
Projects
None yet
Development

No branches or pull requests

2 participants