A unique syntax for steps parameters, suitable for scenarios both with and without example table


From http://jbehave.org/reference/stable/parametrised-scenarios.html:

It is also important to note that the same (@Named-annotated) methods can match steps that are executed both as standalone or via examples table, provided that both regex patterns are configured, one as the main pattern and one as an alias:

@Given("a stock of symbol $symbol and a threshold of $threshold") // standalone
@Alias("a stock of <symbol> and a <threshold>") // examples table
public void aStock(@Named("symbol") String symbol, @Named("threshold") double threshold) {

From a user perspective, it is a non-sense to me.

1. Those aliases do not provide any business value.

2. They make for duplication for free.

3. Bad user experience. That is forcing the user to write an alias just for JBehave to be able to handle both an example table and a standalone parametrized step. A user should not need to bother about the differences. The system should bother for him/her instead, by hiding the differences.

What I'm suggesting here is to have a unique syntax for parameters, based on '$' (as definitely the most suitable for variables), to work with steps both with and without an example table.

Therefore, with the following step method

..users would be able to write the following two scenarios:

Now, I'm not sure about the implementation, though, whether it could be a simple change or require intensive re-write.
I've tried to have a look at the code (StoryRunner) but I found it quite hard to follow.
What do you think?

Thank you




Alberto Scotto