Yesterday I went to a breakfast seminar at Jayway's office here in Malmö. Hugo Josefson and Renas Reda showed us a new way to write tests for Android called Robotium.
The framework aims to remove the pain of writing traditional Android instrumentation tests. When demonstrated it is striking how easy it is to create UI tests using Robotium.
Hugo showed us an example test case written using normal Android instrumentation. He then proceeded to show a similar test written using Robotium. The Robotium test was about a tenth of the amount of code required to create a traditional Android test. It also removes the need to have any awareness of the underlying application being tested. This makes the framework useful both as a very powerful QA tool and for creating up front acceptance tests.
Robotium is also fully integrated with Maven using Maven for Android. This makes it easy to get up and running and to automate. It also makes it easy to work in other IDEs then Eclipse.
The one thing I missed was influence of BDD. I almost exclusively use the given-when-then format when I write tests. I find that it helps increase readability. It also helps me staying focused on the domain I work with. This is because it is closer to how the customer expresses them self when discussing features.
I have started to sketch on how the main class, Solo, would look given some given-when-then syntactical sugar. The Robotium source code is on GitHub so I forked it. Feel free to check out my progress. The changes are added in the same manner Mockito have added BDD, by extending the main framework class. In Robotiums case this means there is now a BDDSolo class that inherits from Solo. I will add methods to it as and when I have time.
Please come with feedback and ideas. What is currently there have been done from a very limited grasp of how Robotium works. I hope that I will get a chance to use it soon so I can add some more substance to it. In the mean time I would like to get others feedback. Both on Robotium specific things and on general phrasing.
Me and Hugo talked about how to design some lower level APIs for Robotium, and there will be a discussion on the Robotium Google group at some point. But in the mean time, I like to discuss APIs by actually designing them and GitHub makes it easy to maintain such a discussion in code. So feel free to join in.
I have been curious about Ruby for a while now but haven't had the time nor opportunity to use it. A week ago however I decided to use it to automate some build tasks.
Getting started with Ruby on Mac OS X is easy enough. The runtime and interactive shell is included. Looking around for a good place to start I found the Ruby in Twenty Minutes tutorial. This was a great start and got me going.
Once past the tutorial I started working on the tasks that my script needed to preform. I was using TexWrangler to edit the code and ran it in Terminal. And of cause using irb to try things out. This is really all that is needed to create Ruby code, which is great.
However, being from the Java world I was curious to find out what the NetBeans Ruby plugin would offer me that this set up does not. Since the scripts are part of a much larger Java project built using Maven there is no overhead to open it in NetBeans. So having already passed this obstacle of launching the editor was a nice supprise. It packs some really good functionality for a Java developer just starting out with Ruby.
The most striking is the hints it gives on how to structure the code in a more Ruby like manner. For example, coming from a Java background I would write an if statement like this:
if not File.exist? "jars"
But NetBeans recommended that I write it like this:
Dir.mkdir("jars") unless File.exist? "jars"
This makes a huge difference in readability. Further more I don't think I would have picked this up was it not for the NetBeans Ruby plug-in. Since I had no intention to dig deep into Ruby, but only create a simple script, I would not have searched around the internet and read loads of Ruby code. Nor would I have had anyone else to review the code and come with feedback. But getting this kind of advice from the editor helps improve the code and increase my awareness of the language. This is a great way to get started quickly.
I would definitely recommend others in my situation to try this out. But if your intention is to really learn the language you are better of reading loads of well written Ruby code. That is by far the best way to learn how to express one self in a new language. But with limited time NetBeans does provide a quick way in.
At work we have an organic fruit basket. The other day I grabbed a grape fruit. I noticed that there was a sticker on the fruit, something I don't usually like, but this one caught my eye. It was a picture of a smiling man and the text "enter 450 at natureandmore.com". This got me curious so I had to do it.
I was greeted by a flash interface where I could enter the three digit code and then hit enter. This took me to a presentation of the farming community that grew the very fruit I had in my hand. In a video one of the farmers talked about the community (I think, I don't understand Spanish). The feeling of authenticity is excellent.
The site was created to increase the transparency between the producers and the consumers of organic produce. This have certainty succeeded. It feels good to get to know something about the farmers from the other side of the world, in the same way as the local farmers when I go to the Farmers Market. It is also great to see that the choices that we make when buying fair trade and organic actually makes a real difference.
This is one of the best ways I have seen to utilise the Internet and Information Technology. It so brilliant because it uses simple concepts to deliver answers to quite complex questions around the environmental and social impact of our food choices.
The only real critique I have is of a technological nature (of course) and has to do with the choice to use flash as the technology that welcomes the user. I am not a big fan of flash and especially not when it is so easy to replace it with normal HTML. To complete a HTML form would have been just as easy and much more elegant in my opinion.
I have been in the process of moving from Blogger to my own WordPress blog for a long time now. With a demanding job and small children there just isn't much time and energy left to pursue such things as changing the look and feel and the hosting of ones web presence. But now it's finally done.
The immediate benefits as I see it is a an updated look and feel that is more to my liking and also that I now have one design for my web presence, rather then two as was the case before.
Longer term, well WordPress is a much richer application with a lot of neat features. And an abundance of good looking themes. Further it is installed at my service provider so I have control over the content and don't need to be dependent on Google. Which in my humble opinion is a good thing.
Anyway, now that it's done I may have some time to start writing new articles instead of scratching my head over the look and feel and the plug-ins to choose (there are so many of each that you could probably justify a full time job keeping up with them, if not several).