Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

As a quick sanity check to make sure the bot files and localization changes are imported properly to the dev server, one can check https://covid19healthbot-dev.cdc.gov/ and run through a quick path.  This will be done more thoroughly in log/data testing.


Below are a few suggestions to help with testing the bot's code before and doing any front-end testing. A big key to do doing this type of code testing is to have the developer be neat and consistent with their coding. If the code is very messy or the developer is not consistent, this process may not work.

...

  1. What is being done here:
    1. Comparing Outcome code to make sure all variables are being used
    2. Comparing Outcome code to make sure the code matches correctly (for those blocks that should match)
    3. Looking for anything that looks off in the code
  2. Steps:
    1. Open bot in Azure Health Bot editor
    2. Go to Code view
    3. Click in code area and hit Ctrl-A to select all of the code
    4. Hit Ctrl-C to copy the code
    5. Open a new file in the text editor and hit Ctrl-P to paste the code
    6. Do this for all bots that are part of the same project. All code goes into separate documents in the text editor. 
    7. Sort the lines of code in each document. This will group similar lines of code together.
    8. Look for the Outcome code. This will be in the area of the code that begins with "onInit". You may need to look at the code in the Action items in the bot diagram to see what you are looking for. Depending on how the bot is written, there could be multiple Outcome code lines. 
    9. Once found, delete all the line lines of code except for these lines.
    10. Do this for each document in the text editor containing code.
    11. The next step is to combine all of these lines into a single document. Before doing this make sure to add a marker at the beginning of each line to identify which bot code it came from. This is very important otherwise once all the code is in a single document, it will be hard to find which bot it came from.
    12. Once the lines of code are combined in a single document, it should look similar to this:
    13. If the developer was neat and consistent, hopefully the code will line up. Review the code and look for anything that seems out of place. Note how in the below image the alignment is off. In this case this is pointing to an error in that misaligned code line.

...

  1. What is being done here:
    1. Making sure the visual representation of the bot looks good
    2. Looking for anything that looks out of place.
  2. Steps
    1. Go to the Designer view
    2. This process is more "look around and see what looks off". Being familiar with the bot logic and how the bot looks in the Designer view will greatly help.
    3. Click the Run button at walk through the bot watching how each part of the bot flows.
    4. Answer questions using the Web Chat box
    5. If the bot is small enough, use the Watch window to follow the bots progress. Items here can be expanded to she see values of parameter parameters as they are selected. i.e. In the image below, "Male" was selected for question showing in Web Chat and the selections shows as the value for the variable "gender" in the Watch window.
      1. Info

        If the bot is too large and the Watch window shows the error "Data is too large to be shown in the debugger", there is a work-around. The areas of the bot not being tested can be deleted. Doing this can make the bot small enough to test specific areas. 


        Warning

        This should only be done in a non-production environment and using a copy that will not cause problems if lost. 


    6. If the bot is small enough, use the Immediate window to find the value of a specific variable. i.e. In the image below, typing "scenario.gender" and hitting the Evaluate button returns the current value of the "gender" variable.

...