[Gherkin] Generating UML Graph Sequence Diagrams from Gherkin Scenarios - Continued...

1,487 views
Skip to first unread message

chris young

unread,
Feb 15, 2010, 5:37:08 AM2/15/10
to Cukes
Starting this in a new thread as the old one appears to be broken...

Hi Jean-Michel,

Apologies for taking so long to get back to this thread, been really
busy on some other, but related stuff - deriving UML Class Diagrams
from D-Bus introspection XML but that’s another story for another
group...
Now I can get back to Gherkin and UML Sequence Diagrams.

> we could use http://github.com/EmmanuelOga/websequencediagrams
> which generates sequence diagrams on http://www.websequencediagrams.com/
> using a super simple DSL: Alice->Bob: Authentication Request

I like the idea of targeting http://www.websequencediagrams.com/ but
it's missing some key things for me namely:

-No Lifeline Constraints
-No way of representing Asynchronous Stimuli – e.g. Send a Message

For the work I'm doing I kinda need both!

Also, I don't think the websequencediagrams.com is _that_ much simpler
than Mykhaylo Sorochan's DSL for UMLGraph.

Finally I don't like the fact that websequencediagrams.com is not Open
Source.

Putting all that to one side I wouldn't rule it out as a target along
side Mykhaylo Sorochan's DSL for UMLGraph but I think the priority
should be working out the mapping between Gherkin steps and the
elements of a UML Sequence Diagram - i.e. Object, Stimulus, Frame,
Lifeline Constraint etc.

I intend to do this 'Test First' by producing a set of example pairs
of Scenarios and Sequence Diagrams to show the input and expected
output of the process.

What do you think of this approach? Would you be interested in
collaborating on producing these 'Tests'?

Cheers

Chris

Matt Wynne

unread,
Feb 16, 2010, 5:22:03 AM2/16/10
to cu...@googlegroups.com
Can you show us an example of how a Cucumber scenario would translate
into a sequence diagram?

> --
> You received this message because you are subscribed to the Google
> Groups "Cukes" group.
> To post to this group, send email to cu...@googlegroups.com.
> To unsubscribe from this group, send email to cukes+un...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/cukes?hl=en
> .
>

cheers,
Matt

http://mattwynne.net
+447974 430184

aidy lewis

unread,
Feb 16, 2010, 6:45:45 AM2/16/10
to cu...@googlegroups.com
Matt,

You'd be onto a winner here.

Even though we more a less have all BA's writing GWT, they' d still
spend days on 'process flow' diagrams. Use-Cases are static models,
sequence-diagrams are not.

This could really push Cucumber more into the business community.

Thanks

Aidy

chris young

unread,
Feb 17, 2010, 9:11:37 AM2/17/10
to Cukes
Hi Matt,

> Can you show us an example of how a Cucumber scenario would translate  
> into a sequence diagram?

Sure - I included one in my original post to the, now dead, thread
this one superceeded:

http://www.twitpic.com/qshm0

More to follow...

Here is the original post:

Gherkin is working a treat for us on a project at the BBC. Previously
we had produced a lot of UML Sequence Diagrams which whilst they have
their merits have been

overtaken by Gherkin Scenarios which are a lot quicker to write,
refactor and parametrize with example data.

One thing we've lost in moving from the UML Sequence Diagrams to the
Gherkin Scenarios is the visual and spatial qualities of the diagrams.

To regain this I'm looking at how we could generate UML Sequence
Diagrams from our Gherkin Scenarios, the figure below shows the sort
of mapping between the two that I'm thinking of:

http://www.twitpic.com/qshm0

Matt Wynne

unread,
Feb 17, 2010, 9:52:00 AM2/17/10
to cu...@googlegroups.com
This is a really cool idea. I wonder whether it might be simpler to
try to generate the gherkin from the diagram though, rather than the
other way around... WDYT?

Massimo Manca

unread,
Feb 19, 2013, 10:58:25 AM2/19/13
to cu...@googlegroups.com
Il 19/02/2013 13:35, Taras Kalapun ha scritto:
Hi All!
I've started implementing this generator.

The sample of output is here:�http://kalapun.com/portfolio/tmp/gherkin/
and the source is�https://github.com/xslim/gherkify

feel free to post issues and improvements on github.
What is the reason and the purpose of the generator? UML is not exactly an agile design and documentation standard.

On Monday, February 15, 2010 11:37:08 AM UTC+1, worldofchris wrote:
Starting this in a new thread as the old one appears to be broken...

Hi Jean-Michel,

Apologies for taking so long to get back to this thread, been really
busy on some other, but related stuff - deriving UML Class Diagrams

from D-Bus introspection XML but that�s another story for another


group...
Now I can get back to Gherkin and UML Sequence Diagrams.

> we could use http://github.com/EmmanuelOga/websequencediagrams
> which generates sequence diagrams on http://www.websequencediagrams.com/
> using a super simple DSL: Alice->Bob: Authentication Request

I like the idea of targeting http://www.websequencediagrams.com/ but
it's missing some key things for me namely:

-No Lifeline Constraints
-No way of representing Asynchronous Stimuli � e.g. Send a Message

For the work I'm doing I kinda need both!

Also, I don't think the websequencediagrams.com is _that_ much simpler
than Mykhaylo Sorochan's DSL for UMLGraph.

Finally I don't like the fact that websequencediagrams.com is not Open
Source.

Putting all that to one side I wouldn't rule it out as a target along
side Mykhaylo Sorochan's DSL for UMLGraph but I think the priority
should be working out the mapping between Gherkin steps and the

elements of a UML Sequence Diagram - i.e. �Object, Stimulus, Frame,
Lifeline Constraint etc.

I intend to do this 'Test First' by producing a set of example pairs
of Scenarios and Sequence Diagrams to show the input and expected
output of the process.

What do you think of this approach? �Would you be interested in


collaborating on producing these 'Tests'?

Cheers

Chris

--
-- Rules --
�
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
�
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
�
�

Taras Kalapun

unread,
Feb 20, 2013, 3:45:46 PM2/20/13
to cu...@googlegroups.com
My reason - generating Software Requirements Specification
As I write Use cases and am using Gherkin for this, why not generate some stuff to show both the client and developer?

BTW, I updated the page with more examples of generation

Massimo Manca

unread,
Feb 20, 2013, 3:58:56 PM2/20/13
to cu...@googlegroups.com
Technically the Given-When-Then paradigm seems better tailored to be
translated as a finite state machine then an activity diagram.
And I don't think useful a Use Case diagram if I have requirements
expressed in Gherkin. Sure there is a problem to collect tenths and
hundreds features but I think we should use a better paradigm then using
UML.
>

Taras Kalapun

unread,
Feb 20, 2013, 4:19:47 PM2/20/13
to cu...@googlegroups.com
I generate Use Case diagram from names of scenarios in feature.
And I generate Activity diagram for each scenario.

I might later generate state or sequence diagrams from scenarios, we'll see that.
I just started the work on this.

And about thousands of Gherkin features... In my case, they are quite high level, and they are around 10-15 for SRS

Tim Walker

unread,
Feb 20, 2013, 6:37:25 PM2/20/13
to cu...@googlegroups.com
And I think it's awesome. Oh yes "single source of truth" come home to daddy!

T
> --
> -- Rules --
>
> 1) Please prefix the subject with [Ruby], [JVM] or [JS].
> 2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
> 3) If you have a question, don't reply to an existing message. Start a new topic instead.
>

Massimo Manca

unread,
Feb 20, 2013, 7:04:26 PM2/20/13
to cu...@googlegroups.com
I really don't understand the usefulness of this approach.

UML has its requirement gathering model, if you like UML you should use it.

UML is not agile at all and not well suited to be used in an agile
context as is BDD. They are alternatives.

Of course a UML diagram may be sketched to visually document the result
of a design also using agile techniques but it mustn't be used to drive
the design. So multi path activity diagrams, state diagrams and class
diagrams are used quite frequently also by agile teams.

In my opinion UML is most devoted to design the application
architecture, BDD (also using Gherkin for requirements gathering) is
more oriented to directly "translate" requirements in executable
requirements driving the development of the application source code
bypassing the architecture design step. In this way it is difficult to
say when the architecture will be designed, most of the times the
complete architecture emerges day by day. In this way developers have to
design little parts of the source code without thinking so much to the
complete software architecture from the beginning, it is a refinement
process.

Taras Kalapun

unread,
Feb 21, 2013, 4:29:55 AM2/21/13
to cu...@googlegroups.com
It's good that there are many tools, frameworks and processes like UML, BDD, Agile, Gherkin, etc
It's up to us and our needs what to use and how to combine.

