CITCOM-project / causcumber

Cucumber driven causal inference for testing computational models.
1 stars 1 forks source link

Changing Gherkin keywords #27

Open AndrewC19 opened 3 years ago

AndrewC19 commented 3 years ago

It would be good if we could change the Gherkin keywords Given, When, Then, Background, Feature etc. to our own keywords that are more in-line with causal testing.

We use a Feature to define a collection causal tests related to a Modelling Scenario.

We use the Background template to characterise the model executions that represent the modelling scenario (i.e. input configurations that would simulate the modelling scenario).

We use the Scenario template to define a causal test case. This describes how some intervention(s) should change an outcome in the scenario.

We use the Given step to define our control input configuration, which is the base state of the modelling scenario that we want to compare against in this causal test (commonly no change to the Background but might be some version of treatment such as a particular vaccine).

We use the When step to define our treatment input configuration, which is the input configuration after applying intervention of interest to the control input configuration (e.g. a vaccine or a different type of vaccine).

We use the Then step to assert the expected causal effect of the treatment (difference between Given and When) on an outcome of interest.

It would be good if we could re-name these to something aligned with our use-case.

bobturneruk commented 3 years ago

I think these are defined as strings somewhere in behave - should be fairly straightforward but may require modification of behave.

neilwalkinshaw commented 3 years ago

I suppose this is an important point @bobturneruk - it'd be nice to avoid the situation where we'd need to release some amended version of behave along with causecumber. Are there any potential workarounds that people can think of?

jmafoster1 commented 3 years ago

I second the need to avoid modifying behave if at all possible. An obvious workaround would be some sort of preprocessor which transforms our "modified" keywords into the default Gherkin ones before running behave. If it only had to transform feature files and the step annotations, that shouldn't be too difficult. It's basically just a regex find and replace! It's not as if we'd be adding in any extra functionality.

bobturneruk commented 3 years ago

I agree best not to require a modified behave. I'll have a think.

bobturneruk commented 3 years ago

Some of my notes on #23 maybe relevant.