Course Description

Tools, patterns and techniques for writing well-designed and testable code

Test-driven development is one of the key enablers for agile development, that allows us to develop stable and refactorable code, whose intent is clear and whose design can evolve incrementally. TDD allows us to capture and validate the rules governing the behaviour of our code.

And… it’s also fun! There’s a bunch of interesting tools available to assist us in developing robust tests, in identifying which tests to write, to help us compose tests and to automatically run our tests.

The course is taught through presentation, demos, plenty of hands-on labs and directed discussions.



2-3 days depending on previous experience and scope.


Target Audience

Java developers and analysts, typically in the context of adopting agile development practices.


Course Prerequisites

If you have any questions or doubts as to whether you meet the pre-requisites for this course, or indeed are wondering which course best suits you, please consult with us to discuss your suitability for course attendance.


Suggested Follow on Courses

Please contact us for further details.


Course Content


why test-driven development?

is TDD necessary?

TDD is about…; red/green/refactor

Getting started

developing in Eclipse;

separating code from tests;

package structures;

JUnit 4 basics; assertions;

JUnit setup/teardown; exceptions;


Writing tests

base test classes;



implementation strategies;

exploring APIs;

parameterized test runners


testable code

equals & value objects;

seams and sensing;

seam types;


singletons & statics;

dependency injection;

“tell, not ask”

Test doubles

test double taxonomy;

stubs; fakes;



setting expectations & verifying interactions;

mocking gotchas;

testing legacy code;


Organizing tests

test suites;

explicitly-built test suites;

implicitly-built test suites;

filtering and sorting;



making the context concrete;

one-time setup for classes;

one-time setup for suites;

fixtures & superclasses;

object mothers;

fixtures as objects;

data-driven fixtures;

using databases;

testing database code

Tests as specification

the trouble with TDD;

behaviour driven design;

acceptance testing;


Fit & Slim fixtures;

patterns & practices

TDD in context

relationship to other agile practices;

closing discussion

Appendix A Supporting Tools

Appendix B Spring Framework


See more Other courses