Test driven Journey development

Digital Journeys are very powerful tools to simulate problems with. To recap things that are unique to Digital Journeys:

  1. A journey is described in a Finite State Machine (FSM), where a participant navigates from node to node (state to state) based on some programming logic by the journey creator.
  2. Journey's all have default behaviour which involves asking questions and logging answers. However, journey logic can be extended using dynamic code, which means you can write some logic using our product API and include this in a journey.
The main challenges we found with digital journeys are:
  1. Complex journeys can be long to complete so testing a journey by completing it is not the most effective way to verify it works.
  2. Even though a browser based python/html editor  (codemirror) helped to ensure valid python/html was written, the reality is that dynamic libraries and logic are hard to verify.
We created the following approach to ensure that all journeys are correctly tested :
  1. A series of tests were created for each journey
  2. Each node had two tests:
    1. A test to confirm the node rendered correctly
    2. A test to confirm the node was processed correctly
  3. Any dynamic library was created as python code (unit_tests.py) and was tested using unit tests.
  4. The dynamic library was then made available to other tests as dynamic code using python inspect.getSource()
The end result was fantastic:
  1. Journey development was effectively done using integration tests. So journeys could be created from the test files.
  2. Dynamic code could be debugged using a Python debugger.
  3. The collaborators can have confidence that even though they cannot test all aspects of a journey beforehand, that the tests indicate the journey will succeed.
  4. This approach means that test development by third parties can be done remotely and as long as journey is accompanied by a suite of tests, it can be created with confidence that it will work.






Comments

Popular posts from this blog

Entrepreneurship and COVID-19

Psychodynamically informed leadership is critical in Covid-19

COVID-19 FAQ