Workshop: "Test Driven Development"
Time: Thursday 09:00 - 17:00
Location: Musikhuset Nr. 222
This tutorial demonstrates the development of a small example application using test-driven development and related technologies. The system will comprise a handful of Java classes that exemplify typical components found in enterprise applications, including domain objects and a service layer. The tutorial is structured into three ‘iterations’ which cover
- state-based testing with JUnit
- interaction-based testing with JUnit and jMock
- deployment in lightweight containers such as PicoContainer and Spring.
The iterations not only introduce the concepts but also provide room for the discussion of trade-offs and edge cases, e.g. how to deal with testing private methods and when not to use dynamic mocks but fake objects. The implementation will make use of the Dependency Injection pattern and the last iteration examines how this is supported by lightweight containers.
Attendees gain an understanding of how proper use of test-driven development fosters good design; through decoupling and interface discovery for example. Attendees will also gather a nice catalogue of the most commonly used patterns used in conjunction with test-driven development.