Saturday, September 03, 2005

A neat improvement to JUnit testing

Joe Walnes has posted a neat way to simplify and improve tests with JUnit. His technique borrows classes from JMock, but doesn't require you to use Mock Objects.

SableCC v3 and Domain Specific Languages

If you're trying to build a external DSL, you'll need to write a compiler for it. If the language is non-trivial, you will probably want to use a parser generator. One of the best is SableCC, which deserves to be better known.

Nat Pryce (of JMock and OO-Matron fame) has written an excellent introduction to SableCC version 3.

I've been using v2 of SableCC for a couple of years to compile the DSL for the SmartRec project.

At the time I started work on SmartRec, v3 of SableCC was still unstable and the documentation was minimal. I decided to stick with V2, which was recommended for production applications.

I got off to a very quick start. Sadly, as the DSL got more sophisiticated my compiler got more brittle. I've been looking for a good solution for a while. Nat's article has given me one. Thanks, Nat!

Thursday, September 01, 2005

XP version 2, Mocking and more at the Agile Academy

I forgot to this before my holidays, so its kinda late in the day - but there is a really good series of courses on in London next week.

The Agile Academy Summer School runs from Monday 5th to Friday 9th September.

Agenda

Day 1: Introduction to programming with XP version 2

Day 2: Putting XP into practice with RoboCode

Day 3: Advanced Test-First with Mock Objects

Day 4: Acceptance Testing with Fit and Fit Library

Day 5: Automation of Builds and Deployment

They may still have some places free (but at this notice you may have to bring your own sandwiches).

The presenters are leading lights in the AgileCommunity and the courses will be very hands-on. Strongly recommended.

Apologies for posting this so late!

Better ways to find and satisfy requirements.

If you're interested in better ways to build better systems, you should take a look at the courses that Tom Gilb and Kai Gilb will be teaching in London this October.

Titles include Requirement Specification (two day), Evolutionary Project Management (two day) and Agile Inspection (one day).

Tom's new book on Competitive Engineering has had glowing reviews (not just from me :-) and the courses will give you a chance to learn how to apply key techniques directly from the author.

You can find out more at the testing solutions group website.

Saxon rocks! My XSLT transformations are now 20 times faster.

I'm currently developing a tailored course for one of my major clients. I use an XSLT pipleline to convert a huge Mind Map into pdf and html student notes .

As the course takes shape, the Mind Map has been getting larger and the conversion has been taking longer. Yesterday evening the publishing task ran for four and a half minutes - too slow for an agile developer like me!

Today I switched from XALAN to Saxonica's Saxon 8. The publishing task now takes 43 seconds, of which more than half is spent outside XSLT. The XSLT processing now runs 20 times faster!

I'm opening a lot of output documents in the slowest stylesheet, which may be the problem. You may not get the same speed-up in your applications. I'll do some more timings and report them here.

Saxon is developed by Michael Kay, the author of the XSLT 2.0 Programmer's reference. Michael has also played a key role in the development of the XSLT 1.0 and 2.0 specifications. Saxon comes in two versions; I'm using the free open source variety, but there is also a commercial schema aware version.

I also use the XSLT 2.0 engine/debugger in Altova's XML Spy. It's not open-source, but there is a free home edition and you can download the Altova XSLT engine separately (also free).

Saxon was the first widely available implementation of XSLT 2.0. It's functional and fast. If you're doing heavy-duty XSLT transformation, or need an open-source XSLT 2.0 engine, I strongly recommend it.