Comment on page
Example Interaction Script
After working on a list of jobs to be done creating Example Interactions is one of the next steps in the design and planning process. In this step you will take the Job Stories and write example Dialogs that get the User's job accomplished. These Example Dialogs will then be used to create Behave tests before development begins. Once development begins the Example Dialogs also become the basis of the Dialog and Vocab files within your skill. Once development begins you will need to update your Behave tests to utilize the Dialog files instead of the natural language responses that were written in the design and planning phases. The process is described in more detail in the example below.
Begin by writing the example interactions of your skill from start to finish based on your Job Stories. At first don’t worry about organizing the interactions. Just try to write down as many examples as possible. If you skipped ahead and
Here is an example of a First Draft Interaction of a Moon Phase Skill.
The next step in the process is organizing the first pass of dialogs into groups. You may already have a good idea of what these groups of similar interactions are based on your Job Stories from the beginning phase. You can also think of these as the features of the skill. In the Behave format these groups or features are called Scenarios.
Scenario: Error Handling
Once you have finished creating you example interactions and you have done some rounds of testing with some users, then it's time to convert your Interactions into Behave Feature files. You can see an example of the first Scenario from the Example Dialogs converted to a Feature file below.
Scenario Outline: The user asks for the current moon phase
Given an english speaking user
When the user asks for "<the current moon phase>"
Then "skill-moon-phase" should reply with "Today’s moon is Waning Crescent with 55% illumination"
| the current moon phase |
| what’s the moon phase |
| what's the phase of the moon |
| what is the moon phase today |
Some might think that creating the Flowcharts would be the first step in the process. After all the flowchart is abstract and doesn’t require full statements or prompts to be written. In a flowchart you just need to see the steps and decision points within the interaction. However, in practice the language used in the interaction can have such a great impact on the user’s input that is more important to start with Example Interactions and real statements and prompts first.
In a flowchart it's easy to add several decision branches to a step, but in practice the dialog necessary to effectively make the decision might require multiple steps. It's always best to start with the dialog.