Automated Testing for Microsoft Bot Framework

Now I am working on my first bot with the Microsoft Bot Framework, with ASP.NET.

After manual testing with a bot emulator, I am looking for the best way to create automated testing for a bot.

Given two problems:

  • What is the best tool to automate such tests?
  • What is the best method for checking a dialog that can return different responses to the same input?
+6
source share
4 answers

One option is to perform functional tests using DirectLine. The caveat is that the bot must be hosted, but it is powerful. Check out the AzureBot project to find out how it works.

Another alternative is what the BotFramework team does for some of its unit tests.

If you use Dialogs, you can take a look at the tests of the EchoBot module , as they are easy to use.

If you are using Chain, then see how they use the AssertScriptAsync method.

If you're looking for a way to fake Luis Service, see this .

+7
source

You might want to consider Selenium . Selenium is a web browser automation software that allows you to write tests that programmatically read and write to the DOM on a web page. With selenium script you can:

  • on any channel that the web client provides (and most of them: WebChat, Telegram, Skype, Facebook, for example)
  • start a conversation with your bot
  • perform operations such as sending a message to the chat and waiting for a response
  • check if the answer matches.
+3
source

For automated testing of bots in Node.js, using the ConsoleConnector, just like the tests in BotBuilder on GitHub work well, for example. take a look at https://github.com/Microsoft/BotBuilder/blob/master/Node/core/tests/localization.js :

var assert = require('assert'); var builder = require('../'); describe('localization', function() { this.timeout(5000); it('should return localized prompt when found', function (done) { var connector = new builder.ConsoleConnector(); var bot = new builder.UniversalBot(connector); bot.dialog('/', function (session, args) { session.send('id1'); }); bot.on('send', function (message) { assert(message.text === 'index-en1'); done(); }); connector.processMessage('test'); }); 

... etc...

+1
source

look over there. This explains two aspects for testing. 1- Your understanding engine "LUIS". How good your training data is. 2- Once your LUIS "understands" well, you need to check the interaction in the dialogue.

How to automate the test for LUIS and QnA in chat?

Benoit

0
source

Source: https://habr.com/ru/post/1013554/


All Articles