A practical workshop for those starting out writing unit tests and using a test first approach. Includes the use of Hamcrest pattern matchers you can easily create more readable unit tests and get better debug information when tests fail unexpectedly.
The core Hamcrest pattern matchers are now part of JUnit 4
As pairs, we will take a simple problem and write a test to represent a piece of behaviour. The test will be run and fail. Then we will write a class that makes the test pass, using the understanding of behaviour we have gathered by writing the test.
This workshop will get you into the idea of unit testing being a design activity not a post-coding check.
Who should attend
Anyone interested in learning about unit tests
What you will need
Bring your laptop with Java 6 and JUnit 4 installed - plus what ever IDE you wish to use (command line, Netbeans, Eclipse, etc).
Code-along - bring your laptop to write unit tests or refactor your own unit tests with hamcrest