- Posted on
- BOTdesign
Automated questionnaire testing
This information gathering takes the form of conversational robots, which ask patients questions and collect their answers. Depending on the answers, the robots will refine certain topics and lighten others. In the end, the number of possible combinations is exponential. Testing all these combinatorics each time an element of a questionnaire or the execution engine evolves quickly becomes a tedious and time-consuming task.
Requirement analysis
The tool or process we are going to implement must meet the following requirements:- Provide proof As a medical device, every time we upgrade the MAX solution, we need to keep “proof” of the tests we have carried out. In most cases, these are screenshots, so that in the event of a quality audit, we can present the tests carried out for each version change.
- Can be written by non-developers At BOTdesign, it’s the business team that sets the parameters for the robots. They must remain autonomous when it comes to writing tests corresponding to the settings.
- Automatic or manual execution Tests must be launched automatically when a new version of a medical questionnaire is deployed, but also manually if you want to replay all the scenarios.
- Maintainable The tool or process must remain maintainable. This means requiring less development time than the elements it tests. We’ve all experienced front-end component testing, which requires more time to redo the test than it took to build the functionality.
Setting up the tool
The tool seemed to fit our need and after some research, it integrates very well with Cucumber which would then address the issue of accessibility to non-developers.
Initial tests and validation of feasibility
Integration with Cucumber
.feature file that will contain features which in turn contain the test steps. A specification file looks like this:
# language: fr
Fonctionnalité: 'Test du questionnaire Oncogériatrie'
Test du déroulement d'un questionnaire Oncogériatrie sur MAX
@Notice
Scénario: oncogeriatrie
Soit je me connecte à MAX en tant que 'patient'
Et je choisis le questionnaire "Oncogériatrie"
Quand je démarre le questionnaire avec le bouton "Cliquez ici"
Et je réponds "65"
Et je réponds "157"
Et je clique sur le choix "Oui"
Et je clique sur le choix "Oui"
Et je clique sur le choix "Non"
Et je clique sur le choix "Non"
Et je clique sur le choix exact "Oui - Continuer"
Et je clique sur le choix "Non"
Et je clique sur le choix "Oui"
Et je clique sur le choix "Moyen"
Et je clique sur le choix "Non"
Et je passe la question
Et je clique sur le choix "Le patient lui-même"
Et je clique sur le choix "Oui - Continuer"
Et je clique sur le choix "8"
Et je clique sur le choix "Terminer"
Alors le questionnaire est terminé
We start by declaring the language in which the specification is written (English is also possible). Then the name, spec description and scenario name are made explicit; in this case, an Oncogeriatrics questionnaire.
Then come all the test steps. Each step is preceded by a keyword:
- Either, to describe the input data
- When, to describe the actions to be taken for the test
- Then, for the expected result
It’s easy to read and understand, as well as to produce.
On the technical side, you need to write functions corresponding to each possible action which, thanks to Playwright, will execute the action on the HEKO interface.
Automatisation
Conclusion
Business users will no longer have to scroll through the questionnaires by hand during parameterization or after each application modification.
Test reports are archived with screenshots.
The most complex questionnaires now take only 45s to unroll, compared with more than 5 minutes for a job that knows the questionnaire.
Mission accomplished!
Editors : Frédéric Combes et Raphaël Pech