Questions regarding GraphWalker

606 views
Skip to first unread message

Ijaz Sarwar

unread,
Oct 26, 2015, 2:14:07 AM10/26/15
to graphw...@googlegroups.com
Hi folks, 


I am new to GraphWalker. Planning to give demo to my team regarding model based testing using GraphWalker. But I have few questions:


1) Does GraphWalker even work on Mac OS or I need to install Ubuntu VM?

2) I know GraphWalker is written in Java. But can it auto-generate test automation code in other languages like JavaScript or Swift?

3) A test case is a path in the graph. Can we generate manual test cases from the model?

4) Can we have model for each feature in separate graph XML file and then stick them together? Do you have such example graph XML?


Thanks,
Ijaz 

Kristian Karl

unread,
Oct 26, 2015, 3:12:54 AM10/26/15
to GraphWalker 3
Hi Ijaz,

See my inline answers.

Best Kristian


On Monday, October 26, 2015 at 7:14:07 AM UTC+1, Ijaz Sarwar wrote:
Hi folks, 


I am new to GraphWalker. Planning to give demo to my team regarding model based testing using GraphWalker. But I have few questions:


1) Does GraphWalker even work on Mac OS or I need to install Ubuntu VM?

It will work on Mac OS. In fact, it will work on any platform that supports Java.
 

2) I know GraphWalker is written in Java. But can it auto-generate test automation code in other languages like JavaScript or Swift?

It will not generate anything else than Java Interfaces today. 
 

3) A test case is a path in the graph. Can we generate manual test cases from the model?

Yes it can. The path is a series of edges and vertices, which for a manual tester would be translated into actions and verifying results. But the toll is not explicitly made for manual testing. 
 

4) Can we have model for each feature in separate graph XML file and then stick them together? Do you have such example graph XML?

Yes you can. Have a look at the Pet Clini example: http://graphwalker.org/docs/pet_clinic. It consists of 5 model, which are run together.
 

Thanks,
Ijaz 

Kristian Karl

unread,
Oct 27, 2015, 10:31:18 AM10/27/15
to GraphWalker 3
I have one update on your question regarding "auto-generate test automation code". 
I re-introduced an old feature from version 2, into version 3. This feature enables you to create stub source code for any language.

It exists on a pre-release version ( 3.4.0-SNAPSHOT) of graphwalker, and I have not yet documented it on http://graphwalker.org/docs/command_line_syntax
But in short: From command line, where abc.graphml is your model, and xyz.template is your stub code template, this will create source code:

java -jar graphwalker-3.4.0-SNAPSHOT source -i abc.graphml xyz.template

An example of a template: https://github.com/GraphWalker/graphwalker-project/blob/master/graphwalker-cli/src/test/resources/template/perl.template
The important stuff in the template are:
HEADER<{{
This will occur only once, and in the beginning of the source code
}}>HEADER

#
# Anything between the HEADER and FOOTER, will be repeated as many times as
# there are unique vertices and edges in the model. # Unique is defined by the names of a vertex or edge
#
sub {LABEL}() <<<===== {LABEL} will substituted by the edge or vertex name
{
  print "{EDGE_VERTEX}: {LABEL}\n"; <<<===== {EDGE_VERTEX} will substituted by either the words edge or vertex
  die "The {EDGE_VERTEX}: {LABEL} is not implemented yet!";
}

FOOTER<{{
This will occur only once, and in the very end of the source code
}}>FOOTER 

ijaz....@gmail.com

unread,
Oct 29, 2015, 2:31:25 AM10/29/15
to GraphWalker 3
Thanks Kristian for prompt reply!

I am trying to prepare a demo for the team. I was able to run Pet Clinic example and gone through the modeling syntax. 

1) Vertex and Edges we start with v_ and e_ respectively - is that optional? or just for easy to read.

2) If an edge or vertex fails what happens in online? Does it stop there or remembers that link is broken and try to test as much as it can? We might have reached in unknown state after the failure, so we need to restart?

3) Same as previous question but what happens in case of failure in offline mode? The rest of the sequence could not be executed then?

4) In one of your example (java -jar graphwalker.jar offline -m Login.graphml "random(edge_coverage(100))") it generated one huge sequence. So it does not generate multiple test cases? ()

5) Somewhere I was reading that older version of GraphWalker used to show live in the graph while test execution - that would be cool for demo :) Do we still have that feature in latest GraphWalker?

6) Is this presentation is still valid (I am not sure how old is it)? http://www.cs.tut.fi/tapahtumat/testaus10/Karl.pdf 

7) I know this tool is not intended for manual testing. But do you know if anyone is using it for manual testing?

8) Does GraphWalker have concept of End state?

9) This one is tough one. Why GraphWalker? There are other MBT tool available in the market ... why you think people should use GraphWalker? 



Thanks,
Ijaz

Kristian Karl

unread,
Oct 29, 2015, 3:28:01 AM10/29/15
to GraphWalker 3
Hi Ijaz, 

See my inline ansnwers

Best Kristian


On Thursday, October 29, 2015 at 7:31:25 AM UTC+1, ijaz....@gmail.com wrote:
Thanks Kristian for prompt reply!

I am trying to prepare a demo for the team. I was able to run Pet Clinic example and gone through the modeling syntax. 

1) Vertex and Edges we start with v_ and e_ respectively - is that optional? or just for easy to read.

Yes, that is just a naming convention that is optional. For readability in code.
 

2) If an edge or vertex fails what happens in online? Does it stop there or remembers that link is broken and try to test as much as it can? We might have reached in unknown state after the failure, so we need to restart?

Graphwalkers default fail strategy is fail fast. However, this behavior can be overridden
 