For something like SRS for not complex applications, where you plan to use Cucumber, one can use Gherkin to describe what customer needs
And then use same Gherkin for some testing.

And if some diagrams can help gain understanding between customer needs and a developer (who will need to do some pre-estimation for these needs), why not use them?



On Monday, February 15, 2010 11:37:08 AM UTC+1, worldofchris wrote:

Massimo Manca

unread,
Feb 21, 2013, 4:40:11 AM2/21/13
to cu...@googlegroups.com
Il 21/02/2013 10:29, Taras Kalapun ha scritto:
It's good that there are many tools, frameworks and processes like UML, BDD, Agile, Gherkin, etc
It's up to us and our needs what to use and how to combine.

For something like SRS for not complex applications, where you plan to use Cucumber, one can use Gherkin to describe what customer needs
And then use same Gherkin for some testing.

And if some diagrams can help gain understanding between customer needs and a developer (who will need to do some pre-estimation for these needs), why not use them?
As I said, in agile development we can use every diagram could help us but we don't want to drive the development by diagrams as UML ask to do.

My experience is more related to embedded development where many times customers have to deal with standards dictating how the product have to be developed. Exactly this set of customers claims to a better development cycle and are pressing to include an agile development cycle in those imposed by the standards. The V model development isn't already the best model to follow and the main problem is that acceptance testing and architecture design are the most heavy phases so they really don't invest in people but they invest a lot in tools to generate source code. The problem is that the process is heavy and doesn't assure more quality then an agile development cycle that emphasizes more on people and test-write source code then in tools. The most conservatives are using UML and SysML, the most innovative are using UML sketches, Mind Maps and customized diagrams. The results are promising.



On Monday, February 15, 2010 11:37:08 AM UTC+1, worldofchris wrote:
Starting this in a new thread as the old one appears to be broken...

Hi Jean-Michel,

Apologies for taking so long to get back to this thread, been really
busy on some other, but related stuff - deriving UML Class Diagrams

from D-Bus introspection XML but that�s another story for another


group...
Now I can get back to Gherkin and UML Sequence Diagrams.

> we could use http://github.com/EmmanuelOga/websequencediagrams
> which generates sequence diagrams on http://www.websequencediagrams.com/
> using a super simple DSL: Alice->Bob: Authentication Request

I like the idea of targeting http://www.websequencediagrams.com/ but
it's missing some key things for me namely:

-No Lifeline Constraints
-No way of representing Asynchronous Stimuli � e.g. Send a Message

For the work I'm doing I kinda need both!

Also, I don't think the websequencediagrams.com is _that_ much simpler
than Mykhaylo Sorochan's DSL for UMLGraph.

Finally I don't like the fact that websequencediagrams.com is not Open
Source.

Putting all that to one side I wouldn't rule it out as a target along
side Mykhaylo Sorochan's DSL for UMLGraph but I think the priority
should be working out the mapping between Gherkin steps and the

elements of a UML Sequence Diagram - i.e. �Object, Stimulus, Frame,
Lifeline Constraint etc.

I intend to do this 'Test First' by producing a set of example pairs
of Scenarios and Sequence Diagrams to show the input and expected
output of the process.

What do you think of this approach? �Would you be interested in


collaborating on producing these 'Tests'?

Cheers

Chris

--
-- Rules --
�

1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
�

You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
�
�

George Dinwiddie

unread,
Feb 21, 2013, 1:43:39 PM2/21/13
to cu...@googlegroups.com
Hi, Massimo,

On 2/20/13 7:04 PM, Massimo Manca wrote:
> Il 20/02/2013 22:19, Taras Kalapun ha scritto:
>> I generate Use Case diagram from names of scenarios in feature.
>> And I generate Activity diagram for each scenario.
>>
>> I might later generate state or sequence diagrams from scenarios, we'll see that.
>> I just started the work on this.
>>
>> And about thousands of Gherkin features... In my case, they are quite high level, and they are around 10-15 for SRS
>>
> I really don't understand the usefulness of this approach.
>
> UML has its requirement gathering model, if you like UML you should use it.
>
> UML is not agile at all and not well suited to be used in an agile
> context as is BDD. They are alternatives.

UML started as a set of modeling diagrams, and only later tried to
become a means of generating software.

Many people still find value in the communication power of the diagrams,
even if they're not following the UML methodology.

And, sometimes, it's helpful to explain something new in older terms so
that others can understand it. The biography of Michael Faraday by L.
Pearce Williams described how Faraday's discoveries were accepted more
readily because he published them using the prevalent model of the atom,
even though he used a different model to know where to look for these
discoveries.

