Unit tests -- What and why? Unit tests vs. System integration tests Why? To get the units and the system to work Later, to make sure you didn't break anything that used to work ("regression test") -- Unit test frameworks (PyUnit, JUnit) -- Using PyUnit (aka unittest) -- Samples: primechecker.py, primecheckertester.py -- Assignment for Monday: getting started Patterns -- Abstract Factory -- Singleton -- MVC "Lazy instantiation" class SingletonMoose { private static Moose moose = null; public static Moose getMoose() { if (moose == null) { moose = new Moose(); } return moose; } } Everywhere else, when you need the moose, you say Moose theMoose = SingletonMoose.getMoose();