John Lam makes some interesting observations about test-first as it relates to GUI development:
I've been spending a fair amount of time recently writing GUI rendering code. I've also been spending a fair amount of time recently grappling with unfamiliar API's. These experiences have revealed two areas where test-first development doesn't quite work:
- GUI rendering code where "correctness" is determined by how something must look
- Early stage implementation where interface churn is the norm
The first case encompasses virtually all of GUI development, regardless of whether your GUI is an HTML page or a traditional Windows application. In these cases, whether or not something is "correct" depends on how an object appears. Unfortunately, there are usually several different ways to render the object, all of which yield correct results. Furthermore, it's really hard to determine how an object is rendered programmatically, whereas it is usually quite simple for a human to determine if an object looks "correct".
Yeah, I can definitely see that. A lot of the GUI is subjective rather objective. A test can tell you conclusively whether or not a transaction happened - it can't tell you whether the foreground and background colors are frelled. Ultimately, you're going to have to do some human factors work.