Wednesday, April 30, 2008

Testing by JExample

The back end of our software - the part which allows us to scale to millions of users - has some very long tests involving networks and databases. They take long enough to run (30+ minutes) that, when run over our VPN, the connection is sometimes dropped before the tests can conclude. While infrequent it is a cause of great frustration when it happens.

Unit tests need isolation from potential side-effects. Providing that isolation requires potentially extensive and / or time-consuming setup and sometimes tear-down code.

A very new testing framework based on JUnit is called JExample. Unlike JUnit, tests can depend one upon another. Since the tests have passed, the environment is in a known, tested as correct, state and can be relied upon as the basis of subsequent tests.If test A passes, then test B can rely upon the result and context of A. When A is a long test, or requires considerable setup or teardown, this can result in substantial time savings.

A dependency graph of tests is built and used to order the tests.

The main results are less elapsed time for the tests and test failures which are more likely to pin-[point the exact place where a problem is occurring.

The work is based on the paper by  Kuhn, Van Rompaey, Haesenbarger, Nierstrasz, Demeyer, Gaelli and Van Leemput. There is an introduction and Eclipse integration. Java 6 is required.

Tuesday, April 29, 2008

The Rails Way

I never picked up my novel. The Rails Way is well-written enough to have kept me reading it through the whole vacation. I read about 500 pages and if our vacation had been any less busy I would have finished it.

The text is easy to follow no matter how complex the topic, with the exception of a passage relating to meta-programming. I will have to go back and see if I do better a second time around.

I found a few typos and errors but none that obscured my understanding of the author's true intent.

The testing section had some good coverage of Rail's built-in facilities and also of RSpec. I have been reading about Shoulda recently also and I plan to compare the two more closely.

Agile Web Development with Rails has been considered the leading book on Rails. For a newcomer to the topic it is still a better book but, for anyone with some knowledge of the framework, this is a much better organized volume. Sam Ruby is updating it for Rails 2 but it will only be a beta book for most of this year.

Hill towns of the Cote d'Azur

Haut de Cagnes and St. Paul de Vence were two hill towns which we visited. People have been seeking the shelter of these steep hills since at least Roman times.

They both have associations with the Grimaldi family - rulers of Monaco - but only Haut de Cagnes attained the importance to gain a castle.

As a child I read how Hannibal crossed the Alps with his Elephants to avoid a Roman army blocking the route to Italy. Given the terrain it would have been very hard to force a passage along the coast with plenty of places for the Romans to set up a strong defensive position.

Now the coastal hills are thickly littered with houses showing how many people are attracted to the scenery, climate and food.

Haut de Vance
town square from
the castle roof.

Thursday, April 24, 2008

From the Left Bank to Notre Dame to the Louvre along the Champs Elysee to the top of the Arc de Triomphe to the Eiffel Tower to a bus back was about six miles including the long, long corridors of the Louvre. Excellent exercise after months of keyboard pounding.

Arc de Triomphe

I took photographs of each of the twelve roads leading from the Arc de Triomphe.

Notre Dame
has a crypt but, here, that is an archaeological site showing some of the foundations and wall upon which the area in front of the cathedral has been built. Apart from the many changes in use - including as houses and two different hospitals - it was a shore fortification in Roman times although the bank of the Seine is now at least fifty yards distant.

Do I hear footsteps?

A friend lent us a map of Paris. After arrival we noticed that she had underlined the metro station we used on the way in from the airport. She had also underlined the road of our hotel. The road is only 100 yards long and just has one hotel.

Before looking at the map I would have imagined that the odds of us staying at the same hotel were small. Now I have to believe that we actually did stay there...

Wednesday, April 23, 2008

The Rails Way is proving very readable and I am yet to pick up my novel.

Paris was fantastic - more on that later. We are now staying in a converted castle guardhouse near Nice. The restaurant here is incredibly good. Our room is huge with a balcony looking out over the valley. There are some very acceptable frog noises in the background as type. We are planning a more relaxing day tomorrow so I will catch up on the events of Paris then.

Saturday, April 19, 2008

Vacation reading

I often find it difficult to decide what books to read on vacation. Fun? Technical? If I really think I need to read some thick technical tome, I will often take just that one book. If I take the big book and a fun one, I know which one I will pick up when I get a moment.

For this trip I brought along "The Rails Way". I have found it very readable so far. I have been using Rails for a couple of years now and I find the approach of this book much more suitable now than the "Agile" book.

At the risk of not reading The Rails way, I also brought along Shadowplay by Tad Williams. I am a huge fan of his other books. Memory, Sorrow and Thorn is from the same genre but I liked it much more than the first book in this series. I will see if it grows on me...

The plane is waiting...

Friday, April 18, 2008

Making a start

My last vacation was to Scotland in 2006. I love the Highlands and Islands: The Great Glen, Skye, Kyle of Lochalsh, Mallaig, Oban and the lochs and valleys which connect them. Tobermory on Mull is a great favourite.

Tomorrow we leave for Paris and Nice. They will be such a contrast. One of the great cities of the world with its monuments and museums; and the grassy, rocky, lochs of the Scottish coast. Each is beautiful in its own way - each refreshing to the soul.

I still have to decide whether to bring my MacBook Pro with me. I can not remember the last vacation I took where I did not spend hours working late at night after a busy day's sightseeing. I have some ideas for a new web site. It would be a contrast to the heavy Java coding of the last ten months. I would probably use Ruby on Rails although Merb is an interesting and tempting alternative.

If I do not take the laptop with me, this first post might not be succeeded for a couple of weeks. I would love to be able to add some photos of Paris though...