>
> Of course a UML diagram may be sketched to visually document the result
> of a design also using agile techniques but it mustn't be used to drive
> the design. So multi path activity diagrams, state diagrams and class
> diagrams are used quite frequently also by agile teams.
>
> In my opinion UML is most devoted to design the application
> architecture, BDD (also using Gherkin for requirements gathering) is
> more oriented to directly "translate" requirements in executable
> requirements driving the development of the application source code
> bypassing the architecture design step. In this way it is difficult to
> say when the architecture will be designed, most of the times the
> complete architecture emerges day by day. In this way developers have to
> design little parts of the source code without thinking so much to the
> complete software architecture from the beginning, it is a refinement
> process.
>

What I don't understand, though, is why you are arguing about someone's
use of UML on the Cucumber list. Isn't enough that Taras finds it useful
in a particular context?

- George

--
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------

Massimo Manca

unread,
Feb 21, 2013, 3:05:45 PM2/21/13
to cu...@googlegroups.com
Il 21/02/2013 19:43, George Dinwiddie ha scritto:
> Hi, Massimo,
>
> On 2/20/13 7:04 PM, Massimo Manca wrote:
>> Il 20/02/2013 22:19, Taras Kalapun ha scritto:
>>> I generate Use Case diagram from names of scenarios in feature.
>>> And I generate Activity diagram for each scenario.
>>>
>>> I might later generate state or sequence diagrams from scenarios,
>>> we'll see that.
>>> I just started the work on this.
>>>
>>> And about thousands of Gherkin features... In my case, they are
>>> quite high level, and they are around 10-15 for SRS
>>>
>> I really don't understand the usefulness of this approach.
>>
>> UML has its requirement gathering model, if you like UML you should
>> use it.
>>
>> UML is not agile at all and not well suited to be used in an agile
>> context as is BDD. They are alternatives.
>
> UML started as a set of modeling diagrams, and only later tried to
> become a means of generating software.
>
> Many people still find value in the communication power of the
> diagrams, even if they're not following the UML methodology.
As I said, in an agile context they have a value as sketches and if they
don't need all the details. In this context an engineer using properly
UML diagrams should say that they are missing valuable informations.

And technically there are many diagrams standard and non standard that
may help you to better understand sw behavior and organization without
being heavy as UML diagrams.

The problem is in the general vision: the agile vision, especially for
BDD, is more customer oriented then any other methodology. So who would
follow BDD should think to implement the application from the point of
view of the customer. UML diagrams aren't customer oriented, they are
surely engineer oriented so they should be used only internally to the team.

