Beware HttpUnit and NekoHTML

The latest version of HttpUnit still doesn’t work well with NekoHTML. Certain behaviour in NekoHTML parsing HTML into a DOM and assumptions in HttpUnit means that trying to set parameter values for a SELECT parameter fails even though you know it’s a valid option value. The current workaround is to use JTidy thought we’re still considering switching to HTMLUnit to improve performance issues we’re having. I have to remember to try disabling javascript interpreting in HttpUnit as I remember this was quite a slow down for tests on a previous project.

The City of Chocolate, Food and Beer

ChocolateThis weekend was a great opportunity to visit another country in Europe, but this time, via the Eurostar, a train connecting London to the rest of the train network in Europe. The Eurostar’s major stops are Waterloo in London, Paris in France and Brussels in Belgium, though you can catch connecting trains to other destinations, like to Bruge where I ended up for the weekend with Kath from Oxford.

I thoroughly recommend anyone living in London to catch the Eutostar to any of its destinations instead of flying as it is a much more pleasurable experience. If you pick you tickets up in advance, you only have to be there approximately half an hour in advance to get through passport control and be on the train. Since it departs from Waterloo found in zone 1 it should mean getting there is easier than any of the airports. The train ride is extremely smooth and the seats are much more comfortable and spacious than the equivalent economy ones you will find on any plane.

BeerAlthough the Eurostar finishes at the end of Brussels, we caught a connecting train to Ooestende that stopped in Bruge in about an hour. The train station in Bruge is located on the southside of the city, and it wasn’t too long before we checked into our hotel.

Anyone who had been to Bruge before and I had spoken to said that the city was beautiful and even though the weather we experienced cycled from raining overcast skies to perfectly warm bright blue ones, we definitely saw the charm that this city had to offer. The city is interspersed with many canals and surrounded by one large circular one, meaning that you will find over 65 bridges and understand why it is called the Venice of the North. Buildings of all different styles since the 15th century line the traditional cobblestones road, yet all of the streets looked consistently clean, even with the number of tourists walking around. The city itself is easily walkable, with the medium sized winding paths opening up to larger squares with the major two being Markt and Burg.

I highly recommend that you take a canal tour, with a single trip costing 5.70 lasting around half an hour providing you with a great historical and local account of many of the buildings, bridges and areas. It is definitely a great way to enjoy the wondrous sights the city has to offer from a different perspective.

BrugeTo me, the country of Belgium seems well known for its beer and chocolate, and so the entire weekend was decidedly unhealthy in trying to indulge in sampling both of these treats. Saying that the selection of the beers in Belgium is wide would be a grossly misunderstatement. A mostly well worn tourist spot, the bar Berge sells around 300 unique beers on its menu and you need a book to order. Most bars that served a wide selection of beers tended to group them first by brand, then colour, and then percentage of alcohol. Most beers available are commonly strong, with many of the speciality beers easily over 6% (up to around 12%). Bruge locals tend to drink slowly to last the night away and you rarely see anyone drinking pints since they understand that you can’t simply slam a lot of these drinks down, without expecting to go with them!

Chocolate shops adorn many of the streets, especially around the more touristy areas of Markt and Burg, though many locals seemed to frequent them as well. We visited these places at the somewhat apt time leading up to Easter meaning that most of the stores we focused on producing Easter eggs, rabbits and chickens as well as the normal faire of truffles and blocks. Buying good quality chocolate to take home is not difficult either, and with all the prices from most of the chocolatiers being pretty similar, I recommend you simply buy the things that you want. The choice is amazing, all of them offer consistently high quality melt in your mouth chocolate, delicious hand made truffles, and liqueur filled chocolates.

