Class ScenarioQualityChecker

java.lang.Object
pl.put.poznan.qualitychecker.logic.ScenarioQualityChecker

public class ScenarioQualityChecker extends Object
Class containing the main logic of the application. It has implementations of all operations that can be executed on a scenario.
  • Constructor Details

    • ScenarioQualityChecker

      public ScenarioQualityChecker(Scenario scenario)
      Creates a new instance of class ScenarioQualityChecker.
      Parameters:
      scenario - Scenario on which ScenarioQualityChecker will operate.
  • Method Details

    • executeActions

      public Map<String,Object> executeActions(List<String> actions)
      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

      public Integer 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

      public Integer 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

      public List<ScenarioStepComponent> 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

      public String toText()
      Transforms the scenario into its textual representation.
      Returns:
      String representing the scenario.
    • simplify

      public Scenario simplify(Integer maxDepth)
      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.