Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » Unit testing tools for QVTo?
Unit testing tools for QVTo? [message #1243730] Tue, 11 February 2014 11:06 Go to next message
Christine Gerpheide is currently offline Christine GerpheideFriend
Messages: 21
Registered: January 2014
Location: Netherlands
Junior Member

Hi all,

Currently we have some unit testing of transformations in place that runs a transformation with some input model, produces an output, and compares it to some expected output model. This works sort of OK. The biggest part we are lacking is actually a measurement of test coverage.

So my questions: have any of you used unit testing? If so, are you using some (open source) framework? And, does it measure code coverage?

I've searched the internet and forums, but so far all I've found are some old posts from 2009 and some literature about a tool called MANTra (but no tool available to download). So, before attempting to revamp our testing "framework" myself, I wanted to see if anyone else has done something with success.

Thank you!
Chris
Re: Unit testing tools for QVTo? [message #1245299 is a reply to message #1243730] Thu, 13 February 2014 15:51 Go to previous messageGo to next message
Christine Gerpheide is currently offline Christine GerpheideFriend
Messages: 21
Registered: January 2014
Location: Netherlands
Junior Member

And if there don't seem to be any, then feel free to post suggestions for things you would like in a tool, since I plan on open-sourcing anything I do end up making. I'm thinking for now just highlighting statements touched and then reporting percent statements/mappings/helpers/queries touched.
Re: Unit testing tools for QVTo? [message #1245312 is a reply to message #1243730] Thu, 13 February 2014 16:15 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4150
Registered: July 2009
Senior Member
Hi

I don't know of any tool.

Internally the Eclipse QVTo project uses JUnit tests around Java launches.

The QVTo execution is interpreted using a Visitor for each AST class.
The Visitor is intended to be extensible for tracing, so it should be
really easy to intercept whatever you want to count occurrences.

If you're able to produce good tools, we would like to make them
available through the Eclipse QVTo project.

The Eclipse JUnit View is extensible so you might look to defining a
standard JUnit launcher and checker that could apply to any MtoM tool.

Regards

Ed Willink


On 11/02/2014 13:55, Chris Gerpheide wrote:
> Hi all,
>
> Currently we have some unit testing of transformations in place that
> runs a transformation with some input model, produces an output, and
> compares it to some expected output model. This works sort of OK. The
> biggest part we are lacking is actually a measurement of test coverage.
>
> So my questions: have any of you used unit testing? If so, are you
> using some (open source) framework? And, does it measure code coverage?
>
> I've searched the internet and forums, but so far all I've found are
> some old posts from 2009 and some literature about a tool called
> MANTra (but no tool available to download). So, before attempting to
> revamp our testing "framework" myself, I wanted to see if anyone else
> has done something with success.
>
> Thank you!
> Chris
Re: Unit testing tools for QVTo? [message #1248703 is a reply to message #1243730] Mon, 17 February 2014 15:12 Go to previous messageGo to next message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 162
Registered: July 2009
Senior Member
Hi Cris,

> Currently we have some unit testing of transformations in place that
> runs a transformation with some input model, produces an output, and
> compares it to some expected output model. This works sort of OK. The
> biggest part we are lacking is actually a measurement of test coverage.
>
> So my questions: have any of you used unit testing? If so, are you
> using some (open source) framework? And, does it measure code coverage?
>

Framework you described is actually the one of frameworks that QVTo uses for unit tests.

Look at http://git.eclipse.org/c/mmt/org.eclipse.qvto.git/tree/tests/org.eclipse.m2m.tests.qvt.oml/src/org/eclipse/m2m/tests/qvt/oml/api/framework

This is implementation of Selkow's algorithm used to compare EMF models as a tree structures.

Junit test suite http://git.eclipse.org/c/mmt/org.eclipse.qvto.git/tree/tests/org.eclipse.m2m.tests.qvt.oml/src/org/eclipse/m2m/tests/qvt/oml/transform/TransformTests.java
uses exactly the scheme you described.

Btw, we also use a couple of other script driven testing frameworks which are implemented as a part of testing automation for QVTo (completion engine, debugger interception, etc.).
See http://git.eclipse.org/c/mmt/org.eclipse.qvto.git/tree/tests

Test coverage is usually organized by third-party tools like Sonar or dedicated plug-in like emma for Hudson.

Regards,
Sergey.

Re: Unit testing tools for QVTo? [message #1249463 is a reply to message #1248703] Tue, 18 February 2014 09:24 Go to previous message
Christine Gerpheide is currently offline Christine GerpheideFriend
Messages: 21
Registered: January 2014
Location: Netherlands
Junior Member

Hi Sergey,

About the code coverage: I looked at tools like EMMA/EclEmma, but as far as I could tell, it only operates on Java code, and would not be able to do things like highlight QVTo statements touched. Am I mistaken?

Chris
Previous Topic:Failed to save model to platform:/resource
Next Topic:Input model to be used by Operational QVT Interpreter
Goto Forum:
  


Current Time: Sun Nov 23 21:37:04 GMT 2014

Powered by FUDForum. Page generated in 0.31616 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software