Scenario Outlines
One of the simplest, yet most useful features of Voight Kampff is the ability to provide a list of examples that will all be tested within one Scenario.
We can do this using Scenario Outlines. Think of these as a template that we setup and can then feed data into to run multiple tests.
Let's revisit the example from the previous page.
In this Scenario, when the user says "tell me weather", then our Weather Skill should reply with an appropriate dialog. However we know that there are many ways to ask about the weather. Rather than copy and pasting this Scenario for each utterance, we can instead use a Scenario Outline
.
The most obvious change is the new block of Examples
. This is a table of data that we want to use in our Scenario. We give that table a title "local weather questions", and for each column in the table we provide a column heading "current local weather", followed by one or more values.
To use this data, we must first explicitly change from using a Scenario
to using a Scenario Outline
. We are then able to use the Examples
data in our Steps by including the Column Heading surrounding by angle brackets. In this case we have added <current local weather>
to the When
Step on line 4.
Running the above Scenario Outline will test three versions of this Scenario - "tell me the weather", "what's the weather like", and "current weather". It is important to note that "current local weather" is a heading, not a value, and it will not be tested.
Multiple dependent variables
So far we have only used the Scenario Outline to take in a list of utterances. The same format can be used with tables of data.
In our new Examples
block, you can see we have expanded this into a two-column table containing the names of some Pokemon and the abilities they have. Using this data we have done two things.
With the Pokemon
Name
, we have used this in both the question and the response.The Abilities that are reported back are directly related to the Name from the same table row. If a user was to say "What abilities does Bulbasaur have", and Mycroft replied with "Bulbasaur has solar-power and blaze", then the Scenario would be considered a fail.
Last updated