GameState.equals(SystemState)?
Anyone who knows me will tell you that I love video games. I've been playing them since the days of Pong, Space Invaders and Asteroid... Over the years games have come along way with enormous detail. My latest acquisition is Gears of War 2 (or Gears2 as us gamers affectionately call it) which I picked up just over a week ago.
What is so impressive about this game is the way it draws you in, the way you care for the characters... the phenomenal graphics! I mean the game could be a animated feature film! Some refer to it not as a game but as an interactive cinematic experience.
So, I've put in about cumulative 4-6 hours (or maybe more ;-) hours of game-play (hey - you guys watch films and TV - I play games)... If my character dies now, , what happens? Do I have to play the entire game through from the very beginning - all 6 hours worth? No! The game simply jumps me straight into the game at my most recently saved checkpoint, loading everything in under 20 seconds!
The game remembers the position of my character, the other characters (well seems to) the weapons I'm carrying, the amount of ammunition I have left and loads an enormously complex and detailed object graph representing the rest of the 3D environment! As my friend Antony Gorman put it when I was ranting to him about it over the phone a few minutes ago... they load an entire world in under 20 seconds!
So, why is it that with so many of the teams I visit, one of the things that slows them down and slows down test-runs is dealing with test-data? Why can't we load our little worlds in under 20 seconds? Why can't I have a series of snapshots of the database that can be loaded (with only the data I need for the current scene - i.e. test) and 'customise' it with specifics -just like the game does with my ammo-counts and character position?
Perhaps because we assume it is too hard, lacking that ever important naiveté? Perhaps because we don't care enough about making real progress and thus don't give enough care and attention to making these things fast?
It is not impossible to do! Yes, the games industry is renowned for having some of the smartest programmers around but that doesn't mean we should assume that us mere mortals in other industries cannot aspire to load that snapshot of our relevant scene quickly.
Of course, I'm talking primarily about end-to-end tests - those tests that aren't mocking out data and using stubs... but are functionally testing everything end-to-end. If a given group of tests is only interested in one user, one role, 11 documents and associated search-index and metadata, why can't I just load only that data in a few short seconds and run the associated tests... and then start from a whole new checkpoint for my next batch of functional tests
.Imagine what it would be like if you could load your system state just as you can load a checkpoint in a computer game? Are you doing this already? If you're not, why is that? Are you living for today but at the expense of tomorrow (in terms of throughput of your team)? Is it because you simply assume it's too hard? That it's not possible? When was the last time you tried?
