Wednesday, October 06, 2010

Aristotelian unities for drama unit testing

I was discussing today a recent SE-Radio episode on "The History of JUnit and the Future of Testing with Kent Beck". In this podcast he (among other stuff) mentioned something to the effect that each test case (unit test) should tell a story complete with all the parts of a good story: intro, plot and finale.

My friend could not resist and soon provided me with a following excerpt from the definition of three classical unities of drama:
Aristotelian unities or three unities are rules for drama:
  1. The unity of action: a play should have one main action that it follows, with no or few subplots.
  2. The unity of place: a play should cover a single physical space and should not attempt to compress geography, nor should the stage represent more than one place.
  3. The unity of time: the action in a play should take place over no more than 24 hours.

So, there it is. Your guidelines for writing good unit tests. :)