Microsoft Bot Framework 的自动测试 [英] Auto testing for Microsoft Bot Framework

查看:26
本文介绍了Microsoft Bot Framework 的自动测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在使用 Microsoft Bot Framework 和 ASP.NET 开发我的第一个机器人.

I'm working now on my first bot with Microsoft Bot Framework, with ASP.NET.

在使用机器人模拟器手动测试后,我正在寻找为机器人创建自动测试的最佳方法.

After manually testing with the bot emulator, I'm looking for the best method to create automatic testing for the bot.

考虑两个问题:

  1. 自动化此类测试的最佳工具是什么?
  2. 测试可以对同一输入返回不同答案的对话框的最佳方法是什么?

推荐答案

另一种方法是使用 DirectLine 进行功能测试.需要注意的是,该机器人需要托管,但它很强大.查看 AzureBot 测试项目 了解其工作原理.

One alternative is doing functional tests using DirectLine. The caveat is that the bot needs to be hosted but it's powerfull. Check out the AzureBot tests project to see how this works.

另一种选择是做 BotFramework 团队正在为他们的一些单元测试做的事情.

Another alternative, is doing what the BotFramework team is doing for some of their unit tests.

如果您使用对话框,可以查看 EchoBot 单元测试 因为它们很容易理解.

If you are using Dialogs, you can take a look to the EchoBot unit tests as they are simple to follow.

如果你使用的是 Chain,那么看看他们是如何使用 AssertScriptAsync 方法的.

If you are using Chain, then take a look to how their are using the AssertScriptAsync method.

https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Tests/Microsoft.Bot.Builder.Tests/ChainTests.cs#L538

如果您正在寻找模拟 Luis 服务的方法,请参阅 this.

If you are looking for a way to mock up Luis Service, see this.

这篇关于Microsoft Bot Framework 的自动测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