Test FIRST, not lastSo we’re going to test FIRST...Analyze the taskWrite the test BEFORE any other codeWelcome to test-driven developmentYour first test...... fails miserably.NOW write code to get the test to pass.Get your tests to GREENRed, green, refactor...In TDD, tests DRIVE your implementationCompleting a task means you’ve got all the tests you need, and they all passWhen your tests pass, move on!Different task, same processRed: write (failing) testsGreen: write code to pass testsSimplicity means avoiding dependenciesAlways write testable codeWhen things get hard to test, examine your designThe strategy pattern provides for multiple implementations of a single interfaceKeep your test code with your testsTesting produces better codeMore tests always means lots more codeStrategy patterns, loose couplings, object stand ins...We need lots of different, but similar, objectsWhat if we generated objects?A mock object stands in for real objectsMock objects are working object stand-insGood software is testable...A whole-lotta-nuthin’It’s still me...Ghosts from the pastIt’s not easy bein’ green...When all of your tests pass, you’re doneA day in the life of a test-driven developer...Tools for your Software Development Toolbox