Wednesday, June 14, 2006

Brian Marick's Sentence Style Tests

Brian Marick has also been thinking about making tests more readable (also inspired by jMock). He mentions what Tom and I have been writing about (thanks Brian). His tests are perhaps more readable because a lot of the functions are written to explicitly test particular cases, e.g.

page.main_text.should_have_no_list_named(:visits).
should_have_no_list_named(:audits).
and_should_have_a_help_popup_named(:patient_display_page)

so the logic or quantification is combined with the noun he is trying to match, in the same statement. We have tried to construct more general building blocks, which means we tend to have rather more nesting of clauses. Also, Brian benefits from the fact that he is using Ruby rather than Java, so the syntax is somewhat less cumbersome.





<< Home

This page is powered by Blogger. Isn't yours?