[Geek] Is it possible to apply TDD principles to the development of UI components?

Jan 31, 2009 11:03

(I was originally going to post this on Stackoverflow.com, but I think it may have been asked enough in various forms to answer my question...)I'm keen on the idea of TDD, and I find it works well for non-UI code. However, recently I've found myself working on interactive visualisation tools and other UI components and I'm finding it difficult, if ( Read more... )

hci, tdd, geek

Leave a comment

Comments 6

(The comment has been removed)

inferis January 31 2009, 12:49:50 UTC
Unit testing is not TDD.

Reply

(The comment has been removed)

inferis January 31 2009, 14:10:40 UTC
I think you're missing the point.

For a component which enables some form of HCI, the only tests that can be written before the tool is designed are qualitative rather than quantitative, e.g. "when I move the mouse over this control it should highlight the grid square the mouse is above". This description of behaviour doesn't define a specific test so you can't use it to drive the development of the component itself. Certainly it's impossible to write a unit test for this kind of thing.

The unit testing of GUIs composed of pre-existing components with already well-defined APIs is another area entirely, but still one in which I think TDD is of little to no use at all.

Reply


gaius_octavian January 31 2009, 14:12:10 UTC
I have never understood TDD. I mean, I know what it is and how to do it. It just always seemed to me that when people think they want unit tests, what they really want is to switch from an imperative to a functional language, or at least, they want referential transparency. Except they were asleep in CS101 and don't know how to articulate that.

The question in your case is, would it be easier to invent AI than to test it manually? ;-)

Reply

monted February 1 2009, 00:47:19 UTC
Timesaving - not everyone has the luxury of a testing team, and in a small busy team unless the tests are written first they often fall off the map ('feature finished? out the door! next feature!').

Reply


Leave a comment

Up