Food seems to be quite an important aspect to the city, with almost every one of our meals being extremely tasty and enjoyable. Den Dyver is one such place that specialises in both fine dining and seafood, and with the Chocolate Festival Bruge is holding until the end of May, combined all of these aspects into a magnificent menu dubbed the ‘Culinary Walk through Chocolate’. Our experience of this five course masterpiece, more accurately named a ‘Leisurely Stroll’, lasted almost three and half hours of culinary bliss and included:

  • A four selection sampler of raw tuna and basil, cucumber sushi, a prawn and avocado salad, and a tiny bowl of celeriac soup, served with an aperitif;
  • Smoked duck served with local endives and salsify slices;
  • Grilled mullet with fennel mash and a white chocolate orange sauce;
  • Bass Baked in cocoa butter served with ginger pasta, vegetables and a trappist sabayon; and finished with
  • A wicked trio of small desserts of chocolate mousse and wine-vinegar soaked strawberries, a warm chocolate pudding and a fresh mint and chocolate heaping of ice cream.

This richly enjoyable and highly calorific experience did not necessarily come cheaply but was definitely worth the experience combining all the wonderful things on offer in this city.

On our last day, we even managed to spent a few hours in Brussels since we caught an earlier train and had to wait for our Eurostar back to Waterloo. The contrast I saw between the two cities was quite significant considering they belong to the same country and are only an hour separate from each other by train. Brussels, a predominantly French speaking city opposed to the Flemish one of Bruge, appeared much more ethnic as well as overly touristy. Dozens of tacky souvenir stores line the major roads and increase in density as you make your way to its more famous market squares. I found Brussels was significantly dirtier and definitely busier than the more laid back café-centred Bruge.

It was a fantastic weekend and we enjoyed every bit of it. See the photos here.

Down by the Poole

Poole

Looks like I’m back in Poole after six months. Updates to this blog may be far and few between as access to the Net is scarce and finding time to write even more so. Poole hasn’t changed much since I was last year. It seems like Biker Tuesdays are back on, the weather is getting a little bit warmer and the sunrises are quite spectacular.

Sunrise in Poole

The Great Cambridge vs Oxford Boat Race

On Sunday afternoon, the banks of the Thames welcomed the colleges of Oxford and Cambridge for this annual race off. It’s a very big occasion and crowds continued to flow effectively inundating the district line tube. The weather was apparently quite typical for this event, overcast, dreary and constant drizzle, but this still did not stop all the people that were out to celebrate and watch the event.

Cambridge Rowing Shed

Someone told me the conditions were perfect for rowing as there was little headwind and the water was extremely calm. Numbers of boats scored the centre of the river in anticipation of watching the entire race. I only managed to see the start of the heavyweights rowing but it was quite nice being around the atmosphere of everyone celebrating. I didn’t see any real competition on the banks of the Thames between supporting crowds but then again it was early in the afternoon.

Oxford Rowing Shed

Testing According to the Capability Maturity Model

  1. Initial – You don’t test or manually test in an ad hoc manner
  2. Repeatable – You start building test suite(s) that can be run repeatably
  3. Defined – You automate your test suites and run them in a continuous integration environment
  4. Managed – You start observing metrics from the tests such as how good the coverage is, how long it takes to run and how difficult they may be to write
  5. Optimising – You start to make changes to your code to make it easier to test, and you use the tests to highlight areas that need refactoring or a redesign. You start running Test Driven Development or Behaviour Driven Development to enhance the testability of your code.

After applying the CMM to way I execute testing, I find it interesting that the practices that emerged from the agile community are heavily biased towards the higher end of the CMM. There’s definitely a message here.

Disclaimer: This list was created by myself and does not reflect any official source associated with the Software Engineering Institute (SEI). It was written by me in terms of thinking of how I have seen testing executed and then trying to describe it in terms of the CMM.

Ask EMMA If You Are Covered

Code coverage is a useful tool for helping you work out how well you are testing your code. On most projects I have been on, I have found Clover to be the most well known and most popular but there are other alternatives, and this one in particular I am going to demonstrate how to use it.

On our current project, I used EMMA, an open source code coverage tool, to monitor how well we were testing various aspects of the code base. Results highlighted areas that were not test driven or areas that the team had neglected to deal with at the time (such as certain exception handling). This library is not specifically design to work only with JUnit, so I thought it might be useful to show you how we use it in our normal build that does use JUnit.

