If the user follows simple conventions when writing BDD tests, some inference can be done from them and a generic Spec Transformer can be used for deriving the Entity from the Gherkin's sentence.
For example, on the following Glue, instead of capturing only the name of the employee, we can capture (employee with name \"[^\"]*\"):
@When("The company's (employee with name \"[^\"]*\") has a role assigned")
From there we know that:
- The Domain Entity singular name is "employee", and Isis has the ability to derive the singular name form the Entity's class name, or specify it through the Isis "@Named" annotation.
- We must search an Entity of the previous type by name.
- The name must be equal to PETER.
As the Domain Entity singular name must be explicitely used, it also reinforces the "Ubiquitous Language" on those BDD tests.
We can admit some variants of the previous case, such as:
- the employee with name "PETER"
- the employee named "PETER"
- the property with reference "REF-001"
- the property referenced "REF-001"
- the product with id "PR-001"