25 September 2006
David Saff has come up with an entertaining metaphor for using mock objects: the School Fire Drill. There are a couple of ways to test that your pupils are prepared for a fire. You can set light to the school: the alarm will go off, everyone will troop outside, and the fire brigade will turn up and douse the building in water. Now you've tested the whole system so you can be sure that everything works. Of course, you'll have also lost your job but that's another matter. Alternatively, you can coordinate with the fire station and just set off the alarm. You can check that the pupils don't rush the exits and that everyone is accounted for. You can try a couple of different assembly points without much cost. You can keep your job. The rest of the system can be tested separately: you can check the alarm on Wednesdays at 11:00, and the fire brigade will have its own drills. Every once in a while, some building really will catch fire which will confirm that things work end-to-end. (In software, of course, you can run functional tests more predictably).
Posted by Steve Freeman at 22:19