I've just finished an excellent little book, A Computer Called LEO by Georgina Ferry (1), about the history of the Leo, the first business computer in the world (2). Commissioned by Lyons, the UK's leading catering company at the time, it was a technical triumph but lost out commercially. A friend of mine, Alan Keen, actually worked on one in his youth and found it an excellent machine.
What patterns can we recognise?
Good
Bad
In the end, the Leo company was sold off to English Electric who misunderstood the product and imposed a hierachical organisation. Finally, the government arranged a shotgun wedding of all the UK vendors into ICL and the rest, as they say, is history.
Although the motivations of the original sponsors were Taylorist, to come up with exactly one way of processing data, their approach to the Leo team had many Agile aspects. They certainly had courage, to commission a radical use of such a new technology; they emphasised communication to make sure that the team was effective and that they implemented the right applications; they had techniques to feed back errors that ensured the reliability and correctness of their system; and they probably valued simplicity too.
The morals of this tale?
(1) Published by Fourth Estate, ISBN 1-84115-185-8
(2) It ran a Bakery Valuations program on 25th November 1951.
At XPDay London, Tim Mackinnon and Joe Walnes presented a tutorial on using Mock Objects to drive top-down design. With Nat Pryce and me, they make up a Gang of Four who've been reworking our thinking about Test Driven Development with Mock Objects.
Martin Fowler was there giving a keynote and came to the tutorial. We've been having an ongoing discussion with him about whether or not Mocks are a good idea. Martin's view (I think) is that they expose too much about the implementation and so inhibit refactoring. Our view is that if you have control of your types and define appropriate interfaces, then those interfaces should be abstract enough not to get in the way — except now you should have a cleaner design.
Last week, while pairing with Peter Bell at work, I had both experiences. We reworked some code that only had a "cluster" (1) test and, true enough, it was easy to change the internals. On the other hand, we were trying to add more behaviour and the tests would have exploded if we'd coded up all the combinations. But the really interesting event (to me, at least) was that a small code change (in formatting) required changes to all the tests because of the knock-on effects. When we went on to break up the Cluster tests into more orthogonal mock-based tests, it was much easier to get full coverage and a better design fell out.
So, my current conclusion is that Cluster tests can be easier to refactor, but that's not the only flexibility that matters. What's most important, however, is to stick to the Tell, don't Ask principle, which is the real key to flexible code.
(1) Many TDD'ers like to work with small clusters of related objects, like a little integration test. They set some initial conditions and check the state of the objects at the end of the test.
Ward has announced that he's joined Microsoft. Given the number of Agile luminaries they've acquired, I'd like to see some early progress from Microsoft in making their products appropriate for Agile Development.
I've been converting my soon-to-be-ex (1) team to the XP approach to comments (i.e. don't, fix the code instead). We had a problem that really had to have a line of comment to explain it (some hackery to stop Visual Studio complaining). Peter Clary noticed that when there are very few comments, the ones you do have really stand out and attract your attention. Kinda obvious, really, but it's nice to have the reinforcement.
(1) Last day in Thomson Financial on Monday, joining Thoughtworks next year.
P.S. My first post! Finally got around to it...