Script testing
Testing is an important part of the bot development process. It allows controlling the project efficiency and monitoring which changes to the script may affect the way it works.
Manual testing
In its simplest form, testing can be carried out manually: you can send messages to the bot and verify that its expected and actual behavior are the same.
To do manual testing, deploy the bot in a separate channel unavailable to end users. We strongly recommend using a channel of the same type as the main one, so the testing environment resembles production as closely as possible.
Automated tests
When a bot script has a complex structure, even minor changes can have a major effect on its way of operation. The bigger the script becomes, the more resource-heavy and expensive manual testing becomes.
JAICP allows writing automated tests for scripts, which describe the required bot behavior in a declarative style. If you cover the whole script with automated tests and support them together with the main code base, you will be certain that the bot behaves exactly as expected.
Tests are created in the test
project directory and are executed automatically before each bot deployment.
You have control over the list of tests which get executed (via the chatbot.yaml
configuration file) as well as over the mode of execution.
Specifically, in some cases you can skip running tests altogether.
Tests are written in XML and use a strictly defined set of tags. Learn more about tags used in tests.