Boredom-Driven Development

I mentioned in a previous post that the Ajax Experience conference crowd showed a great interest in automated testing. During one of the testing sessions, I posted a thought that got retweeted several times:

testing-rocks

After the conference, I spent some time looking at what the various frameworks had as for testing hooks built in. While I don’t have working experience with Rails, I was familiar with it’s console and some of the clever ways it lets you peek into your application to see how things are working (or not working) together. I was curious if Django had something similar, although I got sidetracked watching Django in the Real World from Django-Con 2009 before I got too far. There’s actually quite a few good quotes throughout the presentation, but this one from Kent Beck’s Test Driven Development: By Example stood out:

Tests are the Programmer’s stone, transmuting fear into boredom.

Too often, those of us in the maintenance section of the software life cycle are paralyzed by fear when we come across a problem. Can I fix this without breaking other things? Does anything in my application depend on this broken implementation? We shouldn’t have to ask these questions, and automated tests give us the confidence to make those necessary changes without the element of fear. You want that level of boredom.

Having to agonize over what should have been a simple bug fix is not a fun process. Test-driven development has caught a bad wrap from some who argue that TDD imposes unrealistic principles in real-world development. I disagree with that stance on the basis that most of Beck’s work that I’ve read has argued for practical rather than fanatical testing. If you can get to 100% code coverage, great, but do you really need to test your getter/setter methods? Probably not.

The Ajax Experience 2009

This week I was fortunate enough to attend The Ajax Experience (put on by the Ajaxian folks) out in Boston. The conference was spread over 3 days, covering a range of topics from ECMAScript5 and the future of JavaScript to running continuous integration suites against a web application.

It was a pretty hard coming back to Fargo Thursday afternoon and trying to jump back in to work the next morning with a head full of ideas that need to be pulled down, polished and persisted somewhere, but I managed to get through a few issues that I left unfinished the previous Friday.

The Future of Ajax

Monday morning, Ben Galbraith (co-founder of ajaxian.com) gave an excellent talk titled The Future of Ajax. His talk focused appropriately on the way new technologies like Canvas are changing the web. He demoed Bespin, a Mozilla Labs project that aims to create a full-featured web code editor in the browser using HTML 5 technologies.

There was also some focus on old things turned new. Ben had this to say about the JavaScript speed war:

When you increase the speed of something by an order of magnitude, you haven’t improved something, you’ve created something new.

That quote rightly focuses how critical the browser wars, specifically the JavaScript speed aspect, has been to modern web applications. Other innovations, such as the generational garbage collection built in to Chrome’s V8 engine is revolutionary, and I have a feeling that it will be copied by others in the future.

The Tools

Steve Souders is a pretty cool guy. He introduced two new tools at the conference: Browserscope and SpriteMe.

Browserscope is a crowdsourcing tool being used to profile various browsers. If you head over to the site, you can run a broad set of tests against your browser to test it’s capabilities. As you might expect, most of the tests are based on Souders’ rules for high performance web sites (get the book), but since the results are all captured, the hope is that Browserscope will be a resource for web developers needing information on the capabilities of different browsers.

SpriteMe is a JavaScript bookmarklet that searches a page for all of the CSS background images and then suggests how you might put them into a sprite to improve page performance. If you page has 20 background images, your browser has to make 20 requests to see if the images were modified (depending on how your web server is set up), so it can be a huge performance bottleneck on older browsers. SpriteMe even contains a link to generate the sprite for you (using CoolRunnings), and you can add or remove images to the sprite as you see fit.

The Crowd

Perhaps one of the best aspects of the conference was the group of attendees. I’m guessing there were around 300 people there, so it was a smaller conference, but it’s so valuable to be able to chat with other people who’ve faced problems you’re experiencing and be able to chat about how they solved them.

The Twitter crowd was pretty active. Common topics included, “Holy shit it’s cold in here”, “this Wakanda presentation is terrible”, and “The Hilton’s wireless would be great for testing our app against a spotty connection”.

The End.

All in all, the conference was great, and I’m so happy that I was able to attend. Having an oppurtunity to see Douglas Crockford and Steve Souders speak was well worth the trip alone.

I was also excited to see that there is a huge desire for automated testing in the Web world, but it’s still a tough problem to solve in an elegant manner.

The server-side JavaScript buzz will be an interesting thing to watch over the next year, but it seems to not have any real traction yet (perhaps the finalization of ES5 will change that).

Slides for many of the presentations can be found here.