Karsten's Blog

June 26, 2009

Using fit4oaw for complex Xtend functions

Filed under: fit4oaw — Tags: , , — kthoms @ 10:08 AM
This is my first try to use posterous. I’m excited what this service will provide me. To have something worthful to write about I decided to write about my current work I’m on today.
I have a customer who has defined a data transformation language with Xtext. Part of this language are declarations and usages of variables. No wonder. Of course variables can be used just within their scope – and here it becomes interesting. Xtext does not provide this out-of-the-box. The functions that we need to detect scoping are rather complex to develop. Basically we need just one function which detects for a given variable reference if the referenced variable is within the scope.
I use fit4oaw to go for a test-first approach. This helps me develop this function test-driven.
As you can see from this screenshot I evaluate expressions and compare their results. In the loaded model there are several variable references, and the function inScope() detects whether the referred variable is in scope. Now I have managed to get them all green, but work is not completely done. I now have to construct more complex situations and I know of at least one situation that would fail now. So – change the test model, add the test and it should fail again. Then develop further on the functions to handle this situation and the test should execute successful.
Writing complex Xtend functions was never so easy!

Posted via email from Karsten’s Blog

About these ads

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Silver is the New Black Theme Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 375 other followers

%d bloggers like this: