OpenSpace, XP Agile Universe 2004, Calgary
We discussed the goal of documenting the patterns commonly used in developing automated tests using any of the XUnit test automation frameworks. Much of the discussion started in the form of a question:* I was told that I should extract an interface for a class I wish to mock rather than just subclassing the concrete class. Why?
The patterns not only describe how to do something but also why you should do it and when you should not. As an example, the reason for defining an interface for the Mock Object to implement rather than just subclassing the existing class is to ensure that we know exactly how the Mock will behave and to reduce the effort in implementing the Mock Object by reducing the number of methods that need to be implemented / overridden.
We also discussed some of the differences between variants of XUnit including some of the differences in how NUnit works as compared to JUnit.
More information on XUnit Patterns can be found at http://xunitpatterns.com or http://testautomationpatterns.com:8080.