Dialogflow ES Unit Testing Framework

Generating test scripts

In Dialogflow CX, test scripts are generated in the simulator (where you can just save the Test case). But you don’t have this option in Dialogflow ES. So you need to generate your own test scripts. And test coverage for pure FAQ chatbots is very different from test coverage for multi-turn chatbots.

How to automatically generate the test script

I have built a tool which allows you to automatically generate the test script for your ES bot. Go to the tool page and click on the “How to Use this Tool” button, or click here to read the tutorial.

Running Test Scripts

Once you have flattened your ES agent ZIP file into a CSV file, you can use it with PyCharm and run your test scripts. In my Improving Dialogflow ES accuracy course, I explain how you can set up automated conversation testing using Python.

Introduction

Dialogflow CX does have built-in Test Cases. That is one more reason why CX is more powerful and better suited for building complex flows than ES. However, there is no standard framework for ES. If you want to do conversation testing, my suggestion is to

Verbatim vs non-verbatim test phrases

While it might make sense to use an existing training phrase as a test phrase, in practice that is not a good idea. I explain why in this video:


About this website

BotFlo1 was created by Aravind Mohanoor as a website which provided training and tools for non-programmers who were2 building Dialogflow chatbots.

This website has now expanded into other topics in Natural Language Processing, including the recent Large Language Models (GPT etc.) with a special focus on helping non-programmers identify and use the right tool for their specific NLP task.

1 BotFlo was previously called MiningBusinessData. That is why you see that name in many videos

2 And still are building Dialogflow chatbots. Dialogflow ES first evolved into Dialogflow CX, and Dialogflow CX itself evolved to add Generative AI features in mid-2023