3) Same as previous question but what happens in case of failure in offline mode? The rest of the sequence could not be executed then?

Depends on how you implemented your tests. But remember, when generating a test sequence offline, you don't interact with your system under test. You just generate a sequence from models, you don't execute tests.
 

4) In one of your example (java -jar graphwalker.jar offline -m Login.graphml "random(edge_coverage(100))") it generated one huge sequence. So it does not generate multiple test cases? ()

The concepts of test cases does not apply or exist when generating test sequences in model based testing. You could say that each verification done in a vertex is a test case (I prefer the words check or verification instead), and your test sequence is your test suite.
 

5) Somewhere I was reading that older version of GraphWalker used to show live in the graph while test execution - that would be cool for demo :) Do we still have that feature in latest GraphWalker?

That feature will come back in 3. However, there's a implementation using GraphStream, see: Pet Clinic example video, walkning the graph. It's from http://graphwalker.org/docs/pet_clinic
 

6) Is this presentation is still valid (I am not sure how old is it)? http://www.cs.tut.fi/tapahtumat/testaus10/Karl.pdf 

Not for version 3. The concept is still the same, but command line syntax and the modellingsyntax has changed a little bit. 
 

7) I know this tool is not intended for manual testing. But do you know if anyone is using it for manual testing?

Not really.
 

8) Does GraphWalker have concept of End state?

Not in the model(s). End of execution is handled entirely by stop conditions.
 

9) This one is tough one. Why GraphWalker? There are other MBT tool available in the market ... why you think people should use GraphWalker? 

  • It's built by testers, for testers
  • It's open source...
 


Thanks,
Ijaz

puneetj...@gmail.com

unread,
Jul 18, 2017, 5:34:02 AM7/18/17
to GraphWalker 3
Hi Kris


Please could you provide me more clarity.Because I am not able to create test case from graph.

3) A test case is a path in the graph. Can we generate manual test cases from the model?

Yes it can. The path is a series of edges and vertices, which for a manual tester would be translated into actions and verifying results. But the toll is not explicitly made for manual testing. 

Steps I have done: 

 1) Graph created via YED
 
2) Executed on dos  with this command java -jar graphwalker.jar offline -m GraphSearch.graphml "random(edge_coverage(100))"

I got it below response.Now I will get the test cases.

{"currentElementName":"e_EnterValidSite"} {"currentElementName":"v_WebSiteOpen"} {"currentElementName":"e_ClickonFlight"} {"currentElementName":"v_Flightsearchpageopen"} {"currentElementName":"e_EnterValidcitypairandDate"} {"currentElementName":"v_SearchFlight"}

Thanks
Puneet

Kristian Karl

unread,
Jul 18, 2017, 7:51:19 AM7/18/17
to GraphWalker 3
Hi,

Actually, you did create test cases. The path you generated represents the test.

Kristian

puneetj...@gmail.com

unread,
Jul 19, 2017, 12:55:38 AM7/19/17
to GraphWalker 3
Thanks Kris for your quick response.
Hi Kris'

  Thanks for your quick response.

Means whatever Graph I have created that would be consider as test case. is it ?

If yes then I have one more query. 

It meas we cant get test case in Excel sheet.Because test case is deliverable for any testing project. So how we will deliver test case to client in MBT.

Many Thanks
  Puneet

Kristian Karl

unread,
Jul 19, 2017, 2:26:58 AM7/19/17
to GraphWalker 3
Hi,

Well, yes. Or rather, it could be a matter of opinions of course. What is a test case? Every time the automation checks something (visiting a vertex), is that a test case? Or, is it a complete scenario with a sequence of actions and checks (edges and vertices)? I don't have any definitive answers, you need to choose what suites you needs best.

I usually see a test case as a combination of a model(s) and it's generators. Depending on what generator (and stop conditions) you use, you will get different model coverage, see http://graphwalker.github.io/Tests_execution/#smoke-test-example 

/Kristian

Puneet Johar

unread,
Jul 20, 2017, 3:28:30 AM7/20/17
to GraphWalker 3
Hi Kris'

With the help of below statement we can get random coverage. Instead of random command  do we have any other command which could provide me maximum test coverage.

  java -jar graphwalker.jar offline -m GraphFlight.graphml "random(
edge_coverage(100))"

Many Thanks
  Puneet

HC

unread,
Jul 20, 2017, 4:39:51 AM7/20/17
to GraphWalker 3
Hi
You can have a look at Generators and stop conditions section in the graphwalker documentation
Hope this helps.
Regards.

Puneet Johar

unread,
Jul 24, 2017, 8:35:36 AM7/24/17
to GraphWalker 3


Hi Kris'

Do we have any other command which we can use in place of random.Which could provide us complete coverage of graph.If we have complex graph.then random command always shows different path and number of test case.I would appreciate if you could suggest any command which can provide completed coverage(Edge+vertex).

java -jar graphwalker.jar offline -m Login.graphml "random(edge_coverage(100))"

I have gone through with this URL  http://graphwalker.github.io/generators_and_stop_conditions/     but could not find out anything for complete coverage.

Regards
  Puneet

Kristian Karl

unread,
Jul 24, 2017, 11:24:40 AM7/24/17
to GraphWalker 3
Complete coverage will be achieved if the stop condition is edge_coverage(100).

Your challenge, as I understand, is that you want the shortest path through your model, also known as shortest all paths, New York Street Sweeper, or the Chinese Postman problem. This is not an easy thing to accomplish, and there is a task for it https://github.com/GraphWalker/graphwalker-project/issues/34

If you have data in your models, then it gets even more complicated.

The most effective generator we have today, is quick_random. But that only works with no guards in the model.
Reply all
Reply to author
Forward
0 new messages