Gerard Meszaros talks about problems and challenges doing unit testing in real-world projects. Starting from a short discussion about the importance of automated unit testing we spend most of this episode to talk about every day problems doing unit testing and how those problems can be solved. Based on this book on xunit testing patterns, Gerard talks about his experiences with unit test smells as an analogy to code smells. He describes an impressive set of unit testing patterns to overcome those difficult testing situations and illustrates them with nice examples everybody doing unit testing will feel familiar with.
listen to the complete podcast interview at sowftware engineering radio, episode 70.
ABSTRACT
Two key aspects of extreme programming (XP) are unit testing and merciless refactoring. Given the fact that the ideal test code / production code ratio approaches 1:1, it is not surprising that unit tests are being refactored. We found that refactoring test code is different from refactoring production code in two ways: (1) there is a distinct set of bad smells involved, and (2) improving test code involves additional test-specific refactorings. To share our experiences with other XP practitioners, we describe a set of bad smells that indicate trouble in test code, and a collection of test refactorings to remove these smells.
http://homepages.cwi.nl/~leon/papers/xp2001/xp2001.pdf