Steps to generate code coverage using EMMA

  1. Compile your classes
  2. Instrument your classes
  3. Execute your tests
  4. Generate the report

Compile Your Classes
With EMMA there is no change to the way that you can compile your classes as it allows you to instrument them post-compilation.

Instrument Your Classes
The distribution comes with a class that you can run against a set of classes that automatically generates the instrumented classes as shown below:

java –cp emma.jar emma instr –m overwrite –cp build/classes

where:
[emma] Is the executable java class for easily running all the features from this library.
[instr] Is the command for executing the instrumentation that weaves in all the monitoring features for generate code coverage information.
[-m overwrite] Is the output mode and states to overwrite the original classes. You can also output a copy if you want but you will have to specify the output directory using the –d/-dir/-outputdir option
[-cp build/classes] tells EMMA where it should be looking for the files to instrument.

Execute Your Tests
After instrumenting your classes with the features that monitor code coverage, you only need to run your tests as normal, only ensuring that you include the EMMA’s library jar in the classpath.

After running your tests you will see two output files including coverage.em and coverage.ec that are both used as inputs into the report.

Generate The Report
We will reuse the same executable class for generating the report as below:

java –cp emma.jar emma report –r html –in ../coverage.em,../coverage.ec -sp ../src

where:
[emma] Is the executable java class for easily running all the features from this library.
[report] tells emma that you want to generate a report from the coverage readings
[-r html] tells what format the report should be in
[–in ../coverage.em,../coverage.ec] tells emma where to find the code coverage data
[-sp ../src] links the java source files to the results so that you can get some nice graphical reports.

Your should end up with a HTML report that outputs something like the following:

Summary Code Coverage Report
Summary Report
Code Coverage Report with Source
An example output file with source attached

Ant Build Integration
You can use this build file (substituting appropriate values) if you want to get up and running quickly. It assumes:

  • You have the appropriate emma jar in the specified location (see buildfile)
  • You have the jar in the classpath of the tests
  • You have compile and test targets

Okonomiyaki @ Abeno Too

Okonomiyaki is a Japanese speciality dish best described as a savoury pancake mixed with a pizza. Traditionally you cook it in front of yourself on a hot teppanyaki grill and even though the base typically includes cabbage, flour, egg and water, you can put pretty much anything else into, or on top of it. Abeno, located closest to the British Museum, is the only place I know of in London that serves this Japanese speciality. They also have a second store aptly name Abeno Too (the latter word meaning the equivalent of ‘also’ or ‘as well’ in Japanese).

Okonomiyaki

I have eaten at both of these places and both are quite good. The clean and smooth table tops and real Japanese attendants indicate that they will serve you good quality Japanese food (appropriately Westernised for taste). Its prices are decent although typical for what you pay for Japanese in London and any of the super-deluxe okonomiyaki mixes are good value for money. Both of these places are small, so I recommend you make reservations for dinner or lunch if you intend to go on busy day or night like Friday or Saturday.

The two times that I have eaten there, the service has been good although I have heard it gets more difficult if you are eating at peak times. The staff speak to you in polite and soft tones and can explain the concept if you are new to okonomiyaki. Staff will cook the food on the grill in front of you and finish it off in the traditional manner topping it with okonomiyaki sauce, mayonnaise, seaweed flakes and bonito flakes that dance entertainingly from the heat off the hotplate. You then use mini spatulas to take pieces off the grill to your plate you can then liberally douse it in additional sauces (I highly recommend the hot sauce) for additional flavour.

Details: Abeno (7 Museum Street, Bloomsbury, WC1A 1LY) or Abeno Too (7-19 Great Newport St, WC2H 7JE)
Highlights: Okonomiyaki has strong layers of flavour and there’s nothing like eating off a hot grill.
Room for improvement: The premises are quite small and can be crowded
The Kua Rating: 7 out of 10