The second point is that UML diagrams are too much detailed so
personally when could be useful only for team internal communication I
sketch something that could be defined a simplified Activity Diagram or
State Diagram (also id I don't like its "syntax") and so on.
>
> And, sometimes, it's helpful to explain something new in older terms
> so that others can understand it.
Yes, this is generally true.
> The biography of Michael Faraday by L. Pearce Williams described how
> Faraday's discoveries were accepted more readily because he published
> them using the prevalent model of the atom, even though he used a
> different model to know where to look for these discoveries.
>
>>
>> Of course a UML diagram may be sketched to visually document the result
>> of a design also using agile techniques but it mustn't be used to drive
>> the design. So multi path activity diagrams, state diagrams and class
>> diagrams are used quite frequently also by agile teams.
>>
>> In my opinion UML is most devoted to design the application
>> architecture, BDD (also using Gherkin for requirements gathering) is
>> more oriented to directly "translate" requirements in executable
>> requirements driving the development of the application source code
>> bypassing the architecture design step. In this way it is difficult to
>> say when the architecture will be designed, most of the times the
>> complete architecture emerges day by day. In this way developers have to
>> design little parts of the source code without thinking so much to the
>> complete software architecture from the beginning, it is a refinement
>> process.
>>
>
> What I don't understand, though, is why you are arguing about
> someone's use of UML on the Cucumber list. Isn't enough that Taras
> finds it useful in a particular context?
Yes, for him it is ok, I am interested to understand why he is designing
a tool that to me seems going backward then forward.
Personally I think that we should need to understand better the goals in
terms of sw development in the BDD context.

Personally I need:
1. to be able to translate Gherkin features and scenarios to executable
requirements that should describe behavior at a very high level (at
initial stage of development) or at a lower level to be able to drive
more directly the acceptance test steps.
2. A way to specify "semantically" better a hierarchy of
feature/scenarios to don't repeat every time the same steps
3. A way to collect/count every scenario involving the same actor
4. A way to discover if similar actors are the same (some sort of
dictionary)
5. A diagram to show visually interactions, dependencies and relations
between features and scenarios and order of execution of particular
scenarios.

N.B. I used UML driven development for some years but I really don't
think it is a good way to design an application.
>
> - George
>

Chris Matts

unread,
Feb 22, 2013, 6:20:43 AM2/22/13
to cu...@googlegroups.com
An interesting thread. I wanted to add a couple of points.

1. There is no such thing as an Agile tool. Its how you use it that counts. I have even used a Gantt Chart in the past on Microsoft Project. I used a Gantt chart to build a map of the dependencies so that I could systemetically remove them. Using a Gantt chart for planning would probably not be that Agile though.

2. I use UML (like) models within Agile projects. The key is that I use them to create model to help me find questions and examples. I do not use them to communicate requirements to the development teams because they are a lousy way of communicating. They have detail but no precision in the communication space. They are great for structuring your thoughts to help you find missing examples. UML (Language) should be UMT (Tool) as the models are tool and not a way to communicate effectively.

3. The G-W-T format was created with the express purpose of allowing non developers to communicate with developers in a way that did not require the developers to "re-think" the problem. G-W-T is a natural language expression of TDD with Mocks. I have seen people use Cucumber/specFlow in a non Agile manner. The two ways I've seen G-W-T used in a non-Agile manner are:
     1. A huge pile of examples is developed before development starts.
     2. Its an IT only thing with no engagement with the projects customer. ( This resulted in truly bizarre G-W-T examples )

Just saying, you know.

Chris

>

--
-- Rules --


1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.

You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
Regards

Chris Matts

Massimo Manca

unread,
Feb 22, 2013, 7:08:41 AM2/22/13
to cu...@googlegroups.com
Il 22/02/2013 12:20, Chris Matts ha scritto:
An interesting thread. I wanted to add a couple of points.

1. There is no such thing as an Agile tool. Its how you use it that counts. I have even used a Gantt Chart in the past on Microsoft Project. I used a Gantt chart to build a map of the dependencies so that I could systemetically remove them. Using a Gantt chart for planning would probably not be that Agile though.
Yes, I know, when I say tool I d0n't mean only a software tool

2. I use UML (like) models within Agile projects. The key is that I use them to create model to help me find questions and examples. I do not use them to communicate requirements to the development teams because they are a lousy way of communicating. They have detail but no precision in the communication space. They are great for structuring your thoughts to help you find missing examples. UML (Language) should be UMT (Tool) as the models are tool and not a way to communicate effectively.
I and my teams use "sketches", they may be UML-like or no standard every time they can help us but say that they are UML diagrams is too much.


3. The G-W-T format was created with the express purpose of allowing non developers to communicate with developers in a way that did not require the developers to "re-think" the problem. G-W-T is a natural language expression of TDD with Mocks. I have seen people use Cucumber/specFlow in a non Agile manner. The two ways I've seen G-W-T used in a non-Agile manner are:
     1. A huge pile of examples is developed before development starts.
     2. Its an IT only thing with no engagement with the projects customer. ( This resulted in truly bizarre G-W-T examples )
Yes, sure I know how they born. But they born in an agile context that is a new way to express a business language to write requirements in a BDD fashion by Dan North.

I think G-W-T is a very good way, so good that I would like to be able to drive acceptance tests more directly using them (I know there are a lot of engineers here thinking that it is not correct but in my embedded applications I tested this approach and I think it has many advantages) juste refining their initial content (that shouldn't change if the requirement doesn't change).
I just collected some stupid problems and sometimes I need to write similar scenarios too much times so I would like to find a way to solve these little problems in an elegant way. For these reasons I really think that some sort of diagram and a dictionary (to use a reduced set of terms to identify users/actors/devices) or a simple structured table could help when you have projects with hundreds of features and scenarios. I don't know how should be done the diagram, I need more time to think about it or any other solution with an other system, so every suggestion is very welcome.

But I am still convinced that the development should be very agile so everything shouldn't require too much effort to be useful and should be also very very simple, especially the test source code (the part used to unit test and to acceptance test the final application).
Reply all
Reply to author
Forward
0 new messages