Class ScenarioQualityChecker
java.lang.Object
pl.put.poznan.qualitychecker.logic.ScenarioQualityChecker
Class containing the main logic of the application. It
has implementations of all operations that can be executed
on a scenario.
-
Constructor Summary
ConstructorsConstructorDescriptionScenarioQualityChecker
(Scenario scenario) Creates a new instance of classScenarioQualityChecker
. -
Method Summary
Modifier and TypeMethodDescriptionComputes the total number of steps within a scenario, including steps that are in all nested scenarios.Computes the total number of all conditional decisions in the scenario (composite steps, starting with a keyword).executeActions
(List<String> actions) Executes specified actions on a scenario.Finds all steps within a scenario at any level of nesting that do not start with an actor.Simplifies the scenario by restricting it to a certain maximum level of nesting.toText()
Transforms the scenario into its textual representation.
-
Constructor Details
-
ScenarioQualityChecker
Creates a new instance of classScenarioQualityChecker
.- Parameters:
scenario
- Scenario on which ScenarioQualityChecker will operate.
-
-
Method Details
-
executeActions
Executes specified actions on a scenario.- Parameters:
actions
- List of actions to be executed. Names of the actions should correspond to names of methods of this class (one exception is action 'simplify[depth]`, where depth is the parameter of method simplify().- Returns:
- Dictionary mapping names of the actions to their results.
-
countAllSteps
Computes the total number of steps within a scenario, including steps that are in all nested scenarios.- Returns:
- The number of all steps in the scenario.
-
countConditionalDecisions
Computes the total number of all conditional decisions in the scenario (composite steps, starting with a keyword).- Returns:
- Number of all conditional decisions in the scenario.
-
getInvalidSteps
Finds all steps within a scenario at any level of nesting that do not start with an actor.- Returns:
- A list of all steps found by the method.
-
toText
Transforms the scenario into its textual representation.- Returns:
- String representing the scenario.
-
simplify
Simplifies the scenario by restricting it to a certain maximum level of nesting.- Parameters:
maxDepth
- Maximum nesting depth to which the scenario should be restricted.- Returns:
- Simplified version of the scenario.
-