Robert Chatley and Tom White (from Kizoom) have given a presentation on literate functional testing, which is using literate programming for creating tests. The idea is that you're telling
They have created a framework (soon to be at code.google.com, but not at the time of writing) that allows tests to be readable by non-coders and coders alike. The example that they gave was:
goToTheIndexPage(); assertThat(page,has(title("Google")); clickOn(link("Images")); enter("kizoom",into(textField()); assertThat(page, has(text("Kizoom summer party")); assertThat(it,has(image(),withUrlThat(endsWith("summer04.jpg")));
The idea is that you can read the code to explain what happens to not only coders, but also business analysts and people who want to understand what it's saying, rather than how it's implemented. As a neat extension, they had an Eclipse filter that removed the punctuation, so that it ended up as:
goToTheIndexPage assertThat page has title "Google" clickOn link "Images" enter "kizoom" into textField assertThat page has text "Kizoom summer party" assertThat it has image withUrlThat endsWith "summer04.jpg"
It seems to have a lot of similarities with other literate programming ideas (e.g. AppleScript). However, like AppleScript, only a subset of programmers get how to write it well (and I'm in the category of people who would like to be able to write AppleScript, but doesn't 'get' it completely -- actually, if there are any AppleScript authors reading this blog entry, please write a book on how to script applications like Mail and iCal/iChat; why is it every example is about scripting the Finder? I don't care about the folders, but I do care about manipulating data in my iLife applications).