Why testing early pays off

12 February 2007 Leave a comment

Part of what we’re doing at my current client is writing an HTTP interface to allow read only access to a Tangosol cache. For the first month or so we’ve been using Jetty (6.0.2) for testing and development, because it’s free and easy. Everything has been going well, and we finally got the official ruling that our webapp will run in production under JBoss (4.0.3SP1). We did expect this, as current webapps they have in production run under JBoss, but we were not sure of which version we were going to end up on so we stuck with Jetty. We’ve been very carefull to keep our app as vanilla as possible, but when we deploy our happy app under JBoss, we start getting showered with NullPointerExceptions like these:

java.lang.NullPointerException
at org.apache.xalan.transformer.SerializerSwitcher.switchSerializerIfHTML(SerializerSwitcher.java:153)
at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:991)

After a bit of poking around I found that the only nulls that existed in that area of our code was when we were calling startElement() and endElement() with nulls. A quick look at the JavaDocs for these methods says that you should pass “the empty string” if there is no Namespace URI or Namespace. Simply replacing calls like:

transformerHandler.startElement(null, null, ERROR_TAG_NAME, errorAttributes)

with

transformerHandler.startElement(“”, “”, ERROR_TAG_NAME, errorAttributes)

sorted out the problem!

We’re only due to go live with this app in July, but one of the patterns that has saved me many times is to test early and often. The trick is not to limit your testing, but push it as far as you can go. In this case, testing in a production like environment 5 months before we’re due to go live has meant we only needed to change a few lines of code in two classes. Imagine how much more we would have to change in 5 months time…

Categories: Development

Buildix Demo at London 2.0 RC6

8 August 2006 Leave a comment

For those of you in the London area who would like to know a bit more about Buildix, see it in action or just ask questions – I’ll be showing it off (so to speak) at London 2.0 RC6. For more info on where and when, check out Sam Newman’s blog entry. I think we even have a few CD’s left from Agile 2006 for those who are interested…

Categories: Linux, Software, Unix

Introducting Buildix – The Agile Development Platform on a disk

Ever since I started working for ThoughtWorks, I have heard people saying things along the lines of “Wouldn’t it be nice if we had some kind of Cruise-in-a-box to help us get projects up and running quickly?”. After about 6 months I was thinking the same thing, and started tinkering around with various options. Nothing really happened, until the first week of January this year when a group of us who often fill “Build Master” type rolls were all in the office together with a few days unassigned to clients. We were all sitting around a desk together catching up, when somehow the topic once again emerged. With the critical mass in place, this sparked off the birth of Buildix.

The whole point of Buildix is to help any Java based Agile Development Project get up and running as quickly as possible buy providing them with pre-configured and integrated version control system, continuous integration framework, wiki and issue tracking system. We chose our favourite products in each of these areas – Subversion, CruiseControl and Trac. Another common difficulty faced by our development teams, especially in the early stages of a project, is network access. Sometimes all we get from our clients when we arrive on site is a switch to allow us to get our laptops to talk to each other – no DNS, file shares, anything. Buildix can also help in situations like this, as it also runs Samba, and will run as a DNS and DHCP server if given the correct kernel boot parameters.

So, six months after we started, and after a few internal releases, we decided to give something back to the community that helps us do our job, and make Buildix available to everyone. Enjoy!

Categories: Development, Linux, Software, Unix

Solaris Zones in the Real World

At one of the clients I’m assigned to at the moment, we’re moving our development environment to Solaris 10 on Sun x4100 servers. We have two physical machines, one for our CruiseControl environments, and one for all our testing. To make good use of the resources we have (Dual Core CPU’s, lots of RAM) I’ve been carving them into zones. I’ve tinkered with zones in Solaris 10 ever since the first beta build that featured them, but it was always for little things and never anything serious. Consequently I thought they were quick and painless. Note the use of the word “thought”. Don’t get me wrong, they are the (almost) perfect solution for what we need, it’s just that if you’re planning on doing anything serious with them, here’s a list of gotchas you need to take in to consideration.

Read more…

Categories: Solaris, Unix, Virtualization

Trac Wiki HTML Scraper

22 March 2006 4 comments

A few of us are using Trac for an internal project at work, and at some stage in the process we decided to use the wiki as the distribution documentation. Everything has been going wonderfully, until we realized we that we wanted the documentation to be available without having to run Trac. After some digging around, I found this ticket on the Trac dev site where Alec Thomas put up a diff to allow you to download Trac wiki pages as HTML. After applying the patch, I found that it worked well, but there was still no easy way to pull the whole wiki down as HTML. So I wrote a python script to do it, and the script is available here for those who are interested.

Categories: Software, Stuff

The new site

So, after a short stab at blogging over at http://netnix.blogspot.com, I decided to start blogging at a domain name that was more me. Not because what I was writing about was of huge interest to people, or had lots to say. It’s just because I can. I’m going to leave the NetNix stuff where it is, as I don’t see the point of moving it. All new stuff will simply appear here.

Currently, the interesting stuff I’m working on is creating build production lines for software, and messing with virtualization. As soon as I have something interesting to report on either of these, you will see it here…

Categories: Stuff