Strategies for building reliable user interfaces

Or, “unit testing of UI code is overrated”

This article is about how to make UI code reliable. By reliable I mean free from bugs. This implies that the software must also be maintainable, which is to say that you can easily add new features without also adding new bugs. By UI code I mean code that accepts input from users and displays results. In a modern JavaScript-powered web application, a lot of business logic is moved into the browser. For example, an online chess game may have a virtual opponent that can play against you, choosing the best move to make on each turn. Silly as it may sound to refer to chess as business, the code for this virtual opponent is “business logic” rather than UI, and you should probably unit test the shit out of it. UI code covers things like providing feedback as a player drags their chess piece across the board.

There’s something of a testing religion in software development. Mostly this is a Good Thing – unit tests are probably the most important tool for building reliable software. In this article I argue that in the context of UI development, there are better techniques for achieving reliability.

Continue reading Strategies for building reliable user interfaces

Making DNArtwork #8: Generating realistic painted shapes on-demand

DNArtworks are supposed to look like paintings, or at least like prints of paintings – with realistic brush strokes and no unnaturally straight lines:

Now a human may find it easier and faster to draw a sloppy picture than a neat one, but computers are the other way round. Drawing perfect geometric shapes is easy, but it takes much longer to make authentic-looking imperfections, both in terms of development effort and rendering time.

Continue reading Making DNArtwork #8: Generating realistic painted shapes on-demand

Project: DNArtwork

DNArtwork is a personal project to generate artwork from DNA. It took me 3 years, and is currently available at If you already have a DNA test from 23andme, National Geographic or, you can get your own artwork for free. If not, download and unzip this dummy DNA test result file so that you can see how it all works.

I’ve written a series of blog posts on various parts of the project: