tdd
Unit Testing Fundamentals
Below and attached are slides from a presentation I gave to colleagues at Kiwiplan. The presentation covers a range of topics regarding unit testing best practices, including test driven development (TDD), mocking frameworks, avoiding over-specification and test coverage. The slides also include diagrams to help explain the concept of isolating code through the use of seams.
I’ve attached the final outcome of the live TDD examples. Obviously TDD doesn’t come across very well as a final solution, however the code also provides basic examples of the Mockito and Rhino Mocks libraries. The code style is based on Spring Framework’s annotation driven MVC framework.
Java example code – JUnit, Mockito, EclEMMA (Eclipse Java coverage)
VB.Net example code – NUnit, Rhino Mocks
Mocking in Java with Mockito
A ran a session at the Auckland Java User Group on using Mockito. Slides are embedded below using slideshare:
As promised I’ve attached my slides and also included the example source files in a zip. To run the unit tests you will need JUnit 4.5 and Mockito 1.6.
Search
Subscribe
Recent Posts
Tags
Archives
What I'm Doing...
- Missed my tube stop playing Archipelago, sign of a compelling game. If only it had multiplayer #android 3 hrs ago
- Beautiful website too! RT @aalmiray http://nosqleu.com/ is the place to be if you care about #nosql 1 day ago
- (2008..new Date()[Calendar.YEAR]).each() {} #lovingthegroovy 2 days ago
- More updates...