Automated testing / unit tests for flows?

(Murat Knecht) #1

Hello there!

We’re creating bot interactions and automate lots of processes, with flows written by otherwise non technical people. That is amazing. As developer I recognize that FlowXO is a normal programming language with a somewhat visual way of constructing programs—and so I think we should not forget all we’ve learnt in traditional software engineering (especially how not to do it). One thing is testing, automated testing of code, so that when code changes and breaks, the tests will alert you of this.

Can someone point me to resources or ideas of how to implement automated tests for flows? Ultimately, I want our continuous integration tooling to cover FlowXO as well, and let us know, if we’re breaking a flow in some way.

Thanks!

(Daniel Beckett) #2

Hi @muratk

What type of things are you looking to test? Any particular use cases in mind? :slight_smile:

(Murat Knecht) #3

Hi Daniel,
thanks for the response! Any kind of flow, really. It’s code, it needs to be tested.

In particular: Given input, are the right responses given / other systems triggered? Ideally, those could be mocked.

Some flows use quite complex “jump logic”, that in a more high-level language would be a for loop (or a map in a functional language). As it is, changing such a flow is very dangerous; it’s easy to get it wrong, with the low-level constructs available: effectively GOTO statements.

With this fragile code base that flows are I’d love to be able to run unit tests to make sure that all the logic still works. How’d I do that? Even if it’s not fully automated: If I could somehow write test cases (even in an external language such as JavaScript or Python), then I could change the flow, run those tests and verify that it’s all still working.

Cheers
murat

(Daniel Beckett) #4

Hi Murat,

I’m not aware of any external tools or methods for this but the flow editor does include a test console. It’s also possible to copy flows so that you can experiment with them whilst leaving the original intact and still active if you wish to do so.

Any errors in a flow will be reflected in the Interaction Logs that can be used for troubleshooting.

Hope that helps! :slight_smile:

Thanks,
Dan

(Murat Knecht) #5

Hi Dan,

thank you for the reply—the test console is useful, but same as manually testing your python or JS function from the UI in a normal product, this sort of testing can’t replace unit and integration tests. I’ll have to think about how to do this effectively, so that we can use FlowXO for non-trivial use-cases with peace of mind, not just play code.

Have a great day!

Best
murat

1 Like