Closed ttutisani closed 6 years ago
I have refactoring in progress. If anybody is interested, I can provide upcoming structure class diagram.
Refactoring is happening on a branch named "refactorIntoClearModel". To see the work in progress, follow this link: https://github.com/ttutisani/Xunit.Gherkin.Quick/compare/refactorIntoClearModel?expand=1
To understand the goal of the refactoring, refer to the core class that describes the clear model: "ScenarioExecutor.cs".
Specifically, this fragment should be self-explanatory (this is the basic flow that this whole framework is based on):
var featureClass = FeatureClass.FromFeatureInstance(featureInstance);
var featureFile = _featureFileRepository.GetByFilePath(featureClass.FeatureFilePath);
var scenario = featureClass.ExtractScenario(scenarioName, featureFile);
scenario.Execute();
If it's really self-explanatory, then you get the idea of what I'm trying to achieve - self-describing, expressive code.
How far along is the refactoring?
It's almost over now. Yesterday evening I got everything working in terms of running the scenarios successfully. I only have these pieces to do:
I expect this all to be done by end of this week. Maybe even earlier. But I prefer to provide pessimistic estimates.
And then it will open up the opportunity to add support for the new argument types: tables and docString. Before that, I will probably release a new version of Nuget too.
Just FYI - yesterday I spent whole evening brainstorming around introducing a knowledge level
pattern in the new approach. No progress on actual refactoring.
It may spill into next week.
I'm trying to convince myself that the knowledge level would be too difficult to implement...
Refactoring is complete. PR is open: https://github.com/ttutisani/Xunit.Gherkin.Quick/pull/31
I will be merging tomorrow. Want to sleep on it and/or gather feedback. This opens the door for easily adding support for all argument types. Will be working on that next.
PR is merged. I will also create a readme file for contributors. That file will describe the model, as well as the design guidelines going forward. Till then, I'll keep this issue open.
Action item on me is complete. Readme file is complete. Closing this issue.
I know that several people have already mentioned about refactoring. Before anybody commits to do so, this topic is here to discuss it in advance.
If no actions are observed, I will post my thoughts around it later. Meanwhile:
Regardless of who does it, in my opinion, refactoring should make concepts of this framework more explicit, easier to digest and change further in the future.
Refactoring should be driven by readability and expressiveness, rather than by technical aspects only (such as dependency injection or splitting into smaller interfaces). I believe such focus will ensure successful growth of the project, instead of dragging it down long term and eventually slowing it down.